Skip to content

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

Merged
palashc merged 1 commit into
apache:masterfrom
apurtell:PHOENIX-7833
Jul 17, 2026
Merged

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

Conversation

@apurtell

@apurtell apurtell commented May 2, 2026

Copy link
Copy Markdown
Contributor

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.

@haridsv haridsv left a comment

Copy link
Copy Markdown
Contributor

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.

@palashc

palashc commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@palashc
palashc merged commit e317e29 into apache:master Jul 17, 2026
virajjasani pushed a commit that referenced this pull request Jul 17, 2026
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.

3 participants