Add circuit breaking mechanisms for offset auto-reset backfill#18501
Open
rseetham wants to merge 1 commit into
Open
Add circuit breaking mechanisms for offset auto-reset backfill#18501rseetham wants to merge 1 commit into
rseetham wants to merge 1 commit into
Conversation
Introduces four independent circuit breakers to prevent unbounded backfill triggering when a cluster is overwhelmed or restarts after prolonged downtime: 1. Pause flag per topic (`realtime.segment.offsetAutoReset.pause`): operator-set boolean in stream config; checked in computeStartOffset() before any backfill decision is made. 2. Max segments guard (`realtime.segment.offsetAutoReset.maxSegmentsBeforeBackfillSkip`): skips backfill trigger if table's segment count >= configured limit, preventing znode exhaustion when ingestion is permanently elevated. 3. Max concurrent backfills per controller (`controller.realtime.offsetAutoReset.maxConcurrentBackfillsPerController`): caps the number of tables that can simultaneously backfill on a single controller instance, guarding against cluster-restart storms. 4. Per-partition in-flight collision threshold (`controller.realtime.offsetAutoReset.maxBackfillCollisionsBeforeAutoPause`, default 3): tracks consecutive backfill-trigger attempts on a partition that already has an active backfill. Below the threshold the new trigger is allowed; at or above the threshold the topic's pause flag is set automatically and a metric is emitted requiring operator intervention. New ControllerMeter entries are added for each skipped-backfill scenario to enable alerting on all circuit breaker activations. Fixes: apache#18314
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18501 +/- ##
============================================
- Coverage 63.68% 55.84% -7.85%
+ Complexity 1684 821 -863
============================================
Files 3266 2558 -708
Lines 199836 148304 -51532
Branches 31023 23951 -7072
============================================
- Hits 127272 82821 -44451
+ Misses 62424 58408 -4016
+ Partials 10140 7075 -3065
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Introduces four independent circuit breakers to prevent unbounded backfill triggering when a cluster is overwhelmed or restarts after prolonged downtime:
Pause flag per topic (
realtime.segment.offsetAutoReset.pause): operator-set boolean in stream config; checked in computeStartOffset() before any backfill decision is made.Max segments guard (
realtime.segment.offsetAutoReset.maxSegmentsBeforeBackfillSkip): skips backfill trigger if table's segment count >= configured limit, preventing znode exhaustion when ingestion is permanently elevated.Max concurrent backfills per controller (
controller.realtime.offsetAutoReset.maxConcurrentBackfillsPerController): caps the number of tables that can simultaneously backfill on a single controller instance, guarding against cluster-restart storms.Per-partition in-flight collision threshold (
controller.realtime.offsetAutoReset.maxBackfillCollisionsBeforeAutoPause, default 3): tracks consecutive backfill-trigger attempts on a partition that already has an active backfill. Below the threshold the new trigger is allowed; at or above the threshold the topic's pause flag is set automatically and a metric is emitted requiring operator intervention.New ControllerMeter entries are added for each skipped-backfill scenario to enable alerting on all circuit breaker activations.
Fixes: #18314
bugfix