fix: preserve causality for future HLC updates - #295
Merged
popduke merged 1 commit intoSep 28, 2026
Merged
Conversation
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
Contributor
|
Verified independently — the fix matches the reference receive rule (Kulkarni et al.), and the added regression test is the exact repro from #285. Since the PR notes the test could not be run locally (JDK/Lombok mismatch): we ran it against the compiled base-hlc classes (OpenJDK 17, same code) during the investigation behind #285 — and with this one-line change the assertion updated > observed passes (returns c = otherC + 1 = 6). One note for whoever merges: the existing HLCTest.update() keeps feeding the clock its own get() output (l == l_m), which is why this branch was never covered before — worth keeping the new test pinned to a future l_m (as it is here) rather than a self-observed timestamp. |
popduke
approved these changes
Sep 28, 2026
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
Fix the HLC receive-event branch so an observed timestamp that is ahead of the local clock produces a timestamp greater than the observed value.
Changes
Testing
git diff --cached --check— passedmvn -pl base-hlc -Dtest=HLCTest -DskipITs -Dcheckstyle.skip -Drat.skip -Dspotless.skip=true test— blocked by the available OpenJDK 27/Lombok compiler incompatibility (NoSuchFieldError); the repository targets Java 17 and no Java 17 runtime is installedFixes #285