-
Notifications
You must be signed in to change notification settings - Fork 613
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
fix(storage): update seal_epoch synchronously #7171
Conversation
884bb55
to
db94868
Compare
@@ -268,6 +268,9 @@ impl StateStore for HummockStorage { | |||
warn!("sealing invalid epoch"); | |||
return; | |||
} | |||
// Update `seal_epoch` synchronously, | |||
// as `HummockEvent::SealEpoch` is handled asynchronously. | |||
self.seal_epoch.store(epoch, MemOrdering::SeqCst); |
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.
Before this PR, the seal epoch should be updated in somewhere else. Should we remove updating the seal epoch there?
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.
Before this PR, the seal epoch should be updated in somewhere else. Should we remove updating the seal epoch there?
+1. I think we don't need to update seal epoch when handling HummockEvent::SealEpoch
in HummockEventHandler
.
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.
Fixed.
If this PR is intended to fix the panic caused by |
Codecov Report
@@ Coverage Diff @@
## main #7171 +/- ##
=======================================
Coverage 73.15% 73.15%
=======================================
Files 1053 1053
Lines 167994 167996 +2
=======================================
+ Hits 122891 122893 +2
Misses 45103 45103
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Anyway, the current fix LGTM. We may introduce the real wait in future PR.
Agree. |
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
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
Before this PR, seal_epoch updating is handled by HummockEventHandler asynchronously, which cannot ensure HummockEventHandler::seal_epoch is updated before notifying barrier finishing . It can lead to current epoch can't read, because the epoch in storage is not updated.
This PR fixes it by updating HummockStorage::seal_epoch synchronously, which shares the same underlying atomic var of HummockEventHandler::seal_epoch.
Checklist
- [ ] I have added necessary unit tests and integration tests- [ ] All checks passed in./risedev check
(or alias,./risedev c
)Documentation
If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.
Types of user-facing changes
Please keep the types that apply to your changes, and remove those that do not apply.
Release note
Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.
Refer to a related PR or issue link (optional)
fix #7169