Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r314] Disable ingester push circuit breaker in read-only mode #9762

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* [ENHANCEMENT] Query-scheduler: Remove the experimental `query-scheduler.prioritize-query-components` flag. Request queues always prioritize query component dequeuing above tenant fairness. #9703
* [ENHANCEMENT] Ingester: Emit traces for block syncing, to join up block-upload traces. #9656
* [ENHANCEMENT] Querier: Enable the optional querying of additional storage queryables. #9712
* [ENHANCEMENT] Ingester: Disable the push circuit breaker when ingester is in read-only mode. #9760
* [BUGFIX] Fix issue where functions such as `rate()` over native histograms could return incorrect values if a float stale marker was present in the selected range. #9508
* [BUGFIX] Fix issue where negation of native histograms (eg. `-some_native_histogram_series`) did nothing. #9508
* [BUGFIX] Fix issue where `metric might not be a counter, name does not end in _total/_sum/_count/_bucket` annotation would be emitted even if `rate` or `increase` did not have enough samples to compute a result. #9508
Expand Down
5 changes: 0 additions & 5 deletions pkg/ingester/circuitbreaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ func newIngesterCircuitBreaker(pushCfg CircuitBreakerConfig, readCfg CircuitBrea
}
}

func (cb *ingesterCircuitBreaker) activate() {
cb.push.activate()
cb.read.activate()
}

// tryAcquirePushPermit tries to acquire a permit to use the push circuit breaker and returns whether a permit was acquired.
// If it was possible, tryAcquirePushPermit returns a function that should be called to release the acquired permit.
// If it was not possible, the causing error is returned.
Expand Down
4 changes: 4 additions & 0 deletions pkg/ingester/downscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func (i *Ingester) PrepareInstanceRingDownscaleHandler(w http.ResponseWriter, r
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
// Deactivate the push circuit breaker in read-only mode. Calling this repeatedly is fine.
i.circuitBreaker.push.deactivate()

case http.MethodDelete:
// Clear the read-only status.
Expand All @@ -57,6 +59,8 @@ func (i *Ingester) PrepareInstanceRingDownscaleHandler(w http.ResponseWriter, r
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
// Activate the push circuit breaker when exiting read-only mode. Calling this repeatedly is fine.
i.circuitBreaker.push.activate()
}

ro, rots := i.lifecycler.GetReadOnlyState()
Expand Down
6 changes: 5 additions & 1 deletion pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,11 @@ func (i *Ingester) starting(ctx context.Context) (err error) {
return errors.Wrap(err, "failed to start ingester subservices after ingester ring lifecycler")
}

i.circuitBreaker.activate()
i.circuitBreaker.read.activate()
if ro, _ := i.lifecycler.GetReadOnlyState(); !ro {
// If the ingester is not read-only, activate the push circuit breaker.
i.circuitBreaker.push.activate()
}
return nil
}

Expand Down
Loading