-
Notifications
You must be signed in to change notification settings - Fork 847
Creating feature flag for disabling replica set extension #7153
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
base: master
Are you sure you want to change the base?
Conversation
b488770 to
eac5a84
Compare
pkg/alertmanager/distributor.go
Outdated
| randN := rand.Intn(len(replicationSet.Instances)) | ||
| instances = replicationSet.Instances[randN : randN+1] | ||
| // For POST requests, add retry logic to PutSilence | ||
| if d.isUnaryWritePath(r.URL.Path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be just a || in the if condition? for example if req.GetMethod() == "GET" || req.GetMethod() == "DELETE" || d.isUnaryWritePath(r.URL.Path)?
| receivers = append(receivers, parsed...) | ||
| } | ||
|
|
||
| merged := mergeV2Receivers(receivers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be done as part of the for loop? I mean can we maintain a map and dedup as we go
e8e8590 to
2e1bdf7
Compare
| ) | ||
|
|
||
| // RingOp is the operation used for reading/writing to the alertmanagers. | ||
| // Original ring operations (with extension enabled for backward compatibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't call it Original. We are not deprecating this one and DisableReplicaSetExtension is false by default.
| // Original ring operations (with extension enabled for backward compatibility) | ||
| var RingOp = ring.NewOp([]ring.InstanceState{ring.ACTIVE}, func(s ring.InstanceState) bool { | ||
| // Only ACTIVE Alertmanager get requests. If instance is not ACTIVE, we need to find another Alertmanager. | ||
| // Original behavior: extend replica set if instance is not ACTIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all original behavior from this PR
38b63a6 to
74784e6
Compare
146915c to
3b363bf
Compare
…e and api improvements Signed-off-by: Brenden Wu <[email protected]>
3b363bf to
78ced0f
Compare
yeya24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
While using cortex, my team recently ran into an issue with the alert managers where a corrupt config was synced and extended across the entire alert manager ring. This led to our entire fleet being stuck in a crash loop back off and prompted a need to limit the blast radius of potential issues to the replication factor
What this PR does:
Which issue(s) this PR fixes:
#7200
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]