-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SnapshotReceiveHandler & Add UT #232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm aside from a few nit
There is a comment from Yaming to add flip points into each step, please create ticket to track that if we want to finish the code first
@@ -59,13 +58,14 @@ int HSHomeObject::SnapshotReceiveHandler::process_shard_snapshot_data(ResyncShar | |||
shard_sb.chunk_id = chunk_id; | |||
|
|||
homestore::MultiBlkId blk_id; | |||
const auto hints = home_obj_.chunk_selector()->chunk_to_hints(chunk_id); | |||
const auto hints = home_obj_.chunk_selector()->chunk_to_hints(shard_sb.chunk_id); | |||
auto status = homestore::data_service().alloc_blks( | |||
sisl::round_up(sizeof(shard_sb), homestore::data_service().get_blk_size()), hints, blk_id); | |||
if (status != homestore::BlkAllocStatus::SUCCESS) { | |||
LOGE("Failed to allocate blocks for shard {}", shard_meta.shard_id()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure will we always baseline resync to a brand new member? if not, maybe we need to let emergency gc kick in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to clean up all the existing data in the PG at the start of a snapshot resync to reduce complexity. The cleanup logic will be implemented later.
766786f
to
0847b98
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## baseline_resync #232 +/- ##
==================================================
Coverage ? 64.38%
==================================================
Files ? 33
Lines ? 2047
Branches ? 234
==================================================
Hits ? 1318
Misses ? 613
Partials ? 116 ☔ View full report in Codecov by Sentry. |
87f5849
to
8ebc276
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SnapshotContext
fromSnapshotReceiveHandler
to split constant and mutable membersSnapshotReceiveHandler
and fix some bugs