Skip to content

Conversation

@JacksonYao287
Copy link
Collaborator

@JacksonYao287 JacksonYao287 commented Dec 26, 2025

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

2 trigger gc for a specific chunk
curl -X POST 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=gc-1703123456789-0

@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 3.61446% with 160 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.68% 146 Missing ⚠️
...ib/homestore_backend/replication_state_machine.cpp 0.00% 8 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 ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@          Coverage Diff          @@
##             v4     #379   +/-   ##
=====================================
  Coverage      ?   56.56%           
=====================================
  Files         ?       36           
  Lines         ?     4819           
  Branches      ?      600           
=====================================
  Hits          ?     2726           
  Misses        ?     1810           
  Partials      ?      283           

☔ 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

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