Skip to content

PHOENIX-8107 SCNIT.testSCNWithTTL has no timing margin - #2739

Open
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8107
Open

apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8107

Conversation

@apurtell

@apurtell apurtell commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

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

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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

@apurtell

apurtell commented Dec 4, 2026

Copy link
Copy Markdown
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants