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


##########
helm/hugegraph/tests/bootstrap_custom_legacy_test.yaml:
##########
@@ -0,0 +1,116 @@
+#
+# 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.
+#
+
+suite: Experimental bootstrap rejects customized legacy endpoints
+templates:
+- pd-statefulset.yaml
+- store-statefulset.yaml
+- server-deployment.yaml
+- bootstrap-configmap.yaml
+set:
+  fullnameOverride: cluster
+  bootstrap.enabled: true
+  pd.auth.existingSecret: fixture-pd
+  server.auth.admin.existingSecret: fixture-admin
+  server.auth.token.existingSecret: fixture-token
+  pd.replicas: 3
+  store.replicas: 4
+  pd.pdb.minAvailable: 2
+  store.pdb.minAvailable: 3
+release:
+  upgrade: true
+kubernetesProvider:
+  scheme:
+    v1/ConfigMap:
+      gvr:
+        version: v1
+        resource: configmaps
+      namespaced: true
+    apps/v1/StatefulSet:
+      gvr:
+        group: apps
+        version: v1
+        resource: statefulsets
+      namespaced: true
+  objects:
+  - apiVersion: apps/v1
+    kind: StatefulSet
+    metadata:
+      name: cluster-pd
+      namespace: NAMESPACE
+      labels: &id001
+        app.kubernetes.io/name: hugegraph
+        app.kubernetes.io/instance: RELEASE-NAME
+        app.kubernetes.io/component: pd
+    spec:
+      replicas: '3'
+      volumeClaimTemplates:
+      - metadata:
+          name: pd-data
+      selector:
+        matchLabels: *id001
+      template:
+        spec:
+          containers:
+          - name: pd
+            ports:
+            - name: grpc
+              containerPort: '8686'
+            - name: rest
+              containerPort: '8620'
+            - name: raft
+              containerPort: '8610'
+            env:
+            - name: HG_PD_RAFT_PEERS_LIST
+              value: 
cluster-pd-0.cluster-pd.NAMESPACE.svc:8610,cluster-pd-1.cluster-pd.NAMESPACE.svc:8610,cluster-pd-2.cluster-pd.NAMESPACE.svc:8610
+            - name: HG_PD_INITIAL_STORE_LIST
+              value: custom-store:8500
+            - name: HG_PD_INITIAL_STORE_COUNT
+              value: '3'
+  - apiVersion: apps/v1
+    kind: StatefulSet
+    metadata:
+      name: cluster-store
+      namespace: NAMESPACE
+      labels: &id002
+        app.kubernetes.io/name: hugegraph
+        app.kubernetes.io/instance: RELEASE-NAME
+        app.kubernetes.io/component: store
+    spec:
+      replicas: '4'
+      volumeClaimTemplates:
+      - metadata:
+          name: store-data
+      selector:
+        matchLabels: *id002
+      template:
+        spec:
+          containers:
+          - name: store
+            ports:
+            - name: grpc
+              containerPort: '8500'
+            - name: rest
+              containerPort: '8520'
+            - name: raft
+              containerPort: '8510'
+tests:
+- it: requires review instead of rewriting custom Store endpoints
+  template: store-statefulset.yaml
+  asserts:
+  - failedTemplate:
+      errorPattern: bootstrap import only supports the chart

Review Comment:
   Important: this pattern never matches: `96ef3e2` renamed the message to 
`bootstrap only supports the chart's ...`, and the one-entry 
`custom-store:8500` list with count `3` fails first on `initialStoreCount 
cannot exceed bootstrap.storeReplicas`. Match the renamed message and give the 
fixture a custom list with at least three entries.



