-
Notifications
You must be signed in to change notification settings - Fork 801
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
update ring with new ip address when instance is lost, rejoins, but heartbeat is disabled #6271
base: master
Are you sure you want to change the base?
Conversation
…eartbeat is disabled Signed-off-by: Charlie Le <[email protected]>
``` pkg/ring/lifecycler_test.go:728:2: ineffectual assignment to l2 (ineffassign) l2 = startIngesterAndWaitActive("ing2", "0.0.0.0") ^ ``` Signed-off-by: Charlie Le <[email protected]>
Signed-off-by: Charlie Le <[email protected]>
@CharlieTLe Is there a specific use case or component you are looking at for this feature? |
Yeah, it's to handle the case where an ingester changes its IP address but doesn't go through the typical lifecycle of leaving the ring while doing so. Then there's a discrepancy between the ring description and the actual description of the ingester. This specific issue isn't about reclaiming the tokens. Here's what can happen:
A symptom of the problem would be on the distributor logging the error that it is unable to reach the ingester because it's using the ingester's old address: {
"addr": "1.1.1.1:9095",
"caller": "pool.go:184",
"level": "warn",
"msg": "removing ingester failing healthcheck",
"reason": "rpc error: code = DeadlineExceeded desc = context deadline exceeded"
} |
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.
This make sense to me. Just a small comment but overall it make sense.
pkg/ring/lifecycler.go
Outdated
@@ -696,6 +696,13 @@ func (i *Lifecycler) initRing(ctx context.Context) error { | |||
return ringDesc, true, nil | |||
} | |||
|
|||
if i.cfg.HeartbeatPeriod == 0 && i.Addr != instanceDesc.Addr { | |||
// Update the address if it has changed | |||
instanceDesc.Addr = i.Addr |
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 think we can have this line before line 692 and lets the existing deep equal check take care if the Ip changed?
Setting the instanceDesc.Addr = i.Addr
should be a noop in case the IP did not change, if it changed, the check on https://github.com/cortexproject/cortex/pull/6271/files#diff-4d46760513b4f0a55e4cebb89e6a055859204f00ca50220cd42b5191b018b152R692 should take care of updating the ring.
applying feedback from alanprot Signed-off-by: Charlie Le <[email protected]>
…-new-ip-addr Signed-off-by: Charlie Le <[email protected]>
What this PR does:
Updates the ring with new ip address when instance is lost, rejoins, but heartbeat is disabled.
An instance can become lost, for example, when it does not announce that it is leaving the ring before exiting. When this happens and a new instance is created with a new ip address but the same name, the instance will rejoin the ring and reclaim the tokens it once had. However, it will not update the ring with the new ip address it can be located at. This can cause problems for services that use the ring to find where it can reach a member of the ring.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]