-
Notifications
You must be signed in to change notification settings - Fork 820
Use most recent time to remove from ring #4501
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -210,7 +210,12 @@ func (d *Desc) mergeWithTime(mergeable memberlist.Mergeable, localCAS bool, now | |||||||||||||||
// We are deleting entry "now", and should not keep old timestamp, because there may already be pending | ||||||||||||||||
// message in the gossip network with newer timestamp (but still older than "now"). | ||||||||||||||||
// Such message would "resurrect" this deleted entry. | ||||||||||||||||
ting.Timestamp = now.Unix() | ||||||||||||||||
// If timestamp on the ring is in "the future" we need to use the timestamp of the ring | ||||||||||||||||
// otherwise the gossip message will be ignored by the peers. | ||||||||||||||||
// see https://github.com/cortexproject/cortex/blob/d3f46c53616dcdf5c670f3e3a4d371e44b10683e/pkg/ring/model.go#L192-L200 | ||||||||||||||||
if ting.Timestamp < now.Unix() { | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure this fixes your issue. We must update the timestamp, otherwise the change is not propagated via gossip, so I think that what you want is something more like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pracucci thanks for looking into this. We do add the LEFT change right after this line in the updates list. Line 221 in 5e7f104
which will go onto the changes returned Lines 236 to 241 in 5e7f104
Form what i can tell we don't depend on timestamp I think what we need to make sure is that the misconfigured ingester be shut down before forgetting it, which will make sure it does not rejoin the ring. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it's best to put a newer timestamp on newer data. |
||||||||||||||||
ting.Timestamp = now.Unix() | ||||||||||||||||
} | ||||||||||||||||
thisIngesterMap[name] = ting | ||||||||||||||||
|
||||||||||||||||
updated = append(updated, name) | ||||||||||||||||
|
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 entry should be moved to master / unreleased section now.