Skip to content

Make leader election idempotent #325

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

Closed
wants to merge 2 commits into from
Closed

Conversation

ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented May 13, 2025

setnx which we use during leader election is not safe to retry via Redis reconnect_attempts as the command could succeed on the Redis server but we run into a client read timeout. In this case, any subsequent setnx calls will return false and leader election will fail.

Instead we're now setting a uniq value for setup and compare it when we fail.

@ChrisBr ChrisBr force-pushed the cbruckmayer/make-setnx-atomic branch 2 times, most recently from 1b062eb to 693fc3d Compare May 14, 2025 10:07
@ChrisBr ChrisBr changed the title Increase timeout for setnx Make leader election idempotent May 14, 2025
@ChrisBr ChrisBr force-pushed the cbruckmayer/make-setnx-atomic branch 2 times, most recently from 03ee192 to bc51afd Compare May 14, 2025 10:25
@ChrisBr ChrisBr force-pushed the cbruckmayer/make-setnx-atomic branch from bc51afd to 4aaf178 Compare May 14, 2025 10:28
@ChrisBr ChrisBr force-pushed the cbruckmayer/make-setnx-atomic branch from 0463f1e to 7d956db Compare May 14, 2025 16:12
@ChrisBr ChrisBr force-pushed the cbruckmayer/make-setnx-atomic branch from 7d956db to 9038dc1 Compare May 14, 2025 16:26
@ChrisBr
Copy link
Contributor Author

ChrisBr commented May 15, 2025

Superseded by #327

@ChrisBr ChrisBr closed this May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants