Fix CompareDbtEndpoints crash with timestamp-aware comparators (#14601)#14611
Closed
laurynas-biveinis wants to merge 1 commit intofacebook:mainfrom
Closed
Fix CompareDbtEndpoints crash with timestamp-aware comparators (#14601)#14611laurynas-biveinis wants to merge 1 commit intofacebook:mainfrom
laurynas-biveinis wants to merge 1 commit intofacebook:mainfrom
Conversation
…ook#14601) Summary: `RangeTreeLockManager::CompareDbtEndpoints()` called `Comparator::Compare()` on range lock endpoint keys that never contain user-defined timestamps. With a timestamp-aware comparator (`timestamp_size() > 0`), this caused assertion failures in debug builds and silent endpoint misordering in release builds. Replace `Compare()` with the 4-argument `CompareWithoutTimestamp()` using `a_has_ts=false, b_has_ts=false`, which is the correct contract for serialized range lock endpoints (format: `[1-byte suffix][key bytes]`, no timestamp). Test Plan: - New test `RangeLockWithTimestampComparator` reopens with `BytewiseComparatorWithU64Ts` and exercises range lock acquisition, conflict detection, and non-overlapping success with short keys. - Verified RED (assertion failure) before fix, GREEN after. - Full `range_locking_test` suite passes (16/16). - Stress tested with `COERCE_CONTEXT_SWITCH=1 --gtest_repeat=5`.
|
@laurynas-biveinis has imported this pull request. If you are a Meta employee, you can view this in D100775201. |
✅ clang-tidy: No findings on changed linesCompleted in 48.0s. |
Contributor
|
/claude-review |
xingbowang
approved these changes
Apr 15, 2026
|
@laurynas-biveinis merged this pull request in 94b6566. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
RangeTreeLockManager::CompareDbtEndpoints()calledComparator::Compare()on range lock endpoint keys that never contain user-defined timestamps. With a timestamp-aware comparator (timestamp_size() > 0), this caused assertion failures in debug builds and silent endpoint misordering in release builds.Replace
Compare()with the 4-argumentCompareWithoutTimestamp()usinga_has_ts=false, b_has_ts=false, which is the correct contract for serialized range lock endpoints (format:[1-byte suffix][key bytes], no timestamp).Test Plan:
RangeLockWithTimestampComparatorreopens withBytewiseComparatorWithU64Tsand exercises range lock acquisition, conflict detection, and non-overlapping success with short keys.range_locking_testsuite passes (16/16).COERCE_CONTEXT_SWITCH=1 --gtest_repeat=5.