##########
helm/hugegraph/tests/bootstrap_legacy_test.yaml:
##########
@@ -0,0 +1,170 @@
+#
+# 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.
+#
+
+suite: Experimental bootstrap bootstrap_legacy_test.yaml
+templates:
+- pd-statefulset.yaml
+- store-statefulset.yaml
+- server-deployment.yaml
+- bootstrap-configmap.yaml
+set:
+  fullnameOverride: cluster
+  bootstrap.enabled: true
+  pd.auth.existingSecret: fixture-pd
+  server.auth.admin.existingSecret: fixture-admin
+  server.auth.token.existingSecret: fixture-token
+  pd.replicas: 3
+  store.replicas: 4
+  pd.pdb.minAvailable: 2
+  store.pdb.minAvailable: 3
+release:
+  upgrade: true
+kubernetesProvider:
+  scheme:
+    v1/ConfigMap:
+      gvr:
+        version: v1
+        resource: configmaps
+      namespaced: true
+    apps/v1/StatefulSet:
+      gvr:
+        group: apps
+        version: v1
+        resource: statefulsets
+      namespaced: true
+  objects:
+  - apiVersion: apps/v1
+    kind: StatefulSet
+    metadata:
+      name: cluster-pd
+      namespace: NAMESPACE
+      labels: &id001
+        app.kubernetes.io/name: hugegraph
+        app.kubernetes.io/instance: RELEASE-NAME
+        app.kubernetes.io/component: pd
+    spec:
+      replicas: '3'
+      volumeClaimTemplates:
+      - metadata:
+          name: pd-data
+      selector:
+        matchLabels: *id001
+      template:
+        spec:
+          containers:
+          - name: pd
+            ports:
+            - name: grpc
+              containerPort: '8686'
+            - name: rest
+              containerPort: '8620'
+            - name: raft
+              containerPort: '8610'
+            env:
+            - name: HG_PD_RAFT_PEERS_LIST
+              value: 
cluster-pd-0.cluster-pd.NAMESPACE.svc:8610,cluster-pd-1.cluster-pd.NAMESPACE.svc:8610,cluster-pd-2.cluster-pd.NAMESPACE.svc:8610
+            - name: HG_PD_INITIAL_STORE_LIST
+              value: 
cluster-store-0.cluster-store.NAMESPACE.svc:8500,cluster-store-1.cluster-store.NAMESPACE.svc:8500,cluster-store-2.cluster-store.NAMESPACE.svc:8500,cluster-store-3.cluster-store.NAMESPACE.svc:8500
+            - name: HG_PD_INITIAL_STORE_COUNT
+              value: '3'
+  - apiVersion: apps/v1
+    kind: StatefulSet
+    metadata:
+      name: cluster-store
+      namespace: NAMESPACE
+      labels: &id002
+        app.kubernetes.io/name: hugegraph
+        app.kubernetes.io/instance: RELEASE-NAME
+        app.kubernetes.io/component: store
+    spec:
+      replicas: '4'
+      volumeClaimTemplates:
+      - metadata:
+          name: store-data
+      selector:
+        matchLabels: *id002
+      template:
+        spec:
+          containers:
+          - name: store

Review Comment:
   Important: this live Store fixture has no `HG_STORE_PD_ADDRESS` env, so the 
consumer guard added in `0519f2b` fails every test in this suite with 
`bootstrap import requires the existing store template to expose 
HG_STORE_PD_ADDRESS as a literal value`. Add `HG_STORE_PD_ADDRESS` with the 
three original PD gRPC seeds to this container's `env`.



##########
helm/hugegraph/templates/store-statefulset.yaml:
##########
@@ -101,7 +101,7 @@ spec:
             - -c
             - |
               set -eu
-              REQUIRED={{ include "hugegraph.pd.quorum" . }}
+              REQUIRED={{ include "hugegraph.pd.bootstrapQuorum" . }}

Review Comment:
   Important: after a controlled PD shrink below the recorded majority, such as 
`bootstrap.pdReplicas=3` with `pd.replicas=1`, this renders `REQUIRED=2` 
against seeds where only `pd-0` exists, so every restarted Store times out in 
the wait init container. Fail the render when `bootstrap.enabled` and 
`pd.replicas` is below `hugegraph.pd.bootstrapQuorum`, or document that this 
shrink is unsupported.



-- 
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