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

fix(storage): update seal_epoch synchronously #7171

Merged
merged 3 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ impl HummockEventHandler {
if is_checkpoint {
self.uploader.start_sync_epoch(epoch);
}
self.seal_epoch.store(epoch, Ordering::SeqCst);
}
#[cfg(any(test, feature = "test"))]
HummockEvent::FlushEvent(sender) => {
Expand Down
3 changes: 3 additions & 0 deletions src/storage/src/hummock/state_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

self.hummock_event_sender
.send(HummockEvent::SealEpoch {
epoch,
Expand Down