bitflicker64 commented on code in PR #3132:
URL: https://github.com/apache/hugegraph/pull/3132#discussion_r3915704351


##########
helm/hugegraph/templates/store-statefulset.yaml:
##########
@@ -0,0 +1,193 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: {{ include "hugegraph.store.name" . }}
+  labels:
+    {{- include "hugegraph.labels" . | nindent 4 }}
+    app.kubernetes.io/component: store
+spec:
+  serviceName: {{ include "hugegraph.store.name" . }}
+  replicas: {{ .Values.store.replicas }}
+  podManagementPolicy: Parallel
+  selector:
+    matchLabels:
+      {{- include "hugegraph.selectorLabels" . | nindent 6 }}
+      app.kubernetes.io/component: store
+  template:
+    metadata:
+      labels:
+        {{- include "hugegraph.selectorLabels" . | nindent 8 }}
+        app.kubernetes.io/component: store
+        {{- with .Values.store.podLabels }}{{ toYaml . | nindent 8 }}{{- end }}
+      {{- with .Values.store.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+    spec:
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      automountServiceAccountToken: {{ get (get .Values.store "serviceAccount" 
| default dict) "automountServiceAccountToken" | default false }}
+      serviceAccountName: {{ include "hugegraph.serviceAccountName" (dict 
"component" .Values.store "name" (include "hugegraph.store.name" .) ) }}
+      {{- with .Values.store.terminationGracePeriodSeconds }}
+      terminationGracePeriodSeconds: {{ . }}
+      {{- end }}
+      {{- with .Values.store.priorityClassName }}
+      priorityClassName: {{ . | quote }}
+      {{- end }}
+      {{- with .Values.store.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.store.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.store.topologySpreadConstraints }}
+      topologySpreadConstraints:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.store.podSecurityContext }}
+      securityContext:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- if .Values.store.affinity }}
+      affinity:
+        {{- toYaml .Values.store.affinity | nindent 8 }}
+      {{- else }}
+      {{- with include "hugegraph.antiAffinity" (dict "mode" 
.Values.store.antiAffinity "component" "store" "labels" (include 
"hugegraph.selectorLabels" . | fromYaml)) }}{{ . | trim | nindent 6 }}{{- end }}
+      {{- end }}
+      initContainers:
+        - name: wait-for-pd
+          image: {{ .Values.store.waitImage | quote }}
+          {{- with .Values.store.securityContext }}
+          securityContext:
+            {{- toYaml . | nindent 12 }}
+          {{- end }}
+          command:
+            - sh
+            - -c
+            - |
+              set -eu
+              REQUIRED={{ include "hugegraph.pd.quorum" . }}
+              HEALTH_PEERS=$(echo "{{ include "hugegraph.pd.restPeersList" . 
}}" | tr ',' ' ')
+              TIMEOUT={{ .Values.store.waitTimeoutSeconds | default 900 }}
+              DEADLINE=$(( $(date +%s) + TIMEOUT ))
+              echo "Waiting for PD quorum (${REQUIRED}) among: ${HEALTH_PEERS}"
+              until [ "$(
+                ok=0
+                for peer in ${HEALTH_PEERS}; do
+                  if curl -fsS "http://${peer}/v1/health"; >/dev/null 2>&1; then

Review Comment:
   Measured on 2026-09-02 rather than read from source: with 2 of 3 PDs 
deleted, the survivor logged `Raft lost leader` within a second and still 
answered `/v1/health` 200 on 26 of 26 samples over 166s. So this gate counts 
listeners, not quorum members, and the same holds for the six PD and Store 
probes. Filed as #3183; the fix is #3185 (`/v1/ready`, 503 without a leader, 
targeting 1.8.0).
   
   On this branch since 7d9d084e and 535bc8b1: `store.waitPath` and 
`pd.readinessPath` default to `/v1/health`, each with a TODO to flip to 
`/v1/ready` in the same commit as the 1.8.0 pin; README Limitations documents 
the gap, and the wait is no longer described as a quorum wait. Proposing to 
resolve on that basis, with the switch tied to the pin.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to