Skip to content

Commit e359b7d

Browse files
docs: clarify AvailableNodeIndexes are not contiguous 0..Size-1
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>
1 parent f4aa756 commit e359b7d

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

api/v1/qdrantcluster_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,14 @@ type QdrantClusterStatus struct {
994994
AvailableNodes int `json:"availableNodes,omitempty"`
995995
// AvailableNodeIndexes specifies the indexes of the individual nodes in the cluster
996996
// The number of indexes should be equal with the AvailableNodes field.
997+
// NOTE: these indexes are NOT guaranteed to be the contiguous range 0..Size-1.
998+
// New indexes are allocated monotonically (always above the current maximum) and are
999+
// never re-compacted, so after repeated scale-up-then-scale-down rounds (e.g.
1000+
// on-demand-replication-restart or version upgrades) the indexes - and the per-index
1001+
// pod names and PVCs - can grow well beyond Spec.Size. This is expected behavior:
1002+
// indexes are reserved-not-reused to avoid colliding with not-yet-reclaimed PVCs/PVs
1003+
// and lingering consensus peers from a prior occupant of the same index. Consumers
1004+
// must treat this slice as the source of truth and must not assume contiguous ordinals.
9971005
// +optional
9981006
AvailableNodeIndexes []int `json:"availableNodeIndexes,omitempty"`
9991007
// DeleteInProgessNodeIndexes specifies the indexes of the nodes in the cluster which are in progress of deleting and required to be deleted.

charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,14 @@ spec:
34553455
description: |-
34563456
AvailableNodeIndexes specifies the indexes of the individual nodes in the cluster
34573457
The number of indexes should be equal with the AvailableNodes field.
3458+
NOTE: these indexes are NOT guaranteed to be the contiguous range 0..Size-1.
3459+
New indexes are allocated monotonically (always above the current maximum) and are
3460+
never re-compacted, so after repeated scale-up-then-scale-down rounds (e.g.
3461+
on-demand-replication-restart or version upgrades) the indexes - and the per-index
3462+
pod names and PVCs - can grow well beyond Spec.Size. This is expected behavior:
3463+
indexes are reserved-not-reused to avoid colliding with not-yet-reclaimed PVCs/PVs
3464+
and lingering consensus peers from a prior occupant of the same index. Consumers
3465+
must treat this slice as the source of truth and must not assume contiguous ordinals.
34583466
items:
34593467
type: integer
34603468
type: array

crds/qdrant.io_qdrantclusters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,6 +3454,14 @@ spec:
34543454
description: |-
34553455
AvailableNodeIndexes specifies the indexes of the individual nodes in the cluster
34563456
The number of indexes should be equal with the AvailableNodes field.
3457+
NOTE: these indexes are NOT guaranteed to be the contiguous range 0..Size-1.
3458+
New indexes are allocated monotonically (always above the current maximum) and are
3459+
never re-compacted, so after repeated scale-up-then-scale-down rounds (e.g.
3460+
on-demand-replication-restart or version upgrades) the indexes - and the per-index
3461+
pod names and PVCs - can grow well beyond Spec.Size. This is expected behavior:
3462+
indexes are reserved-not-reused to avoid colliding with not-yet-reclaimed PVCs/PVs
3463+
and lingering consensus peers from a prior occupant of the same index. Consumers
3464+
must treat this slice as the source of truth and must not assume contiguous ordinals.
34573465
items:
34583466
type: integer
34593467
type: array

0 commit comments

Comments
 (0)