-
Notifications
You must be signed in to change notification settings - Fork 593
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: use EpochWithGap::new_max_epoch if the provided epoch is max epoch #13881
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.
Test in the same way , fix this issue #13882
src/storage/hummock_sdk/src/lib.rs
Outdated
EpochWithGap::new_max_epoch() | ||
} else { | ||
debug_assert!((epoch & EPOCH_SPILL_TIME_MASK) == 0); | ||
EpochWithGap(epoch + spill_offset) |
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.
expected u64
, found u16
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
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #13881 +/- ##
=======================================
Coverage 68.22% 68.22%
=======================================
Files 1525 1525
Lines 262188 262189 +1
=======================================
+ Hits 178867 178878 +11
+ Misses 83321 83311 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/common/src/util/epoch.rs
Outdated
// Low EPOCH_AVAILABLE_BITS bits set to 1 | ||
pub const EPOCH_SPILL_TIME_MASK: u64 = (1 << EPOCH_AVAILABLE_BITS) - 1; | ||
// High (64-EPOCH_AVAILABLE_BITS) bits set to 1 | ||
pub const EPOCH_MASK: u64 = !EPOCH_SPILL_TIME_MASK; |
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.
The EPOCH_MASK
is fully flipped compared to before this PR. It is used anywhere else? If not I think we can remove this const or make it private.
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
…ch (#13881) (#13892) Co-authored-by: Zhanxiang (Patrick) Huang <[email protected]>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
#13696 fixes the max epoch bug for range tombstone but introduces a overflow panic when the provided epoch is u64::MAX. For example, the HummockEpoch::MAX epoch here will be later used to create EpochWithGap with MAX_SPILL_TIMES, which will cause a u64 overflow. This panic will be 100% triggered for sinks with log store enabled.
This PR fixes the issue by treating epochs in [MAX_EPOCH, u64::MAX] as the maximum EpochWithGap(u64::MAX).
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.