Skip to content

docs: clarify AvailableNodeIndexes are not contiguous 0..Size-1#281

Merged
syndbg merged 1 commit into
mainfrom
docs/available-node-indexes-non-contiguous
Jun 11, 2026
Merged

docs: clarify AvailableNodeIndexes are not contiguous 0..Size-1#281
syndbg merged 1 commit into
mainfrom
docs/available-node-indexes-non-contiguous

Conversation

@qdrant-cloud-bot

@qdrant-cloud-bot qdrant-cloud-bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents the long-standing (and surprising) behavior that QdrantClusterStatus.AvailableNodeIndexes is not the contiguous range 0..Size-1.

The operator allocates node indexes monotonically (always above the current maximum) and never re-compacts. So after repeated scale-up-then-scale-down rounds (e.g. on-demand-replication-restart or version upgrades), the indexes — and therefore the per-index pod names and PVCs (qdrant-storage-qdrant-<id>-<index>) — grow beyond Spec.Size. A size-N cluster can end up with ordinals like {6,7}, which looks like a leak but is not.

This PR clarifies that:

  • The growth is expected, not a leak. AvailableNodeIndexes is the source of truth and is iterated everywhere instead of assuming 0..Size-1.
  • Indexes are reserved-not-reused on purpose: reusing the lowest free index is unsafe while residue from a prior occupant can still exist — async PVC/PV reclaim (an index leaving DeleteInProgessNodeIndexes does not mean its PVC is gone) and lingering consensus peers mapped to the same internal URL.
  • Consumers must treat the slice as the source of truth and not assume contiguous ordinals.

Comment-only change to api/v1/qdrantcluster_types.go; CRD YAMLs regenerated via make manifests.

Test plan

  • make manifests regenerates cleanly; only the doc comment changed in both CRD YAMLs.
  • No behavioral change.

Node indexes are allocated monotonically by the operator and never re-compacted, so
after repeated scale-up-then-scale-down rounds (on-demand-replication-restart, version
upgrades) the indexes - and per-index pod names and PVCs - can grow beyond Spec.Size.
Document this as expected behavior and that indexes are reserved-not-reused to avoid
colliding with not-yet-reclaimed PVCs/PVs and lingering consensus peers. Consumers must
treat the slice as the source of truth and not assume contiguous ordinals.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qdrant-cloud-bot qdrant-cloud-bot requested a review from a team as a code owner June 11, 2026 08:03
@syndbg syndbg merged commit d1e0f63 into main Jun 11, 2026
6 checks passed
@syndbg syndbg deleted the docs/available-node-indexes-non-contiguous branch June 11, 2026 20:47
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.

2 participants