Skip to content
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

SealShard state change in pre-commit #120

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

JacksonYao287
Copy link
Collaborator

@JacksonYao287 JacksonYao287 commented Dec 3, 2023

in this PR, we change the shard state from open to sealed when pre_committing the seal_shard message, and change the state back to open if roll_back happens.

but this can not fundamentally solve the conflict between seal_shard and put_blob, since when handling put_blob request, it will only check the shard state at the very beginning, and will not check again before entering raft phase(propose_to_raft). so we need a callback before appending the log where we could check the shard state again.

this should be done in homestore to provide the interfact accepting this callback

for some corner case , like we have a stale blob for shard-1 in shard-2, it will behandled by GC.

@JacksonYao287 JacksonYao287 added the enhancement New feature or request label Dec 3, 2023
@JacksonYao287 JacksonYao287 self-assigned this Dec 3, 2023
@JacksonYao287 JacksonYao287 added this to the MileStone3.12 milestone Dec 3, 2023
@JacksonYao287 JacksonYao287 linked an issue Dec 3, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Attention: Patch coverage is 32.83582% with 45 lines in your changes are missing coverage. Please review.

Project coverage is 68.01%. Comparing base (c6f7d23) to head (ed869ce).

Files Patch % Lines
src/lib/homestore_backend/hs_shard_manager.cpp 32.60% 28 Missing and 3 partials ⚠️
...ib/homestore_backend/replication_state_machine.cpp 33.33% 13 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
- Coverage   69.53%   68.01%   -1.53%     
==========================================
  Files          30       30              
  Lines        1474     1538      +64     
  Branches      148      157       +9     
==========================================
+ Hits         1025     1046      +21     
- Misses        369      409      +40     
- Partials       80       83       +3     

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

@JacksonYao287 JacksonYao287 force-pushed the precommit branch 3 times, most recently from efacc25 to 69380a0 Compare December 18, 2023 01:47
@szmyd szmyd removed their request for review December 18, 2023 22:11
@eBay eBay deleted a comment from zichanglai Jan 18, 2024
@JacksonYao287 JacksonYao287 force-pushed the precommit branch 2 times, most recently from fb90397 to f57ffb7 Compare January 18, 2024 12:49
@hkadayam hkadayam removed this from the MileStone4.1 milestone Jan 31, 2024
Copy link
Collaborator

@xiaoxichen xiaoxichen left a comment

Choose a reason for hiding this comment

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

lgtm

// move seal_shard to pre_commit can not fundamentally solve the conflict between seal_shard and put_blob, since
// put_blob handler will only check the shard state at the very beginning and will not check again before proposing to
// raft, so we need a callback to check whether we can handle this request before appending log, which is previous to
// pre_commit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

prior to the pre_commit of put_blob

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for pointing out this misusing , will be careful!

// raft, so we need a callback to check whether we can handle this request before appending log, which is previous to
// pre_commit.

// FIXME after we have the callback, which is coming in homestore.
Copy link
Collaborator

Choose a reason for hiding this comment

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

an issue in HS and HO respectively, pls

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

@JacksonYao287 JacksonYao287 merged commit 3b05a73 into eBay:main Apr 5, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SealShard state change in pre-commit
5 participants