Skip to content

PHOENIX-7833 CDCBaseIT/CDCQueryIT keep manual edge installed after applyMutations#2450

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

PHOENIX-7833 CDCBaseIT/CDCQueryIT keep manual edge installed after applyMutations#2450
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-7833

Conversation

@apurtell
Copy link
Copy Markdown
Contributor

@apurtell apurtell commented May 2, 2026

CDCBaseIT.applyMutations installs a ManualEnvironmentEdge so each addChange pins EnvironmentEdgeManager.currentTimeMillis() to the row's changeTS, then calls committer.reset() whose default implementation is EnvironmentEdgeManager.reset(), reverting currentTimeMillis() to the wall clock. The rest of the CDC test body easily takes longer than CDCQueryIT.MAX_LOOKBACK_AGE = 10s, so any SCN-bounded read whose smallest SCN is the earliest changeTS trips QueryCompiler.verifySCN with ERROR 538 "Cannot use SCN to look further back in the past beyond the configured max lookback age". The IndexTool mapper shares the same EnvironmentEdgeManager static state in the in-process mini-cluster and PhoenixServerBuildIndexInputFormat hits the same ERROR 538 while compiling its SCN-bounded plan. The fix stops calling committer.reset() at the end of applyMutations, instead pinning injectEdge the highest changeTS seen across all batches so subsequent SCN-bounded reads of the just-applied mutations stay inside the max-lookback window, and adds a CDCQueryIT.afterTest() that calls EnvironmentEdgeManager.reset() to preserve per-test isolation.

Copy link
Copy Markdown
Contributor

@haridsv haridsv left a comment

Choose a reason for hiding this comment

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

Applied this along with #2451 and #2475 on my local workspace and ran for up to 50 iterations in a loop and didn't encounter any failure.

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