-
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
SealShard state change in pre-commit #120
Conversation
08f639f
to
67d9c61
Compare
bbceb31
to
4dc0358
Compare
82525d5
to
63679a7
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 @@
## 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. |
efacc25
to
69380a0
Compare
69380a0
to
f3a4ed9
Compare
fb90397
to
f57ffb7
Compare
914b477
to
67c74bb
Compare
e80cb57
to
14a21f2
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
// 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. |
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.
prior to the pre_commit of put_blob
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.
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. |
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.
an issue in HS and HO respectively, pls
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.
sure
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.