Skip to content

[Feature]: Assign instance serial numbers by availability rather than increment #10927

Closed

Description

@mnencia

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?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added this to the 1.30.0 milestone on Jun 16, 2026
  2. self-assigned this
    on Jun 16, 2026
  3. added a commit that references this issue on Jun 18, 2026
    2400f0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions