-
Notifications
You must be signed in to change notification settings - Fork 816
disallow instance with older timestamp to update instance with newer … #5480
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
Conversation
…timestamp Signed-off-by: Wen Xu <[email protected]>
Signed-off-by: Wen Xu <[email protected]>
… again Signed-off-by: Wen Xu <[email protected]>
Signed-off-by: Wen Xu <[email protected]>
pkg/ring/model.go
Outdated
if !tokensEqual(ing.Tokens, oing.Tokens) { | ||
tokensChanged = true | ||
} |
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.
We need to consider now that the tokens might not change if the timestamp is in the past. We should mark as tokensChanged only if we add the instance to toUpdate
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.
right, I agree. That will save us some resolveconflict executions. I'll make the change.
Signed-off-by: Wen Xu <[email protected]>
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
cortexproject#5480) * disallow instance with older timestamp to update instance with newer timestamp Signed-off-by: Wen Xu <[email protected]> * add statement in changelog Signed-off-by: Wen Xu <[email protected]> * just update after resolve conflict in the token, no need to do checks again Signed-off-by: Wen Xu <[email protected]> * fix lint Signed-off-by: Wen Xu <[email protected]> * only try to resolve conflict tokens when there is update Signed-off-by: Wen Xu <[email protected]> --------- Signed-off-by: Wen Xu <[email protected]>
What this PR does:
Background:
When we tried to switch from memberlist as primary and DDB as secondary KVStore, to DDB as primary and memberlist as secondary KV Store. We had encountered two issues.
We figured out, it was because
Now two things can happen, if the revert is before the next heartbeat of pod-1, pod-1 will be waiting for the instance to be in JOINING state forever, in this case, the pod get stuck in Leaving
If the revert happens after the next heartbeat of pod-1, when store-gateway finished its initial sync, it will set its state to ACTIVE. In this case, from Leaving to Active. IP will stay reverted in DDB.
To fix this issue, we check the timestamp during the update process, if the timestamp of the instance we tried to update is smaller than current timestamp of the instance, we skip the update. This will fix the issue.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]