Repository navigation
Conversation
The test sets the SCN one second before the clock read that follows its sleep. TTL masking is evaluated at the SCN. A row expires only when its timestamp is older than the SCN minus the TTL. The old sleep of TTL plus one second therefore gives no margin. The test fails when the commit, the sleep and the clock read all fall in the same milliseconds. Wall-clock slew during the sleep can also cause the failure. Sleep two seconds longer than the TTL. The rows then expire at the SCN with one second of margin. The test still queries at a past SCN. Related: PHOENIX-6888 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the test-only TTL timing-margin adjustment.
No open issues 🎉
What changed in this PR
Reduces intermittent failures in SCNIT.testSCNWithTTL by allowing expired rows a one-second timing margin at the historical SCN. No production code changes.
Changes:
- Increases the sleep from TTL + 1 second to TTL + 2 seconds.
- Updates the comment to explain the SCN offset and timing margin.
| File | Description |
|---|---|
| phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java | Adds timing margin to the TTL test and explains it. |
Review effort: Balanced
Contributor
Author
|
Precommit note: the failures in this run are not related to this change. Each one is a known problem on master.
(Claude Code) |
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.
The SCN test with TTL fails now and then because it returns a row that should have expired. Since PHOENIX-6888, the server masks expired rows at the SCN, not at the server clock. The test sleeps one second longer than the TTL. Then it sets the SCN one second in the past. That offset uses up the extra second, so the test has no timing margin. A small clock difference makes it fail.
This change is test-only. The test now sleeps two seconds longer than the TTL, so the rows expire at the SCN with one second of margin.
🤖 Generated with Claude Code