Skip to content

Commit 0708a61

Browse files
authored
Make .spec.restartAllPodsConcurrently a pointer to boolean (#123)
It allows the operator to detect if the value is set by requester, and if not, apply the best restarting strategy, based on actual collection replication factor.
1 parent d918b5a commit 0708a61

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

api/v1/qdrantcluster_types.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ type QdrantClusterSpec struct {
118118
PodDisruptionBudget *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
119119
// RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).
120120
// If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods
121-
// need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.
122-
// This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart.
121+
// need to be restarted, like when RestartedAtAnnotationKey is added/updated or the Qdrant version needs to be upgraded.
122+
// This helps sharded but not replicated clusters to reduce downtime to a possible minimum during restart.
123+
// If unset, the operator is going to restart nodes concurrently if none of the collections if replicated.
123124
// +optional
124-
RestartAllPodsConcurrently bool `json:"restartAllPodsConcurrently,omitempty"`
125+
RestartAllPodsConcurrently *bool `json:"restartAllPodsConcurrently"`
125126
// If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.
126127
// The sleep will be added when a pod is restarted, it will not force any pod to restart.
127128
// This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way

api/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,9 @@ spec:
610610
description: |-
611611
RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).
612612
If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods
613-
need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.
614-
This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart.
613+
need to be restarted, like when RestartedAtAnnotationKey is added/updated or the Qdrant version needs to be upgraded.
614+
This helps sharded but not replicated clusters to reduce downtime to a possible minimum during restart.
615+
If unset, the operator is going to restart nodes concurrently if none of the collections if replicated.
615616
type: boolean
616617
security:
617618
description: Security specifies the security context for each Qdrant

crds/qdrant.io_qdrantclusters.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,9 @@ spec:
609609
description: |-
610610
RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).
611611
If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods
612-
need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.
613-
This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart.
612+
need to be restarted, like when RestartedAtAnnotationKey is added/updated or the Qdrant version needs to be upgraded.
613+
This helps sharded but not replicated clusters to reduce downtime to a possible minimum during restart.
614+
If unset, the operator is going to restart nodes concurrently if none of the collections if replicated.
614615
type: boolean
615616
security:
616617
description: Security specifies the security context for each Qdrant

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ _Appears in:_
731731
| `storageClassNames` _[StorageClassNames](#storageclassnames)_ | StorageClassNames specifies the storage class names for db and snapshots. | | |
732732
| `topologySpreadConstraints` _[TopologySpreadConstraint](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#topologyspreadconstraint-v1-core)_ | TopologySpreadConstraints specifies the topology spread constraints for the cluster. | | |
733733
| `podDisruptionBudget` _[PodDisruptionBudgetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#poddisruptionbudgetspec-v1-policy)_ | PodDisruptionBudget specifies the pod disruption budget for the cluster. | | |
734-
| `restartAllPodsConcurrently` _boolean_ | RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).<br />If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods<br />need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.<br />This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart. | | |
734+
| `restartAllPodsConcurrently` _boolean_ | RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).<br />If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods<br />need to be restarted, like when RestartedAtAnnotationKey is added/updated or the Qdrant version needs to be upgraded.<br />This helps sharded but not replicated clusters to reduce downtime to a possible minimum during restart.<br />If unset, the operator is going to restart nodes concurrently if none of the collections if replicated. | | |
735735
| `startupDelaySeconds` _integer_ | If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.<br />The sleep will be added when a pod is restarted, it will not force any pod to restart.<br />This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way<br />to inspect the attached storage. | | |
736736
| `rebalanceStrategy` _[RebalanceStrategy](#rebalancestrategy)_ | RebalanceStrategy specifies the strategy to use for automaticially rebalancing shards the cluster.<br />Cluster-manager needs to be enabled for this feature to work. | | |
737737

0 commit comments

Comments
 (0)