You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Assign instance serial numbers by availability rather than increment #10927
Is there an existing issue already for this feature request/idea?
I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
Pod and PVC names in a cluster use monotonically increasing serial numbers tracked in status.latestGeneratedNode. After instances are deleted and recreated (e.g. following a node drain or the cnpg.io/unrecoverableInstance annotation), pod names grow unboundedly and previously-used serials cannot be reclaimed. A cluster that has had instances replaced over time ends up with high serial numbers and no way to return to a stable naming scheme.
Describe the solution you'd like
Assign instance serials by scanning existing instance names and picking the lowest free slot. Pod and PVC names become stable across instance recreation: an instance recreated after a drain or after the cnpg.io/unrecoverableInstance annotation comes back with the same name it had before. Introduce an Initialized cluster condition as an explicit signal that the cluster has completed its first bootstrap, replacing the latestGeneratedNode != 0 heuristic.
Describe alternatives you've considered
Keeping the monotonic counter but adding a compaction step to reassign lower serials after scale-down. This was rejected as more complex and potentially disruptive to running clusters.
Additional context
No response
Backport?
No
Are you willing to actively contribute to this feature?
Activity
feat: assign instance serial numbers by availability rather than incr…