-
Notifications
You must be signed in to change notification settings - Fork 16.7k
[stable/redis-ha] Implement stable sentinel IDs by pregenerating them #11095
Conversation
114dcef
to
7685059
Compare
/assign @ssalaues We talked about this here before: |
@towolf: GitHub didn't allow me to assign the following users: ssalaues. Note that only helm members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ba0d09e
to
3e45a3f
Compare
@ssalaues: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@towolf Thanks for the PR! I tested it and works well! The only caveat is the "ghosts" that happen on upgrade from the previous version to this one. However the "ghost" sentinels don't seem to grow beyond this initial upgrade (with or without persistence) and are still able to reach majority. Also just an FYI for any future on lookers of this PR, a consecutive rolling upgrade seemed to clear out the "ghosts" from the configs. |
…alize sentinel ID Signed-off-by: Tobias Wolf <towolf@gmail.com>
Signed-off-by: Tobias Wolf <towolf@gmail.com>
Signed-off-by: Tobias Wolf <towolf@gmail.com>
Signed-off-by: Tobias Wolf <towolf@gmail.com>
214e752
to
9f24b29
Compare
@ssalaues done. |
Signed-off-by: Tobias Wolf <towolf@gmail.com>
b2c5fcc
to
5a4541e
Compare
/test |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ssalaues, towolf The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…helm#11095) * Fix ghost sentinels by pregenerating stable 40 character IDs to initialize sentinel ID Signed-off-by: Tobias Wolf <towolf@gmail.com> * Fix name of _helper template Signed-off-by: Tobias Wolf <towolf@gmail.com> * Fix whitespace trimming Signed-off-by: Tobias Wolf <towolf@gmail.com> * Bump version after previous PR bumped it Signed-off-by: Tobias Wolf <towolf@gmail.com> * Make init.sh shellcheck clean Signed-off-by: Tobias Wolf <towolf@gmail.com>
What this PR does / why we need it:
In the course of reworking the failover mechanisms in PR #10032, the proliferation of stale sentinel IDs was prevented by recovering the old ID from the old config file (from persistent storage) on startup.
However, the redis-ha chart can be used with volatile data and an emptyDir. The sentinel ID will be lost on termination and again randomly generated on startup.
This PR makes sentinel IDs stable by simple pre-generating them and storing the as ENV vars on the init container.
In this approach I take the unique label combination + StatefulSet pod index and take the SHA1 of that:
However, I could image that this would work just as well, not sure:
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]