PHOENIX-7986 : Replace IndexCDCConsumer's exponential idle backoff with a fixed poll interval - #2597
Open
palashc wants to merge 1 commit into
Open
PHOENIX-7986 : Replace IndexCDCConsumer's exponential idle backoff with a fixed poll interval#2597palashc wants to merge 1 commit into
palashc wants to merge 1 commit into
Conversation
…th a fixed poll interval
virajjasani
approved these changes
Aug 12, 2026
Contributor
Author
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.
What changes were proposed in this pull request?
When an eventually consistent index consumer polls and finds no new CDC events, it now sleeps a fixed interval instead of walking HBase's
RETRY_BACKOFFarray.phoenix.index.cdc.consumer.idle.poll.interval.ms, default4000, with per-consumer jitter so consumers don't poll in lock-step after a RegionServer restart.retryCountis reset on any non-throwing iteration, so it now counts only consecutive exceptions. Error paths and the data-visibility retry loop keep their exponential backoff.Why are the changes needed?
Idle backoff caps at a 200x multiplier — 40s at the default 200ms retry pause, reached after ~96s of inactivity. A write to a quiet region therefore waits up to
timestampBufferMs + 40s(~45s) before the consumer looks for it, versus ~5.6s measured on a region under steady write load.That backoff is borrowed from RPC retry logic meant to relieve a failing server. An empty poll indicates nothing is wrong, so the escalation buys nothing and costs a 7x worse tail on exactly the low-traffic tables where a single write is most likely to be noticed.
It also makes
cdcIndexUpdateLagunusable as an SLI: idle consumers emit a 5s → 45s sawtooth, so percentiles describe the backoff schedule rather than index freshness.Does this PR introduce any user-facing change?
Yes. Worst-case index visibility on an idle region drops from
timestampBufferMs + 40stotimestampBufferMs + ~4.8s. Steady-state latency under load is unchanged. Idle CDC query load rises from one poll per region per 40s to one per ~4s. The new config is optional and defaults to the behavior above.How was this patch tested?
IndexCDCConsumerLagITpasses unchanged.No new test was added.
sleepWithLagSamplingemits a sample everylagSampleIntervalMsregardless of total sleep length, so the existing count-based assertion is invariant to sleep duration and cannot observe this change either way. A meaningful assertion needs the lag value rather than the count —MetricHistogramexposes onlyadd()andgetCount(), and cold-start samples floored atnow - consumerStartTimewould have to be excluded first.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor