Skip to content

Conversation

@JacksonYao287
Copy link
Collaborator

@JacksonYao287 JacksonYao287 commented Dec 26, 2025

1 trigger gc for all chunks
curl -k https://127.0.0.1:10443/api/v1/trigger_gc

2 trigger gc for a specific chunk
curl -k https://localhost:10443/api/v1/trigger_gc?chunk_id=123

3 query the status of a gc job. ATM, we only support one pending gc job
curl https://localhost:10443/api/v1/gc_job_status?job_id=trigger-gc-task-0

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 6.02410% with 156 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v4@24813fa). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/homestore_backend/hs_http_manager.cpp 0.67% 148 Missing ⚠️
src/lib/homestore_backend/gc_manager.cpp 62.50% 2 Missing and 1 partial ⚠️
src/lib/homestore_backend/hs_http_manager.hpp 0.00% 3 Missing ⚠️
...ib/homestore_backend/replication_state_machine.cpp 66.66% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@          Coverage Diff          @@
##             v4     #379   +/-   ##
=====================================
  Coverage      ?   57.18%           
=====================================
  Files         ?       36           
  Lines         ?     4809           
  Branches      ?      598           
=====================================
  Hits          ?     2750           
  Misses        ?     1773           
  Partials      ?      286           

☔ 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.

pg_id, (priority == task_priority::emergent) ? "emergent" : "normal");
}

// 3.5 Wait for all GC tasks in this PG to complete
Copy link
Contributor

Choose a reason for hiding this comment

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

It may take a long time, right? Just return the job id and let user query the job status?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, if too many chunk need to be gc, it probably take a while, so just return a job id, with which the user can query the job status.

return;
}
// Create new job and set as current (replacing any completed job)
current_gc_job_ = job_info;
Copy link
Contributor

@yuwmao yuwmao Dec 26, 2025

Choose a reason for hiding this comment

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

If we want to specify the chunk_id, then we can only clean chunks one by one, can we add some concurrency?

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

private:
enum class GCJobStatus { PENDING, RUNNING, COMPLETED, FAILED };

struct GCJobInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

From user's perspective, suggest adding pg_id as well.

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 , sure

@JacksonYao287 JacksonYao287 force-pushed the trigger-gc-manually branch 2 times, most recently from e08ac14 to ec6d1c7 Compare December 28, 2025 01:37
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.

3 participants