Skip to content

Conversation

@JacksonYao287
Copy link
Collaborator

@JacksonYao287 JacksonYao287 commented Dec 26, 2025

1 trigger gc for all chunks
curl -X POST "http://127.0.0.1:5000/api/v1/trigger_gc"

2 trigger gc for a specific chunk
curl -X POST "http://127.0.0.1:5000/api/v1/trigger_gc?chunk_id=87"

3 trigger gc for a specific pg
curl -X POST "http://127.0.0.1:5000/api/v1/trigger_gc?pg_id=87"

4 query the status of a gc job. ATM, we only support retain the status of the latest 100 gc jobs
curl -k "https://localhost:10443/api/v1/gc_job_status?job_id=trigger-gc-task-0"

5 query the status of all gc jobs.
curl -k "https://localhost:10443/api/v1/gc_job_status"

all the above apis have been tested manually, UT will be added later in a separate PR

@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 4.12844% with 209 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v4@2e63ecf). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/homestore_backend/hs_http_manager.cpp 0.52% 189 Missing ⚠️
src/lib/homestore_backend/gc_manager.cpp 47.05% 6 Missing and 3 partials ⚠️
...ib/homestore_backend/replication_state_machine.cpp 0.00% 8 Missing ⚠️
src/lib/homestore_backend/hs_http_manager.hpp 0.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@          Coverage Diff          @@
##             v4     #379   +/-   ##
=====================================
  Coverage      ?   55.94%           
=====================================
  Files         ?       36           
  Lines         ?     4869           
  Branches      ?      602           
=====================================
  Hits          ?     2724           
  Misses        ?     1861           
  Partials      ?      284           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JacksonYao287 JacksonYao287 force-pushed the trigger-gc-manually branch 3 times, most recently from ec6d1c7 to 6d9a9d0 Compare December 28, 2025 01:53

void HttpManager::get_gc_job_status(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) {
auto job_id_param = request.query().get("job_id");
if (!job_id_param) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no job_id_param, how about returning all jobs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it reasonable that one client can see the jobs results that submitted by others?
I suggest to postpone this until we really need the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to know what is happening on this SM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will try to add this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done , use the following command to query the status of all gc jobs.
curl -k "https://localhost:10443/api/v1/gc_job_status"


std::vector< folly::SemiFuture< bool > > gc_task_futures;

for (const auto& pg_id : pg_ids) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesnt matter for this time as we decided to stop everything.

As a more generic enhancement,

  1. Could we do PG by PG ? that only quience a PG at a time and resumed once the PG completed. It has much less impact to traffic, if next time we want to do GC with traffic on.
  2. if we have a hs_pg::gc_chunks(vector <chunk_id> chunks) , which will quience, GC, resume, can we consolidate most of the dup code between the two path (all_chunks and one_chunk)?
  3. we can support gc a pg.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have change the api to supporting triggering gc for a specific chunk or gc.
if we trigger all the chunks, then it will be scheduled pg by pg

@JacksonYao287 JacksonYao287 force-pushed the trigger-gc-manually branch 3 times, most recently from f1d478b to b76b917 Compare January 6, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants