From 82cf6ac137158b677b7762828ec23812f0222a4b Mon Sep 17 00:00:00 2001 From: qindotguan Date: Mon, 14 Oct 2024 06:22:04 -0400 Subject: [PATCH 01/27] make sure all nodes are up for online upgrade --- pkg/controllers/vdb/upgrade.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/controllers/vdb/upgrade.go b/pkg/controllers/vdb/upgrade.go index f489cb94e..5a7009d34 100644 --- a/pkg/controllers/vdb/upgrade.go +++ b/pkg/controllers/vdb/upgrade.go @@ -845,8 +845,18 @@ func (i *UpgradeManager) routeClientTraffic(ctx context.Context, pfacts *PodFact func (i *UpgradeManager) logEventIfRequestedUpgradeIsDifferent(actualUpgrade vapi.UpgradePolicyType) { if !i.ContinuingUpgrade && i.Vdb.Spec.UpgradePolicy != actualUpgrade && i.Vdb.Spec.UpgradePolicy != vapi.AutoUpgrade { actualUpgradeAsText := strings.ToLower(string(actualUpgrade)) + i.Rec.Eventf(i.Vdb, corev1.EventTypeNormal, events.IncompatibleUpgradeRequested, "Requested upgrade is incompatible with the Vertica deployment. Falling back to %s upgrade.", actualUpgradeAsText) + + if i.Vdb.Spec.UpgradePolicy == "Online" { + i.Log.Info("Online upgrade prerequisites are not met. Please make sure: " + + "1. Vertica server version is 24.3.0-2 or higher. " + + "2. Cluster was deployed using `vclusterops`. " + + "3. A license file was applied. " + + "4. No sandbox defined. " + + "5. All nodes are in UP status") + } } } From 2c41466cfe99a9ef7d1a3989af059584a7366059 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 15 Oct 2024 09:36:45 -0400 Subject: [PATCH 02/27] add checkNodesUp into the online upgrade reconciler --- .../vdb/onlineupgrade_reconciler.go | 25 +++++++++++++++++++ pkg/controllers/vdb/upgrade.go | 7 +++--- pkg/events/event.go | 1 + 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 84256961e..4acf22360 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -165,6 +165,8 @@ func (r *OnlineUpgradeReconciler) Reconcile(ctx context.Context, _ *ctrl.Request // Functions to perform when the image changes. Order matters. funcs := []func(context.Context) (ctrl.Result, error){ + // Requeue if not all nodes are UP + r.checkUpNodes, // Initiate an upgrade by setting condition and event recording r.startUpgrade, r.logEventIfThisUpgradeWasNotChosen, @@ -290,6 +292,29 @@ func (r *OnlineUpgradeReconciler) loadUpgradeState(ctx context.Context) (ctrl.Re return ctrl.Result{}, nil } +// checkUpNodes will requeue the upgrade process if not all the main cluster nodes are up. +func (r *OnlineUpgradeReconciler) checkUpNodes(ctx context.Context) (ctrl.Result, error) { + // We skip this if we have already added the new subclusters + if vmeta.GetOnlineUpgradeStepInx(r.VDB.Annotations) > addSubclustersInx { + return ctrl.Result{}, nil + } + + mainPFacts := r.PFacts[vapi.MainCluster] + // All nodes in the main cluster must be up before running online upgrade + if mainPFacts.getUpNodeCount() != len(mainPFacts.Detail) { + r.VRec.Eventf(r.VDB, corev1.EventTypeWarning, events.NotAllNodesUp, + "Not all pods are up. Number of up nodes: %d. Number of nodes: %d", + mainPFacts.getUpNodeCount(), len(mainPFacts.Detail)) + return ctrl.Result{Requeue: true}, nil + } + + r.Log.Info("Get number of up nodes.", + "NumberOfUpNodes", mainPFacts.getUpNodeCount(), + "NumberOfNodes", len(mainPFacts.Detail)) + + return ctrl.Result{}, nil +} + // assignSubclustersToReplicaGroupA will go through all of the subclusters involved // in the upgrade and assign them to the first replica group. The assignment is // saved in the status.upgradeState.replicaGroups field. diff --git a/pkg/controllers/vdb/upgrade.go b/pkg/controllers/vdb/upgrade.go index 5a7009d34..9f74cc6db 100644 --- a/pkg/controllers/vdb/upgrade.go +++ b/pkg/controllers/vdb/upgrade.go @@ -850,12 +850,11 @@ func (i *UpgradeManager) logEventIfRequestedUpgradeIsDifferent(actualUpgrade vap "Requested upgrade is incompatible with the Vertica deployment. Falling back to %s upgrade.", actualUpgradeAsText) if i.Vdb.Spec.UpgradePolicy == "Online" { - i.Log.Info("Online upgrade prerequisites are not met. Please make sure: " + + i.Log.Info("Not all online upgrade prerequisites met. Please make sure: " + "1. Vertica server version is 24.3.0-2 or higher. " + "2. Cluster was deployed using `vclusterops`. " + - "3. A license file was applied. " + - "4. No sandbox defined. " + - "5. All nodes are in UP status") + "3. A license file was applied to allow double the DB nodes. " + + "4. No sandbox defined.") } } } diff --git a/pkg/events/event.go b/pkg/events/event.go index e7e90a6d1..2eed90795 100644 --- a/pkg/events/event.go +++ b/pkg/events/event.go @@ -22,6 +22,7 @@ const ( AddNodeSucceeded = "AddNodeSucceeded" AddNodeLicenseFail = "AddNodeLicenseFail" AddNodeFailed = "AddNodeFailed" + NotAllNodesUp = "NotAllNodesUp" CreateDBStart = "CreateDBStart" CreateDBSucceeded = "CreateDBSucceeded" CreateDBFailed = "CreateDBFailed" From a90a8c268ec4f4afab3651a99cf3374348d9dfb8 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 15 Oct 2024 09:37:59 -0400 Subject: [PATCH 03/27] online upgrade with package install and a pending pod --- .../02-assert.yaml | 22 ++++ .../02-rbac.yaml | 18 ++++ .../05-create-secrets.yaml | 19 ++++ .../10-assert.yaml | 21 ++++ .../10-verify-operator.yaml | 12 +++ .../15-assert.yaml | 45 ++++++++ .../15-setup-vdb.yaml | 17 +++ .../20-assert.yaml | 58 ++++++++++ .../20-wait-for-createdb.yaml | 1 + .../25-wait-for-steady-state.yaml | 17 +++ .../26-assert.yaml | 20 ++++ .../26-kill-pod.yaml | 18 ++++ .../26-set-pod-pending.yaml | 33 ++++++ .../27-initiate-upgrade.yaml | 17 +++ .../28-assert.yaml | 22 ++++ .../28-wait-for-requeue.yaml | 1 + .../30-assert.yaml | 20 ++++ .../30-wait-for-restart.yaml | 1 + .../31-assert.yaml | 59 +++++++++++ .../31-wait-for-scs-mimic.yaml | 1 + .../32-assert.yaml | 22 ++++ .../32-wait-sandbox-start.yaml | 1 + .../35-assert.yaml | 100 ++++++++++++++++++ .../35-wait-for-sandbox.yaml | 1 + .../36-verify-non-replicatable-queries.yaml | 26 +++++ .../37-assert.yaml | 23 ++++ .../37-create-data-in-main-cluster.yaml | 70 ++++++++++++ .../38-assert.yaml | 26 +++++ .../38-wait-for-replication-finish.yaml | 1 + .../39-assert.yaml | 23 ++++ .../39-verify-data-in-sandbox.yaml | 60 +++++++++++ .../40-assert.yaml | 63 +++++++++++ .../40-errors.yaml | 41 +++++++ ...wait-for-new-main-cluster-to-be-ready.yaml | 1 + .../45-assert.yaml | 23 ++++ .../45-verify-new-main-cluster.yaml | 62 +++++++++++ .../50-assert.yaml | 19 ++++ .../50-verify-new-main-cluster-access.yaml | 20 ++++ .../95-delete-cr.yaml | 18 ++++ .../95-errors.yaml | 24 +++++ .../96-assert.yaml | 19 ++++ .../96-cleanup-storage.yaml | 17 +++ .../96-errors.yaml | 15 +++ .../99-delete-ns.yaml | 17 +++ .../setup-vdb/base/kustomization.yaml | 15 +++ .../setup-vdb/base/setup-vdb.yaml | 52 +++++++++ .../base/kustomization.yaml | 15 +++ .../verify-new-main-cluster-connection.yaml | 66 ++++++++++++ 48 files changed, 1262 insertions(+) create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml new file mode 100644 index 000000000..0bd1a36d6 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml @@ -0,0 +1,22 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: integration-test-role +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: integration-test-rb diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml new file mode 100644 index 000000000..c6c5d01da --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml @@ -0,0 +1,18 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kubectl apply --namespace $NAMESPACE -f ../../manifests/rbac/base/rbac.yaml + ignoreFailure: true diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml new file mode 100644 index 000000000..ecced2c12 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml @@ -0,0 +1,19 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kustomize build ../../manifests/communal-creds/overlay | kubectl apply -f - --namespace $NAMESPACE + - script: kustomize build ../../manifests/priv-container-creds/overlay | kubectl apply -f - --namespace $NAMESPACE + - script: kustomize build ../../manifests/vertica-license/overlay | kubectl apply -f - --namespace $NAMESPACE diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml new file mode 100644 index 000000000..9faca75c9 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml @@ -0,0 +1,21 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + namespace: verticadb-operator + labels: + control-plane: verticadb-operator +status: + phase: Running diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml new file mode 100644 index 000000000..0cd372046 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml @@ -0,0 +1,12 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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. diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml new file mode 100644 index 000000000..c607e4663 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml @@ -0,0 +1,45 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1 +status: + currentReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2 +status: + currentReplicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1 +status: + currentReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2 +status: + currentReplicas: 1 +--- +apiVersion: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml new file mode 100644 index 000000000..c9ed69089 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml @@ -0,0 +1,17 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: bash -c "kustomize build setup-vdb/overlay | kubectl -n $NAMESPACE apply -f - " diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml new file mode 100644 index 000000000..e86364725 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml @@ -0,0 +1,58 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1 +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2 +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1 +status: + currentReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2 +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +status: + subclusters: + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml new file mode 100644 index 000000000..7cd771cbb --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml @@ -0,0 +1,17 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: bash -c "../../../scripts/wait-for-verticadb-steady-state.sh -n verticadb-operator -t 360 $NAMESPACE" diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml new file mode 100644 index 000000000..2969b4b26 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml @@ -0,0 +1,20 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-sec1 +status: + currentReplicas: 2 + readyReplicas: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml new file mode 100644 index 000000000..61434690c --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml @@ -0,0 +1,18 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: kubectl delete pod v-base-upgrade-sec1-0 v-base-upgrade-sec1-1 + namespaced: true diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml new file mode 100644 index 000000000..4d3afe966 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml @@ -0,0 +1,33 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +spec: + subclusters: + - name: sec1 + size: 2 + type: secondary + - name: sec2 + size: 1 + resources: + requests: + memory: 1Ti + type: secondary + - name: pri1 + size: 2 + - name: pri_2 + size: 1 + type: primary diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml new file mode 100644 index 000000000..2b0413793 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml @@ -0,0 +1,17 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: ../../../scripts/patch-image-in-vdb.sh -n $NAMESPACE v-base-upgrade diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml new file mode 100644 index 000000000..4e330d7e0 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml @@ -0,0 +1,22 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Event +reason: NotAllNodesUp +source: + component: verticadb-operator +involvedObject: + apiVersion: vertica.com/v1 + kind: VerticaDB + name: v-base-upgrade diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml new file mode 100644 index 000000000..732805267 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml @@ -0,0 +1,20 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-sec1 +status: + currentReplicas: 2 + readyReplicas: 2 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml new file mode 100644 index 000000000..8bcd1e149 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml new file mode 100644 index 000000000..0bfb92c7a --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml @@ -0,0 +1,59 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1-sb +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2-sb +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1-sb +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2-sb +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +status: + subclusters: + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml new file mode 100644 index 000000000..5ce597a8a --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml @@ -0,0 +1,22 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Event +reason: SandboxSubclusterStart +source: + component: verticadb-operator +involvedObject: + apiVersion: vertica.com/v1 + kind: VerticaDB + name: v-base-upgrade \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml new file mode 100644 index 000000000..e5e52ebcb --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml @@ -0,0 +1,100 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1-sb + annotations: + vertica.com/statefulset-name-override: "v-base-upgrade-pri1-sb" + labels: + vertica.com/sandbox: replica-group-b +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2-sb + annotations: + vertica.com/statefulset-name-override: "v-base-upgrade-pri-2-sb" + labels: + vertica.com/sandbox: replica-group-b +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1-sb + annotations: + vertica.com/statefulset-name-override: "v-base-upgrade-sec1-sb" + labels: + vertica.com/sandbox: replica-group-b +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2-sb + annotations: + vertica.com/statefulset-name-override: "v-base-upgrade-sec2-sb" + labels: + vertica.com/sandbox: replica-group-b +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: v-base-upgrade-replica-group-b +data: + sandboxName: replica-group-b + verticaDBName: v-base-upgrade +immutable: true +--- +apiVersion: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +spec: + subclusters: + - name: pri1-sb + type: sandboxprimary + size: 2 + - name: pri_2-sb + type: sandboxprimary + size: 1 + - name: sec1-sb + type: secondary + size: 2 + - name: sec2-sb + type: secondary + size: 1 +status: + sandboxes: + - name: replica-group-b + subclusters: + - pri1 + - pri_2 + - sec1 + - sec2 + - pri1-sb + - pri_2-sb + - sec1-sb + - sec2-sb diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml new file mode 100644 index 000000000..4f7f761ca --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml @@ -0,0 +1,26 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + val=$(kubectl exec -n $NAMESPACE v-base-upgrade-pri1-0 -c server -- vsql -tAc "alter database default set DataSSLMaxBufSize = 32768"); \ + if [ $val == 0 ]; then \ + exit 1; \ + fi + - script: | + val=$(kubectl exec -n $NAMESPACE v-base-upgrade-pri1-sb-0 -c server -- vsql -tAc "alter database default set DataSSLMaxBufSize = 32768"); \ + if [ $val == 1 ]; then \ + exit 1; \ + fi \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml new file mode 100644 index 000000000..356c509d4 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml @@ -0,0 +1,23 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + name: test-create-source-data +status: + containerStatuses: + - name: test + state: + terminated: + exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml new file mode 100644 index 000000000..17e063ed4 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml @@ -0,0 +1,70 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: ConfigMap +metadata: + name: script-create-source-data +data: + entrypoint.sh: |- + #!/bin/bash + set -o errexit + set -o xtrace + + POD_NAME=v-base-upgrade-pri1-0 + NODE_IP=$(kubectl get nodes -l kubernetes.io/hostname=devcluster-control-plane --no-headers -o custom-columns=":status.addresses[?(@.type == \"InternalIP\")].address") + NODEPORT=30003 + + kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \" + CREATE USER user1 IDENTIFIED BY '$vertica$'; + CREATE SCHEMA user1_schema; + GRANT ALL ON SCHEMA user1_schema TO user1; + \"" + + kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"INSERT INTO public.test_table VALUES (99); COMMIT;\"" + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"SELECT * FROM public.test_table ORDER BY val;\"") + echo "$result" | grep -Pzo "^99\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 99, got $result" + exit 1 + fi + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"SELECT COUNT(*) FROM tables WHERE table_name = 'test_table';\"") + echo "$result" | grep -Pzo "^1\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 1, got $result" + exit 1 + fi + +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-create-source-data + labels: + stern: include +spec: + restartPolicy: Never + containers: + - name: test + image: bitnami/kubectl:1.20.4 + command: ["/bin/entrypoint.sh"] + volumeMounts: + - name: entrypoint-volume + mountPath: /bin/entrypoint.sh + readOnly: true + subPath: entrypoint.sh + volumes: + - name: entrypoint-volume + configMap: + defaultMode: 0777 + name: script-create-source-data diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml new file mode 100644 index 000000000..65743cba3 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml @@ -0,0 +1,26 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Event +reason: ReplicationSucceeded +source: + component: verticadb-operator +involvedObject: + apiVersion: vertica.com/v1beta1 + kind: VerticaReplicator +--- +apiVersion: vertica.com/v1beta1 +kind: VerticaReplicator +status: + state: "Replication successful" diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml new file mode 100644 index 000000000..5ace234bf --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml @@ -0,0 +1,23 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + name: test-verify-data-in-sandbox +status: + containerStatuses: + - name: test + state: + terminated: + exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml new file mode 100644 index 000000000..e4d7c5567 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml @@ -0,0 +1,60 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: ConfigMap +metadata: + name: script-verify-data-in-sandbox +data: + entrypoint.sh: |- + #!/bin/bash + set -o errexit + set -o xtrace + + POD_NAME=v-base-upgrade-pri1-sb-0 + + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT * FROM public.test_table ORDER BY val;\"") + echo "$result" | grep -Pzo "^99\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 99, got $result" + exit 1 + fi + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM tables WHERE table_name = 'test_table';\"") + echo "$result" | grep -Pzo "^1\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 1, got $result" + exit 1 + fi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-verify-data-in-sandbox + labels: + stern: include +spec: + restartPolicy: Never + containers: + - name: test + image: bitnami/kubectl:1.20.4 + command: ["/bin/entrypoint.sh"] + volumeMounts: + - name: entrypoint-volume + mountPath: /bin/entrypoint.sh + readOnly: true + subPath: entrypoint.sh + volumes: + - name: entrypoint-volume + configMap: + defaultMode: 0777 + name: script-verify-data-in-sandbox diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml new file mode 100644 index 000000000..8eaa520eb --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml @@ -0,0 +1,63 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1-sb +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2-sb +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1-sb +status: + currentReplicas: 2 + readyReplicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2-sb +status: + currentReplicas: 1 + readyReplicas: 1 +--- +apiVersion: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +spec: + subclusters: + - name: pri1 + type: primary + size: 2 + - name: pri_2 + type: primary + size: 1 + - name: sec1 + type: secondary + size: 2 + - name: sec2 + type: secondary + size: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml new file mode 100644 index 000000000..e156e8d07 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml @@ -0,0 +1,41 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v-base-upgrade-pri1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-pri-2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: v-base-upgrade-sec2 +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: v-base-upgrade-replica-group-b +data: + sandboxName: replica-group-b + verticaDBName: v-base-upgrade +immutable: true diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml new file mode 100644 index 000000000..bf3726035 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml @@ -0,0 +1 @@ +# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml new file mode 100644 index 000000000..2ef3e1cfa --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml @@ -0,0 +1,23 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + name: test-verify-new-main-cluster +status: + containerStatuses: + - name: test + state: + terminated: + exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml new file mode 100644 index 000000000..bac5dc29d --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml @@ -0,0 +1,62 @@ +# Intentionally empty to give this step a name in kuttl# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: ConfigMap +metadata: + name: script-verify-new-main-cluster +data: + entrypoint.sh: |- + #!/bin/bash + set -o errexit + set -o xtrace + + POD_NAMES=("v-base-upgrade-pri1-sb-0" "v-base-upgrade-pri-2-sb-0" "v-base-upgrade-sec1-sb-0") + + for POD_NAME in "${POD_NAMES[@]}"; do + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM nodes WHERE node_state = 'UP' and subcluster_name not like '%sb' and sandbox = '';\"") + echo "$result" | grep -Pzo "^6\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 6, got $result" + exit 1 + fi + result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM nodes;\"") + echo "$result" | grep -Pzo "^6\n$" > /dev/null + if [ $? -ne 0 ]; then + echo "Assertion failed: expected 6, got $result" + exit 1 + fi + done +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-verify-new-main-cluster + labels: + stern: include +spec: + restartPolicy: Never + containers: + - name: test + image: bitnami/kubectl:1.20.4 + command: ["/bin/entrypoint.sh"] + volumeMounts: + - name: entrypoint-volume + mountPath: /bin/entrypoint.sh + readOnly: true + subPath: entrypoint.sh + volumes: + - name: entrypoint-volume + configMap: + defaultMode: 0777 + name: script-verify-new-main-cluster diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml new file mode 100644 index 000000000..f973565a1 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml @@ -0,0 +1,19 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: batch/v1 +kind: Job +metadata: + name: test-verify-new-main-cluster-connection +status: + succeeded: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml new file mode 100644 index 000000000..436cbde2d --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml @@ -0,0 +1,20 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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. + +# Verifies access to the external service through port 5433. It does this +# by connecting using vsql + +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: bash -c "kustomize build verify-new-main-cluster-connection/overlay | kubectl -n $NAMESPACE apply -f - " \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml new file mode 100644 index 000000000..96d43c1de --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml @@ -0,0 +1,18 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +delete: + - apiVersion: vertica.com/v1 + kind: VerticaDB diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml new file mode 100644 index 000000000..0de5ac42e --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml @@ -0,0 +1,24 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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 +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/managed-by: verticadb-operator +--- +apiVersion: vertica.com/v1 +kind: VerticaDB diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml new file mode 100644 index 000000000..861c7dc8f --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml @@ -0,0 +1,19 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + name: clean-communal +status: + phase: Succeeded diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml new file mode 100644 index 000000000..dcc6306f3 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml @@ -0,0 +1,17 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: bash -c "kustomize build clean-communal/overlay | kubectl -n $NAMESPACE apply -f - " diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml new file mode 100644 index 000000000..671be36cf --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml @@ -0,0 +1,15 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: PersistentVolumeClaim diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml new file mode 100644 index 000000000..1674b3e8f --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml @@ -0,0 +1,17 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: kubectl delete ns $NAMESPACE diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml new file mode 100644 index 000000000..681396735 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml @@ -0,0 +1,15 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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. + +resources: + - setup-vdb.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml new file mode 100644 index 000000000..688b93b17 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml @@ -0,0 +1,52 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade + annotations: + vertica.com/include-uid-in-path: true + vertica.com/online-upgrade-preferred-sandbox: "replica-group-b" + vertica.com/online-upgrade-archive-before-replication: "arch_bef_rep" + vertica.com/save-restore-point-on-upgrade: true + vertica.com/online-upgrade-timeout: "60" +spec: + image: kustomize-vertica-image + dbName: repUP + initPolicy: Create + upgradePolicy: Online + communal: {} + local: + requestSize: 250Mi + sidecars: + - name: vlogger + image: kustomize-vlogger-image + # We pick a cluster size that is too big for the CE license. This relies on + # having a license, which will be added by kustomize. + subclusters: + - name: sec1 + size: 2 + type: secondary + - name: sec2 + size: 1 + type: secondary + - name: pri1 + size: 2 + - name: pri_2 + size: 1 + type: primary + certSecrets: [] + imagePullSecrets: [] + volumes: [] + volumeMounts: [] diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml new file mode 100644 index 000000000..f86e02527 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml @@ -0,0 +1,15 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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. + +resources: + - verify-new-main-cluster-connection.yaml \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml new file mode 100644 index 000000000..c78f4c156 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml @@ -0,0 +1,66 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: ConfigMap +metadata: + name: script-verify-new-main-cluster-connection +data: + verify.sh: |- + #!/bin/bash + set -o errexit + set -o xtrace + # Access to subclusters through primary service should route to the new main cluster. + CONNECTION_NODE=$(vsql -U dbadmin -h v-base-upgrade-pri1 -tAc "select node_name from current_session") + echo $CONNECTION_NODE + if [[ $CONNECTION_NODE == "v_repup_node0007" ]] || \ + [[ $CONNECTION_NODE == "v_repup_node0008" ]] || \ + [[ $CONNECTION_NODE == "v_repup_node0009" ]] + then + exit 0 + fi + # Access to subclusters through secondary service should route to the new main cluster. + CONNECTION_NODE=$(vsql -U dbadmin -h v-base-upgrade-sec1 -tAc "select node_name from current_session") + echo $CONNECTION_NODE + if [[ $CONNECTION_NODE == "v_repup_node0010" ]] || \ + [[ $CONNECTION_NODE == "v_repup_node0011" ]] || \ + [[ $CONNECTION_NODE == "v_repup_node0012" ]] + then + exit 0 + fi + exit 1 # Incorrect value +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: test-verify-new-main-cluster-connection + labels: + stern: include +spec: + template: + spec: + restartPolicy: OnFailure + containers: + - name: test + image: kustomize-vertica-image + command: ["/home/dbadmin/verify.sh"] + volumeMounts: + - name: test-script + mountPath: /home/dbadmin/verify.sh + readOnly: true + subPath: verify.sh + volumes: + - name: test-script + configMap: + defaultMode: 0777 + name: script-verify-new-main-cluster-connection \ No newline at end of file From 611183593010138bb0f5d9eca06791eeabf2df59 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 15 Oct 2024 14:41:57 -0400 Subject: [PATCH 04/27] pending pods donnot have currentReplicas --- .../26-assert.yaml | 6 +++--- .../26-kill-pod.yaml | 18 ------------------ .../30-assert.yaml | 6 +++--- 3 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml index 2969b4b26..db9dc4cc8 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml @@ -14,7 +14,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: v-base-upgrade-sec1 + name: v-base-upgrade-sec2 status: - currentReplicas: 2 - readyReplicas: 1 + availableReplicas: 0 + replicas: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml deleted file mode 100644 index 61434690c..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/26-kill-pod.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: kubectl delete pod v-base-upgrade-sec1-0 v-base-upgrade-sec1-1 - namespaced: true diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml index 732805267..18a1717c3 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml @@ -14,7 +14,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: v-base-upgrade-sec1 + name: v-base-upgrade-sec2 status: - currentReplicas: 2 - readyReplicas: 2 + currentReplicas: 1 + readyReplicas: 1 From a24e665f1fa2321ed6f1dc44021d2eefd027b959 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 15 Oct 2024 14:42:28 -0400 Subject: [PATCH 05/27] add step to let pod running --- .../29-set-pod-running.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml new file mode 100644 index 000000000..084266b38 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml @@ -0,0 +1,30 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: vertica.com/v1 +kind: VerticaDB +metadata: + name: v-base-upgrade +spec: + subclusters: + - name: sec1 + size: 2 + type: secondary + - name: sec2 + size: 1 + type: secondary + - name: pri1 + size: 2 + - name: pri_2 + size: 1 + type: primary From 03bd47dbf5f4f821fe7e8d6b9df6c4249ee7e1ff Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 16 Oct 2024 12:21:43 -0400 Subject: [PATCH 06/27] restart the main cluster if not all nodes are up --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 4acf22360..e00e82bf9 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -303,14 +303,15 @@ func (r *OnlineUpgradeReconciler) checkUpNodes(ctx context.Context) (ctrl.Result // All nodes in the main cluster must be up before running online upgrade if mainPFacts.getUpNodeCount() != len(mainPFacts.Detail) { r.VRec.Eventf(r.VDB, corev1.EventTypeWarning, events.NotAllNodesUp, - "Not all pods are up. Number of up nodes: %d. Number of nodes: %d", + "Not all nodes (%d/%d) are up, restarting the main cluster. Please also check the cluster configuration.", mainPFacts.getUpNodeCount(), len(mainPFacts.Detail)) - return ctrl.Result{Requeue: true}, nil - } - r.Log.Info("Get number of up nodes.", - "NumberOfUpNodes", mainPFacts.getUpNodeCount(), - "NumberOfNodes", len(mainPFacts.Detail)) + // try to restart the main cluster, requeuing online upgrade + res, err := r.restartMainCluster(ctx) + if verrors.IsReconcileAborted(res, err) { + return res, err + } + } return ctrl.Result{}, nil } From 521a5049d640fde8317663d13cd6f28fdd9945de Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 16 Oct 2024 12:23:16 -0400 Subject: [PATCH 07/27] add hint message if package installation failed --- pkg/vadmin/install_packages_at.go | 4 +++- pkg/vadmin/install_packages_vc.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/vadmin/install_packages_at.go b/pkg/vadmin/install_packages_at.go index dde473e62..5df935d0e 100644 --- a/pkg/vadmin/install_packages_at.go +++ b/pkg/vadmin/install_packages_at.go @@ -17,6 +17,7 @@ package vadmin import ( "context" + "errors" "regexp" "strings" @@ -34,7 +35,8 @@ func (a *Admintools) InstallPackages(ctx context.Context, opts ...installpackage status := genInstallPackageStatus(stdout) if err != nil && len(status.Packages) == 0 { - _, logErr := a.logFailure("install_package", events.InstallPackagesFailed, stdout, err) + pkgErr := errors.New(err.Error() + "This may due to lack of memory resources.") + _, logErr := a.logFailure("install_package", events.InstallPackagesFailed, stdout, pkgErr) a.Log.Error(err, "failed to finish package installation", "installPackageStatus", *status) return status, logErr } diff --git a/pkg/vadmin/install_packages_vc.go b/pkg/vadmin/install_packages_vc.go index 9aa903107..eee826820 100644 --- a/pkg/vadmin/install_packages_vc.go +++ b/pkg/vadmin/install_packages_vc.go @@ -17,6 +17,7 @@ package vadmin import ( "context" + "errors" vops "github.com/vertica/vcluster/vclusterops" "github.com/vertica/vertica-kubernetes/pkg/events" @@ -41,7 +42,8 @@ func (v *VClusterOps) InstallPackages(_ context.Context, opts ...installpackages status = &vops.InstallPackageStatus{} } if err != nil { - _, err = v.logFailure("VInstallPackages", events.InstallPackagesFailed, err) + pkgErr := errors.New(err.Error() + "This may due to lack of memory resources.") + _, err = v.logFailure("VInstallPackages", events.InstallPackagesFailed, pkgErr) v.Log.Error(err, "failed to finish package installation", "installPackageStatus", *status) return status, err } From 5e036bbf41d5affd6d448015312e7d1bade6909a Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 16 Oct 2024 14:38:54 -0400 Subject: [PATCH 08/27] update the event message --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index e00e82bf9..3da3da4f0 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -165,7 +165,7 @@ func (r *OnlineUpgradeReconciler) Reconcile(ctx context.Context, _ *ctrl.Request // Functions to perform when the image changes. Order matters. funcs := []func(context.Context) (ctrl.Result, error){ - // Requeue if not all nodes are UP + // Requeue if not all nodes are up r.checkUpNodes, // Initiate an upgrade by setting condition and event recording r.startUpgrade, @@ -303,7 +303,7 @@ func (r *OnlineUpgradeReconciler) checkUpNodes(ctx context.Context) (ctrl.Result // All nodes in the main cluster must be up before running online upgrade if mainPFacts.getUpNodeCount() != len(mainPFacts.Detail) { r.VRec.Eventf(r.VDB, corev1.EventTypeWarning, events.NotAllNodesUp, - "Not all nodes (%d/%d) are up, restarting the main cluster. Please also check the cluster configuration.", + "Not all nodes (%d/%d) are up, restarting the main cluster. Please check the cluster configuration if this issue continues.", mainPFacts.getUpNodeCount(), len(mainPFacts.Detail)) // try to restart the main cluster, requeuing online upgrade From f8b3273e82c03fc17868f4054374a128c05848a5 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 16 Oct 2024 14:40:03 -0400 Subject: [PATCH 09/27] remove the event checking of SandboxSubclusterStart --- .../32-assert.yaml | 22 ------------------- .../32-wait-sandbox-start.yaml | 1 - 2 files changed, 23 deletions(-) delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml deleted file mode 100644 index 5ce597a8a..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/32-assert.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Event -reason: SandboxSubclusterStart -source: - component: verticadb-operator -involvedObject: - apiVersion: vertica.com/v1 - kind: VerticaDB - name: v-base-upgrade \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml deleted file mode 100644 index bf3726035..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/32-wait-sandbox-start.yaml +++ /dev/null @@ -1 +0,0 @@ -# Intentionally empty to give this step a name in kuttl \ No newline at end of file From 9e39dc9a9a216ba1d9d3490542acc6535b5e7b0a Mon Sep 17 00:00:00 2001 From: qindotguan Date: Thu, 17 Oct 2024 07:26:28 -0400 Subject: [PATCH 10/27] update the expected sandbox and subcluster list --- .../online-upgrade-with-package-install/31-assert.yaml | 8 ++++++++ .../online-upgrade-with-package-install/35-assert.yaml | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml index 0bfb92c7a..420750eb4 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml @@ -57,3 +57,11 @@ status: upNodeCount: 2 - addedToDBCount: 1 upNodeCount: 1 + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 + - addedToDBCount: 2 + upNodeCount: 2 + - addedToDBCount: 1 + upNodeCount: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml index e5e52ebcb..6a1df9e04 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml @@ -74,6 +74,10 @@ metadata: name: v-base-upgrade spec: subclusters: + - name: pri1 + - name: pri_2 + - name: sec1 + - name: sec2 - name: pri1-sb type: sandboxprimary size: 2 @@ -90,10 +94,6 @@ status: sandboxes: - name: replica-group-b subclusters: - - pri1 - - pri_2 - - sec1 - - sec2 - pri1-sb - pri_2-sb - sec1-sb From 6a5957fe05700621b8df237ae14f6b07550061fb Mon Sep 17 00:00:00 2001 From: qindotguan Date: Fri, 18 Oct 2024 01:25:45 -0400 Subject: [PATCH 11/27] reorder the subcluster list in the test assert files --- .../online-upgrade-with-package-install/35-assert.yaml | 4 ++-- .../37-create-data-in-main-cluster.yaml | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml index 6a1df9e04..5cb718617 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml @@ -74,10 +74,10 @@ metadata: name: v-base-upgrade spec: subclusters: - - name: pri1 - - name: pri_2 - name: sec1 - name: sec2 + - name: pri1 + - name: pri_2 - name: pri1-sb type: sandboxprimary size: 2 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml index 17e063ed4..86abf1b0b 100644 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml +++ b/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml @@ -22,15 +22,8 @@ data: set -o xtrace POD_NAME=v-base-upgrade-pri1-0 - NODE_IP=$(kubectl get nodes -l kubernetes.io/hostname=devcluster-control-plane --no-headers -o custom-columns=":status.addresses[?(@.type == \"InternalIP\")].address") - NODEPORT=30003 - - kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \" - CREATE USER user1 IDENTIFIED BY '$vertica$'; - CREATE SCHEMA user1_schema; - GRANT ALL ON SCHEMA user1_schema TO user1; - \"" + kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"CREATE TABLE public.test_table (val INTEGER);\"" kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"INSERT INTO public.test_table VALUES (99); COMMIT;\"" result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"SELECT * FROM public.test_table ORDER BY val;\"") echo "$result" | grep -Pzo "^99\n$" > /dev/null From 4771f75d23609216954e47d4df125eddab7bc412 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Mon, 21 Oct 2024 14:47:36 -0400 Subject: [PATCH 12/27] requeue if found pods not running --- .../vdb/onlineupgrade_reconciler.go | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 3da3da4f0..5c7a712ea 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -165,8 +165,8 @@ func (r *OnlineUpgradeReconciler) Reconcile(ctx context.Context, _ *ctrl.Request // Functions to perform when the image changes. Order matters. funcs := []func(context.Context) (ctrl.Result, error){ - // Requeue if not all nodes are up - r.checkUpNodes, + // Requeue if not all nodes are running + r.requeuePodsNotRunning, // Initiate an upgrade by setting condition and event recording r.startUpgrade, r.logEventIfThisUpgradeWasNotChosen, @@ -292,25 +292,26 @@ func (r *OnlineUpgradeReconciler) loadUpgradeState(ctx context.Context) (ctrl.Re return ctrl.Result{}, nil } -// checkUpNodes will requeue the upgrade process if not all the main cluster nodes are up. -func (r *OnlineUpgradeReconciler) checkUpNodes(ctx context.Context) (ctrl.Result, error) { +// requeuePodsNotRunning will requeue the upgrade process if not all pods are running. +func (r *OnlineUpgradeReconciler) requeuePodsNotRunning(ctx context.Context) (ctrl.Result, error) { // We skip this if we have already added the new subclusters if vmeta.GetOnlineUpgradeStepInx(r.VDB.Annotations) > addSubclustersInx { return ctrl.Result{}, nil } + // For pods are pending due to lack of resources, we requeue restarting them and wait + // for user operation. mainPFacts := r.PFacts[vapi.MainCluster] - // All nodes in the main cluster must be up before running online upgrade - if mainPFacts.getUpNodeCount() != len(mainPFacts.Detail) { - r.VRec.Eventf(r.VDB, corev1.EventTypeWarning, events.NotAllNodesUp, - "Not all nodes (%d/%d) are up, restarting the main cluster. Please check the cluster configuration if this issue continues.", - mainPFacts.getUpNodeCount(), len(mainPFacts.Detail)) + found, _ := mainPFacts.anyPodsNotRunning() + if found { + r.Log.Info("Not all pods are running, requeuing.") + return ctrl.Result{Requeue: true}, nil + } - // try to restart the main cluster, requeuing online upgrade - res, err := r.restartMainCluster(ctx) - if verrors.IsReconcileAborted(res, err) { - return res, err - } + // to restart the main cluster if any down pods found + res, err := r.restartMainCluster(ctx) + if verrors.IsReconcileAborted(res, err) { + return res, err } return ctrl.Result{}, nil From 4efd7826aa358acc044f40c58e8df7273ca207b0 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Mon, 21 Oct 2024 14:50:19 -0400 Subject: [PATCH 13/27] use log but not event --- pkg/events/event.go | 1 - .../28-assert.yaml | 22 ------------------- .../28-wait-for-requeue.yaml | 1 - 3 files changed, 24 deletions(-) delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml diff --git a/pkg/events/event.go b/pkg/events/event.go index 2eed90795..e7e90a6d1 100644 --- a/pkg/events/event.go +++ b/pkg/events/event.go @@ -22,7 +22,6 @@ const ( AddNodeSucceeded = "AddNodeSucceeded" AddNodeLicenseFail = "AddNodeLicenseFail" AddNodeFailed = "AddNodeFailed" - NotAllNodesUp = "NotAllNodesUp" CreateDBStart = "CreateDBStart" CreateDBSucceeded = "CreateDBSucceeded" CreateDBFailed = "CreateDBFailed" diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml deleted file mode 100644 index 4e330d7e0..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/28-assert.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Event -reason: NotAllNodesUp -source: - component: verticadb-operator -involvedObject: - apiVersion: vertica.com/v1 - kind: VerticaDB - name: v-base-upgrade diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml deleted file mode 100644 index bf3726035..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/28-wait-for-requeue.yaml +++ /dev/null @@ -1 +0,0 @@ -# Intentionally empty to give this step a name in kuttl \ No newline at end of file From ba02231008d9cb5168fd2f29dbeb060f4cdd419a Mon Sep 17 00:00:00 2001 From: qindotguan Date: Mon, 21 Oct 2024 14:50:57 -0400 Subject: [PATCH 14/27] get pods not in running status --- pkg/controllers/vdb/podfacts.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/controllers/vdb/podfacts.go b/pkg/controllers/vdb/podfacts.go index 4b42a6837..5bc0d9732 100644 --- a/pkg/controllers/vdb/podfacts.go +++ b/pkg/controllers/vdb/podfacts.go @@ -1111,6 +1111,17 @@ func genPodNames(pods []*PodFact) string { return strings.Join(podNames, ", ") } +// anyPodsNotRunning returns true if any pod isn't running. It could be still pending scheduling due to +// lack of resources. It will return the name of the first pod that isn't running. +func (p *PodFacts) anyPodsNotRunning() (bool, types.NamespacedName) { + for _, v := range p.Detail { + if !v.isPodRunning { + return true, v.name + } + } + return false, types.NamespacedName{} +} + // anyInstalledPodsNotRunning returns true if any installed pod isn't running. It will // return the name of the first pod that isn't running. func (p *PodFacts) anyInstalledPodsNotRunning() (bool, types.NamespacedName) { From 1324be02dca68e8c7e5c5cff0e476c6958a8df8e Mon Sep 17 00:00:00 2001 From: qindotguan Date: Mon, 21 Oct 2024 14:54:33 -0400 Subject: [PATCH 15/27] log error message only if no pacakge installed --- pkg/controllers/vdb/installpackages_reconciler.go | 4 ++++ pkg/vadmin/install_packages_at.go | 4 +--- pkg/vadmin/install_packages_vc.go | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/controllers/vdb/installpackages_reconciler.go b/pkg/controllers/vdb/installpackages_reconciler.go index 20dbeaf85..2c0096343 100644 --- a/pkg/controllers/vdb/installpackages_reconciler.go +++ b/pkg/controllers/vdb/installpackages_reconciler.go @@ -129,6 +129,10 @@ func (i *InstallPackagesReconciler) runCmd(ctx context.Context, initiatorName ty "skipped installation package list", categorizedStatus.skippedPackages, ) + if len(categorizedStatus.succeededPackages) == 0 { + i.Log.Info("No pacakges was installed. This may due to lack of memory resources or other internal errors.") + } + return err } diff --git a/pkg/vadmin/install_packages_at.go b/pkg/vadmin/install_packages_at.go index 5df935d0e..dde473e62 100644 --- a/pkg/vadmin/install_packages_at.go +++ b/pkg/vadmin/install_packages_at.go @@ -17,7 +17,6 @@ package vadmin import ( "context" - "errors" "regexp" "strings" @@ -35,8 +34,7 @@ func (a *Admintools) InstallPackages(ctx context.Context, opts ...installpackage status := genInstallPackageStatus(stdout) if err != nil && len(status.Packages) == 0 { - pkgErr := errors.New(err.Error() + "This may due to lack of memory resources.") - _, logErr := a.logFailure("install_package", events.InstallPackagesFailed, stdout, pkgErr) + _, logErr := a.logFailure("install_package", events.InstallPackagesFailed, stdout, err) a.Log.Error(err, "failed to finish package installation", "installPackageStatus", *status) return status, logErr } diff --git a/pkg/vadmin/install_packages_vc.go b/pkg/vadmin/install_packages_vc.go index eee826820..929e545bb 100644 --- a/pkg/vadmin/install_packages_vc.go +++ b/pkg/vadmin/install_packages_vc.go @@ -17,7 +17,6 @@ package vadmin import ( "context" - "errors" vops "github.com/vertica/vcluster/vclusterops" "github.com/vertica/vertica-kubernetes/pkg/events" @@ -42,9 +41,8 @@ func (v *VClusterOps) InstallPackages(_ context.Context, opts ...installpackages status = &vops.InstallPackageStatus{} } if err != nil { - pkgErr := errors.New(err.Error() + "This may due to lack of memory resources.") - _, err = v.logFailure("VInstallPackages", events.InstallPackagesFailed, pkgErr) - v.Log.Error(err, "failed to finish package installation", "installPackageStatus", *status) + _, err = v.logFailure("VInstallPackages", events.InstallPackagesFailed, err) + v.Log.Error(err, "failed to finish package installation.", "installPackageStatus", *status) return status, err } From 03ffeb96d465232686cb764218f5b86cd1f162cb Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 22 Oct 2024 14:39:26 -0400 Subject: [PATCH 16/27] move online upgrade fall back log before the event --- pkg/controllers/vdb/upgrade.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/vdb/upgrade.go b/pkg/controllers/vdb/upgrade.go index 9f74cc6db..87f8efce5 100644 --- a/pkg/controllers/vdb/upgrade.go +++ b/pkg/controllers/vdb/upgrade.go @@ -846,9 +846,6 @@ func (i *UpgradeManager) logEventIfRequestedUpgradeIsDifferent(actualUpgrade vap if !i.ContinuingUpgrade && i.Vdb.Spec.UpgradePolicy != actualUpgrade && i.Vdb.Spec.UpgradePolicy != vapi.AutoUpgrade { actualUpgradeAsText := strings.ToLower(string(actualUpgrade)) - i.Rec.Eventf(i.Vdb, corev1.EventTypeNormal, events.IncompatibleUpgradeRequested, - "Requested upgrade is incompatible with the Vertica deployment. Falling back to %s upgrade.", actualUpgradeAsText) - if i.Vdb.Spec.UpgradePolicy == "Online" { i.Log.Info("Not all online upgrade prerequisites met. Please make sure: " + "1. Vertica server version is 24.3.0-2 or higher. " + @@ -856,6 +853,9 @@ func (i *UpgradeManager) logEventIfRequestedUpgradeIsDifferent(actualUpgrade vap "3. A license file was applied to allow double the DB nodes. " + "4. No sandbox defined.") } + + i.Rec.Eventf(i.Vdb, corev1.EventTypeNormal, events.IncompatibleUpgradeRequested, + "Requested upgrade is incompatible with the Vertica deployment. Falling back to %s upgrade.", actualUpgradeAsText) } } From 87b65e1b29fa85fc2889eb18e2e7110b37055460 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 23 Oct 2024 17:04:08 -0400 Subject: [PATCH 17/27] Add requeuePodsNotRunningMsg in onlineUpgradeStatusMsgs --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 5c7a712ea..754d05839 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -65,6 +65,7 @@ const ( // be sure to add a *StatusMsgInx const below. var onlineUpgradeStatusMsgs = []string{ "Starting online upgrade", + "Requeue as pods not running", "Create new subclusters to mimic subclusters in the main cluster", fmt.Sprintf("Querying the original value of config parameter %q", ConfigParamDisableNonReplicatableQueries), fmt.Sprintf("Disable non-replicatable queries by setting config parameter %q", ConfigParamDisableNonReplicatableQueries), @@ -85,6 +86,7 @@ var onlineUpgradeStatusMsgs = []string{ // Constants for each entry in onlineUpgradeStatusMsgs const ( startOnlineUpgradeStatusMsgInx = iota + requeuePodsNotRunningMsgInx createNewSubclustersStatusMsgInx queryOriginalConfigParamDisableNonReplicatableQueriesMsgInx disableNonReplicatableQueriesMsgInx @@ -166,6 +168,7 @@ func (r *OnlineUpgradeReconciler) Reconcile(ctx context.Context, _ *ctrl.Request // Functions to perform when the image changes. Order matters. funcs := []func(context.Context) (ctrl.Result, error){ // Requeue if not all nodes are running + r.postRequeuePodsNotRunningMsg, r.requeuePodsNotRunning, // Initiate an upgrade by setting condition and event recording r.startUpgrade, @@ -292,6 +295,12 @@ func (r *OnlineUpgradeReconciler) loadUpgradeState(ctx context.Context) (ctrl.Re return ctrl.Result{}, nil } +// postRequeuePodsNotRunningMsg will update the status message to indicate that +// we are requeuing online upgrade if not all pods are running. +func (r *OnlineUpgradeReconciler) postRequeuePodsNotRunningMsg(ctx context.Context) (ctrl.Result, error) { + return r.postNextStatusMsg(ctx, requeuePodsNotRunningMsgInx) +} + // requeuePodsNotRunning will requeue the upgrade process if not all pods are running. func (r *OnlineUpgradeReconciler) requeuePodsNotRunning(ctx context.Context) (ctrl.Result, error) { // We skip this if we have already added the new subclusters From 0d2c12e644c098a95f75e59174bbc18d2a7a4d90 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 23 Oct 2024 17:06:40 -0400 Subject: [PATCH 18/27] remove duplicated checks in other tests --- .../35-assert.yaml | 100 ------------------ .../35-wait-for-sandbox.yaml | 1 - .../36-verify-non-replicatable-queries.yaml | 26 ----- .../37-assert.yaml | 23 ---- .../37-create-data-in-main-cluster.yaml | 63 ----------- .../38-assert.yaml | 26 ----- .../38-wait-for-replication-finish.yaml | 1 - .../39-assert.yaml | 23 ---- .../39-verify-data-in-sandbox.yaml | 60 ----------- .../40-assert.yaml | 63 ----------- .../40-errors.yaml | 41 ------- ...wait-for-new-main-cluster-to-be-ready.yaml | 1 - .../45-assert.yaml | 23 ---- .../45-verify-new-main-cluster.yaml | 62 ----------- .../50-assert.yaml | 19 ---- .../50-verify-new-main-cluster-access.yaml | 20 ---- .../base/kustomization.yaml | 15 --- .../verify-new-main-cluster-connection.yaml | 66 ------------ 18 files changed, 633 deletions(-) delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml delete mode 100644 tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml deleted file mode 100644 index 5cb718617..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/35-assert.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v-base-upgrade-pri1-sb - annotations: - vertica.com/statefulset-name-override: "v-base-upgrade-pri1-sb" - labels: - vertica.com/sandbox: replica-group-b -status: - currentReplicas: 2 - readyReplicas: 2 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-pri-2-sb - annotations: - vertica.com/statefulset-name-override: "v-base-upgrade-pri-2-sb" - labels: - vertica.com/sandbox: replica-group-b -status: - currentReplicas: 1 - readyReplicas: 1 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec1-sb - annotations: - vertica.com/statefulset-name-override: "v-base-upgrade-sec1-sb" - labels: - vertica.com/sandbox: replica-group-b -status: - currentReplicas: 2 - readyReplicas: 2 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec2-sb - annotations: - vertica.com/statefulset-name-override: "v-base-upgrade-sec2-sb" - labels: - vertica.com/sandbox: replica-group-b -status: - currentReplicas: 1 - readyReplicas: 1 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: v-base-upgrade-replica-group-b -data: - sandboxName: replica-group-b - verticaDBName: v-base-upgrade -immutable: true ---- -apiVersion: vertica.com/v1 -kind: VerticaDB -metadata: - name: v-base-upgrade -spec: - subclusters: - - name: sec1 - - name: sec2 - - name: pri1 - - name: pri_2 - - name: pri1-sb - type: sandboxprimary - size: 2 - - name: pri_2-sb - type: sandboxprimary - size: 1 - - name: sec1-sb - type: secondary - size: 2 - - name: sec2-sb - type: secondary - size: 1 -status: - sandboxes: - - name: replica-group-b - subclusters: - - pri1-sb - - pri_2-sb - - sec1-sb - - sec2-sb diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml deleted file mode 100644 index bf3726035..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/35-wait-for-sandbox.yaml +++ /dev/null @@ -1 +0,0 @@ -# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml deleted file mode 100644 index 4f7f761ca..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/36-verify-non-replicatable-queries.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: | - val=$(kubectl exec -n $NAMESPACE v-base-upgrade-pri1-0 -c server -- vsql -tAc "alter database default set DataSSLMaxBufSize = 32768"); \ - if [ $val == 0 ]; then \ - exit 1; \ - fi - - script: | - val=$(kubectl exec -n $NAMESPACE v-base-upgrade-pri1-sb-0 -c server -- vsql -tAc "alter database default set DataSSLMaxBufSize = 32768"); \ - if [ $val == 1 ]; then \ - exit 1; \ - fi \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml deleted file mode 100644 index 356c509d4..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/37-assert.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Pod -metadata: - name: test-create-source-data -status: - containerStatuses: - - name: test - state: - terminated: - exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml deleted file mode 100644 index 86abf1b0b..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/37-create-data-in-main-cluster.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: ConfigMap -metadata: - name: script-create-source-data -data: - entrypoint.sh: |- - #!/bin/bash - set -o errexit - set -o xtrace - - POD_NAME=v-base-upgrade-pri1-0 - - kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"CREATE TABLE public.test_table (val INTEGER);\"" - kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"INSERT INTO public.test_table VALUES (99); COMMIT;\"" - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"SELECT * FROM public.test_table ORDER BY val;\"") - echo "$result" | grep -Pzo "^99\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 99, got $result" - exit 1 - fi - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -w superuser -tAc \"SELECT COUNT(*) FROM tables WHERE table_name = 'test_table';\"") - echo "$result" | grep -Pzo "^1\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 1, got $result" - exit 1 - fi - ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-create-source-data - labels: - stern: include -spec: - restartPolicy: Never - containers: - - name: test - image: bitnami/kubectl:1.20.4 - command: ["/bin/entrypoint.sh"] - volumeMounts: - - name: entrypoint-volume - mountPath: /bin/entrypoint.sh - readOnly: true - subPath: entrypoint.sh - volumes: - - name: entrypoint-volume - configMap: - defaultMode: 0777 - name: script-create-source-data diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml deleted file mode 100644 index 65743cba3..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/38-assert.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Event -reason: ReplicationSucceeded -source: - component: verticadb-operator -involvedObject: - apiVersion: vertica.com/v1beta1 - kind: VerticaReplicator ---- -apiVersion: vertica.com/v1beta1 -kind: VerticaReplicator -status: - state: "Replication successful" diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml deleted file mode 100644 index bf3726035..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/38-wait-for-replication-finish.yaml +++ /dev/null @@ -1 +0,0 @@ -# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml deleted file mode 100644 index 5ace234bf..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/39-assert.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Pod -metadata: - name: test-verify-data-in-sandbox -status: - containerStatuses: - - name: test - state: - terminated: - exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml deleted file mode 100644 index e4d7c5567..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/39-verify-data-in-sandbox.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: ConfigMap -metadata: - name: script-verify-data-in-sandbox -data: - entrypoint.sh: |- - #!/bin/bash - set -o errexit - set -o xtrace - - POD_NAME=v-base-upgrade-pri1-sb-0 - - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT * FROM public.test_table ORDER BY val;\"") - echo "$result" | grep -Pzo "^99\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 99, got $result" - exit 1 - fi - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM tables WHERE table_name = 'test_table';\"") - echo "$result" | grep -Pzo "^1\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 1, got $result" - exit 1 - fi ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-verify-data-in-sandbox - labels: - stern: include -spec: - restartPolicy: Never - containers: - - name: test - image: bitnami/kubectl:1.20.4 - command: ["/bin/entrypoint.sh"] - volumeMounts: - - name: entrypoint-volume - mountPath: /bin/entrypoint.sh - readOnly: true - subPath: entrypoint.sh - volumes: - - name: entrypoint-volume - configMap: - defaultMode: 0777 - name: script-verify-data-in-sandbox diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml deleted file mode 100644 index 8eaa520eb..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/40-assert.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v-base-upgrade-pri1-sb -status: - currentReplicas: 2 - readyReplicas: 2 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-pri-2-sb -status: - currentReplicas: 1 - readyReplicas: 1 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec1-sb -status: - currentReplicas: 2 - readyReplicas: 2 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec2-sb -status: - currentReplicas: 1 - readyReplicas: 1 ---- -apiVersion: vertica.com/v1 -kind: VerticaDB -metadata: - name: v-base-upgrade -spec: - subclusters: - - name: pri1 - type: primary - size: 2 - - name: pri_2 - type: primary - size: 1 - - name: sec1 - type: secondary - size: 2 - - name: sec2 - type: secondary - size: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml deleted file mode 100644 index e156e8d07..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/40-errors.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v-base-upgrade-pri1 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-pri-2 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec1 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: v-base-upgrade-sec2 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: v-base-upgrade-replica-group-b -data: - sandboxName: replica-group-b - verticaDBName: v-base-upgrade -immutable: true diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml deleted file mode 100644 index bf3726035..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/40-wait-for-new-main-cluster-to-be-ready.yaml +++ /dev/null @@ -1 +0,0 @@ -# Intentionally empty to give this step a name in kuttl \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml deleted file mode 100644 index 2ef3e1cfa..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/45-assert.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: Pod -metadata: - name: test-verify-new-main-cluster -status: - containerStatuses: - - name: test - state: - terminated: - exitCode: 0 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml deleted file mode 100644 index bac5dc29d..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/45-verify-new-main-cluster.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Intentionally empty to give this step a name in kuttl# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: ConfigMap -metadata: - name: script-verify-new-main-cluster -data: - entrypoint.sh: |- - #!/bin/bash - set -o errexit - set -o xtrace - - POD_NAMES=("v-base-upgrade-pri1-sb-0" "v-base-upgrade-pri-2-sb-0" "v-base-upgrade-sec1-sb-0") - - for POD_NAME in "${POD_NAMES[@]}"; do - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM nodes WHERE node_state = 'UP' and subcluster_name not like '%sb' and sandbox = '';\"") - echo "$result" | grep -Pzo "^6\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 6, got $result" - exit 1 - fi - result=$(kubectl exec $POD_NAME -i -c server -- bash -c "vsql -U dbadmin -tAc \"SELECT COUNT(*) FROM nodes;\"") - echo "$result" | grep -Pzo "^6\n$" > /dev/null - if [ $? -ne 0 ]; then - echo "Assertion failed: expected 6, got $result" - exit 1 - fi - done ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-verify-new-main-cluster - labels: - stern: include -spec: - restartPolicy: Never - containers: - - name: test - image: bitnami/kubectl:1.20.4 - command: ["/bin/entrypoint.sh"] - volumeMounts: - - name: entrypoint-volume - mountPath: /bin/entrypoint.sh - readOnly: true - subPath: entrypoint.sh - volumes: - - name: entrypoint-volume - configMap: - defaultMode: 0777 - name: script-verify-new-main-cluster diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml deleted file mode 100644 index f973565a1..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/50-assert.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: batch/v1 -kind: Job -metadata: - name: test-verify-new-main-cluster-connection -status: - succeeded: 1 diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml deleted file mode 100644 index 436cbde2d..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/50-verify-new-main-cluster-access.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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. - -# Verifies access to the external service through port 5433. It does this -# by connecting using vsql - -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - command: bash -c "kustomize build verify-new-main-cluster-connection/overlay | kubectl -n $NAMESPACE apply -f - " \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml deleted file mode 100644 index f86e02527..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/kustomization.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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. - -resources: - - verify-new-main-cluster-connection.yaml \ No newline at end of file diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml b/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml deleted file mode 100644 index c78f4c156..000000000 --- a/tests/e2e-leg-9/online-upgrade-with-package-install/verify-new-main-cluster-connection/base/verify-new-main-cluster-connection.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# (c) Copyright [2021-2024] Open Text. -# Licensed 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: v1 -kind: ConfigMap -metadata: - name: script-verify-new-main-cluster-connection -data: - verify.sh: |- - #!/bin/bash - set -o errexit - set -o xtrace - # Access to subclusters through primary service should route to the new main cluster. - CONNECTION_NODE=$(vsql -U dbadmin -h v-base-upgrade-pri1 -tAc "select node_name from current_session") - echo $CONNECTION_NODE - if [[ $CONNECTION_NODE == "v_repup_node0007" ]] || \ - [[ $CONNECTION_NODE == "v_repup_node0008" ]] || \ - [[ $CONNECTION_NODE == "v_repup_node0009" ]] - then - exit 0 - fi - # Access to subclusters through secondary service should route to the new main cluster. - CONNECTION_NODE=$(vsql -U dbadmin -h v-base-upgrade-sec1 -tAc "select node_name from current_session") - echo $CONNECTION_NODE - if [[ $CONNECTION_NODE == "v_repup_node0010" ]] || \ - [[ $CONNECTION_NODE == "v_repup_node0011" ]] || \ - [[ $CONNECTION_NODE == "v_repup_node0012" ]] - then - exit 0 - fi - exit 1 # Incorrect value ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: test-verify-new-main-cluster-connection - labels: - stern: include -spec: - template: - spec: - restartPolicy: OnFailure - containers: - - name: test - image: kustomize-vertica-image - command: ["/home/dbadmin/verify.sh"] - volumeMounts: - - name: test-script - mountPath: /home/dbadmin/verify.sh - readOnly: true - subPath: verify.sh - volumes: - - name: test-script - configMap: - defaultMode: 0777 - name: script-verify-new-main-cluster-connection \ No newline at end of file From fbacb19159c0b225507812f1a517f53a56945c10 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 23 Oct 2024 17:08:13 -0400 Subject: [PATCH 19/27] rename online-upgrade-with-package-install to online-upgrade-pods-pending --- scripts/kind.sh | 27 ++++++++++++++++--- scripts/setup-krew.sh | 4 +-- scripts/setup-minio.sh | 6 +++-- .../02-assert.yaml | 0 .../02-rbac.yaml | 0 .../05-create-secrets.yaml | 0 .../10-assert.yaml | 0 .../10-verify-operator.yaml | 0 .../15-assert.yaml | 0 .../15-setup-vdb.yaml | 0 .../20-assert.yaml | 0 .../20-wait-for-createdb.yaml | 0 .../25-wait-for-steady-state.yaml | 0 .../26-assert.yaml | 0 .../26-set-pod-pending.yaml | 0 .../27-initiate-upgrade.yaml | 0 .../29-set-pod-running.yaml | 0 .../30-assert.yaml | 0 .../30-wait-for-restart.yaml | 0 .../31-assert.yaml | 0 .../31-wait-for-scs-mimic.yaml | 0 .../95-delete-cr.yaml | 0 .../95-errors.yaml | 0 .../96-assert.yaml | 0 .../96-cleanup-storage.yaml | 0 .../96-errors.yaml | 0 .../99-delete-ns.yaml | 0 .../setup-vdb/base/kustomization.yaml | 0 .../setup-vdb/base/setup-vdb.yaml | 0 29 files changed, 29 insertions(+), 8 deletions(-) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/02-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/02-rbac.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/05-create-secrets.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/10-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/10-verify-operator.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/15-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/15-setup-vdb.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/20-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/20-wait-for-createdb.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/25-wait-for-steady-state.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/26-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/26-set-pod-pending.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/27-initiate-upgrade.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/29-set-pod-running.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/30-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/30-wait-for-restart.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/31-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/31-wait-for-scs-mimic.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/95-delete-cr.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/95-errors.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/96-assert.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/96-cleanup-storage.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/96-errors.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/99-delete-ns.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/setup-vdb/base/kustomization.yaml (100%) rename tests/e2e-leg-9/{online-upgrade-with-package-install => online-upgrade-pods-pending}/setup-vdb/base/setup-vdb.yaml (100%) diff --git a/scripts/kind.sh b/scripts/kind.sh index e0a64b894..719d6c000 100755 --- a/scripts/kind.sh +++ b/scripts/kind.sh @@ -19,7 +19,7 @@ set -e UPLOAD_IMAGES= TAG=latest -KUBEVER=1.23.0 +KUBEVER=1.30.0 IP_FAMILY=ipv4 LISTEN_ALL_INTERFACES=N VSQL_PORT=5433 @@ -30,7 +30,10 @@ REG_NAME='kind-registry' REG_PORT='5000' HANDLE_REGISTRY=1 LOG_MAX_SIZE='100Mi' -EVENT_TTL='24h' +EVENT_TTL='15m' +EVENT_QPS='100' +CPU_SIZE='500m' +MEMORY_SIZE='2Gi' while getopts "ut:k:i:ap:xr:m:" opt do @@ -126,12 +129,27 @@ EOF nodes: - role: control-plane EOF - if [[ -n "$EVENT_TTL" ]] + if [[ -n "$EVENT_TTL" ]] || [[ -n "$MEMORY_SIZE" ]] then cat <<- EOF >> $tmpfile - # Patch in apiserver to increase event ttl duration kubeadmConfigPatches: - | +EOF + fi + if [[ -n "$MEMORY_SIZE" ]] + then + cat <<- EOF >> $tmpfile + # set memory size + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + system-reserved: memory=$MEMORY_SIZE +EOF + fi + if [[ -n "$EVENT_TTL" ]] + then + cat <<- EOF >> $tmpfile + # Patch in apiserver to increase event ttl duration kind: ClusterConfiguration apiServer: extraArgs: @@ -156,6 +174,7 @@ EOF containerPath: /host EOF fi + cat $tmpfile ${KIND} create cluster --name ${CLUSTER_NAME} --image kindest/node:v${KUBEVER} --config $tmpfile --wait 5m diff --git a/scripts/setup-krew.sh b/scripts/setup-krew.sh index 4398e9fff..bcdad3f79 100755 --- a/scripts/setup-krew.sh +++ b/scripts/setup-krew.sh @@ -19,12 +19,12 @@ set -o xtrace set -o errexit set -o pipefail -KREW_URL=https://github.com/kubernetes-sigs/krew/releases/download/v0.4.1/krew.tar.gz +KREW_URL=https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew-linux_amd64.tar.gz cd "$(mktemp -d)" OS="$(uname | tr '[:upper:]' '[:lower:]')" && ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && curl --retry 10 --retry-max-time 1800 -fsSLO $KREW_URL && -tar zxvf krew.tar.gz && +tar zxvf krew-linux_amd64.tar.gz && KREW=./krew-"${OS}_${ARCH}" && "$KREW" install krew diff --git a/scripts/setup-minio.sh b/scripts/setup-minio.sh index f6f785411..c4c31e220 100755 --- a/scripts/setup-minio.sh +++ b/scripts/setup-minio.sh @@ -58,9 +58,11 @@ set -o xtrace # First setup the operator kubectl krew update -kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/d1817869b86fd040a923682b1392bdb232947bf5/plugins/minio.yaml +#kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/43b3cb01d35ea640d7d8ba4e38c5d8ca7b4bac3b/plugins/minio.yaml +kubectl krew install minio # If these images ever change, they must be updated in tests/external-images-s3-ci.txt -kubectl minio init --image minio/operator:v4.5.7 +#kubectl minio init --image minio/operator:v5.0.1 +kubectl minio init # The above command will create the CRD. But there is a timing hole where the # CRD is not yet registered with k8s, causing the tenant creation below to diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/02-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/02-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/02-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/02-rbac.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/02-rbac.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/02-rbac.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/05-create-secrets.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/05-create-secrets.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/05-create-secrets.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/10-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/10-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/10-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/10-verify-operator.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/10-verify-operator.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/10-verify-operator.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/15-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/15-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/15-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/15-setup-vdb.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/15-setup-vdb.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/15-setup-vdb.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/20-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/20-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/20-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/20-wait-for-createdb.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/20-wait-for-createdb.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/20-wait-for-createdb.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/25-wait-for-steady-state.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/25-wait-for-steady-state.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/25-wait-for-steady-state.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/26-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/26-set-pod-pending.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/26-set-pod-pending.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/26-set-pod-pending.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/27-initiate-upgrade.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/27-initiate-upgrade.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/27-initiate-upgrade.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/29-set-pod-running.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/29-set-pod-running.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/29-set-pod-running.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/30-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/30-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/30-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/30-wait-for-restart.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/30-wait-for-restart.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/30-wait-for-restart.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/31-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/31-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/31-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/31-wait-for-scs-mimic.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/31-wait-for-scs-mimic.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/31-wait-for-scs-mimic.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/95-delete-cr.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/95-delete-cr.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/95-delete-cr.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/95-errors.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/95-errors.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/95-errors.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/96-assert.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/96-assert.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/96-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/96-cleanup-storage.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/96-cleanup-storage.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/96-cleanup-storage.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/96-errors.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/96-errors.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/96-errors.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/99-delete-ns.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/99-delete-ns.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/99-delete-ns.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/kustomization.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/kustomization.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/kustomization.yaml diff --git a/tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml similarity index 100% rename from tests/e2e-leg-9/online-upgrade-with-package-install/setup-vdb/base/setup-vdb.yaml rename to tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml From a668a0fafde0c34abe94a26c119a13ecd1a66a9c Mon Sep 17 00:00:00 2001 From: qindotguan Date: Wed, 23 Oct 2024 17:20:21 -0400 Subject: [PATCH 20/27] revert the change to the devcluster --- scripts/kind.sh | 27 ++++----------------------- scripts/setup-krew.sh | 4 ++-- scripts/setup-minio.sh | 6 ++---- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/scripts/kind.sh b/scripts/kind.sh index 719d6c000..e0a64b894 100755 --- a/scripts/kind.sh +++ b/scripts/kind.sh @@ -19,7 +19,7 @@ set -e UPLOAD_IMAGES= TAG=latest -KUBEVER=1.30.0 +KUBEVER=1.23.0 IP_FAMILY=ipv4 LISTEN_ALL_INTERFACES=N VSQL_PORT=5433 @@ -30,10 +30,7 @@ REG_NAME='kind-registry' REG_PORT='5000' HANDLE_REGISTRY=1 LOG_MAX_SIZE='100Mi' -EVENT_TTL='15m' -EVENT_QPS='100' -CPU_SIZE='500m' -MEMORY_SIZE='2Gi' +EVENT_TTL='24h' while getopts "ut:k:i:ap:xr:m:" opt do @@ -129,27 +126,12 @@ EOF nodes: - role: control-plane EOF - if [[ -n "$EVENT_TTL" ]] || [[ -n "$MEMORY_SIZE" ]] + if [[ -n "$EVENT_TTL" ]] then cat <<- EOF >> $tmpfile + # Patch in apiserver to increase event ttl duration kubeadmConfigPatches: - | -EOF - fi - if [[ -n "$MEMORY_SIZE" ]] - then - cat <<- EOF >> $tmpfile - # set memory size - kind: InitConfiguration - nodeRegistration: - kubeletExtraArgs: - system-reserved: memory=$MEMORY_SIZE -EOF - fi - if [[ -n "$EVENT_TTL" ]] - then - cat <<- EOF >> $tmpfile - # Patch in apiserver to increase event ttl duration kind: ClusterConfiguration apiServer: extraArgs: @@ -174,7 +156,6 @@ EOF containerPath: /host EOF fi - cat $tmpfile ${KIND} create cluster --name ${CLUSTER_NAME} --image kindest/node:v${KUBEVER} --config $tmpfile --wait 5m diff --git a/scripts/setup-krew.sh b/scripts/setup-krew.sh index bcdad3f79..4398e9fff 100755 --- a/scripts/setup-krew.sh +++ b/scripts/setup-krew.sh @@ -19,12 +19,12 @@ set -o xtrace set -o errexit set -o pipefail -KREW_URL=https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew-linux_amd64.tar.gz +KREW_URL=https://github.com/kubernetes-sigs/krew/releases/download/v0.4.1/krew.tar.gz cd "$(mktemp -d)" OS="$(uname | tr '[:upper:]' '[:lower:]')" && ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && curl --retry 10 --retry-max-time 1800 -fsSLO $KREW_URL && -tar zxvf krew-linux_amd64.tar.gz && +tar zxvf krew.tar.gz && KREW=./krew-"${OS}_${ARCH}" && "$KREW" install krew diff --git a/scripts/setup-minio.sh b/scripts/setup-minio.sh index c4c31e220..f6f785411 100755 --- a/scripts/setup-minio.sh +++ b/scripts/setup-minio.sh @@ -58,11 +58,9 @@ set -o xtrace # First setup the operator kubectl krew update -#kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/43b3cb01d35ea640d7d8ba4e38c5d8ca7b4bac3b/plugins/minio.yaml -kubectl krew install minio +kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/d1817869b86fd040a923682b1392bdb232947bf5/plugins/minio.yaml # If these images ever change, they must be updated in tests/external-images-s3-ci.txt -#kubectl minio init --image minio/operator:v5.0.1 -kubectl minio init +kubectl minio init --image minio/operator:v4.5.7 # The above command will create the CRD. But there is a timing hole where the # CRD is not yet registered with k8s, causing the tenant creation below to From 031998caa056c4e152822fe916430ae2fe9b2110 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Thu, 24 Oct 2024 10:02:39 -0400 Subject: [PATCH 21/27] remove extra dot in finish package installation msg --- pkg/vadmin/install_packages_vc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/vadmin/install_packages_vc.go b/pkg/vadmin/install_packages_vc.go index 929e545bb..9aa903107 100644 --- a/pkg/vadmin/install_packages_vc.go +++ b/pkg/vadmin/install_packages_vc.go @@ -42,7 +42,7 @@ func (v *VClusterOps) InstallPackages(_ context.Context, opts ...installpackages } if err != nil { _, err = v.logFailure("VInstallPackages", events.InstallPackagesFailed, err) - v.Log.Error(err, "failed to finish package installation.", "installPackageStatus", *status) + v.Log.Error(err, "failed to finish package installation", "installPackageStatus", *status) return status, err } From bb882b4220331bf8a3176036137c0af2e336cf89 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Fri, 25 Oct 2024 04:05:40 -0400 Subject: [PATCH 22/27] move requeue pending after postStartOnlineUpgradeMsg --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 754d05839..93fb5df60 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -167,13 +167,13 @@ func (r *OnlineUpgradeReconciler) Reconcile(ctx context.Context, _ *ctrl.Request // Functions to perform when the image changes. Order matters. funcs := []func(context.Context) (ctrl.Result, error){ - // Requeue if not all nodes are running - r.postRequeuePodsNotRunningMsg, - r.requeuePodsNotRunning, // Initiate an upgrade by setting condition and event recording r.startUpgrade, r.logEventIfThisUpgradeWasNotChosen, r.postStartOnlineUpgradeMsg, + // Requeue if not all nodes are running + r.postRequeuePodsNotRunningMsg, + r.requeuePodsNotRunning, // Load up state that is used for the subsequent steps r.loadUpgradeState, // Assign subclusters to upgrade to replica group A From e1106a4994a60189cd143ac06701964d37471d7a Mon Sep 17 00:00:00 2001 From: qindotguan Date: Fri, 25 Oct 2024 04:06:58 -0400 Subject: [PATCH 23/27] validate pod pending and requeue status --- .../26-assert.yaml | 9 +++---- .../27-assert.yaml | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml diff --git a/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml index db9dc4cc8..2945e6cba 100644 --- a/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml @@ -11,10 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: apps/v1 -kind: StatefulSet +apiVersion: v1 +kind: Pod metadata: - name: v-base-upgrade-sec2 + name: v-base-upgrade-sec2-0 status: - availableReplicas: 0 - replicas: 1 + phase: pending diff --git a/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml new file mode 100644 index 000000000..514fbaf82 --- /dev/null +++ b/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml @@ -0,0 +1,26 @@ +# (c) Copyright [2021-2024] Open Text. +# Licensed 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: v1 +kind: Pod +metadata: + name: v-base-upgrade-sec2-0 +status: + phase: pending +--- +apiVersion: vertica.com/v1beta1 +kind: VerticaDB +metadata: + name: v-base-upgrade +status: + upgradeStatus: "Requeue as pods not running" \ No newline at end of file From bd814df7fdac2792b342e5dc194317c3eff1ad5e Mon Sep 17 00:00:00 2001 From: qindotguan Date: Fri, 25 Oct 2024 04:32:58 -0400 Subject: [PATCH 24/27] update pending --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 2 +- tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml | 2 +- tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index 93fb5df60..80ddbeb69 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -65,7 +65,7 @@ const ( // be sure to add a *StatusMsgInx const below. var onlineUpgradeStatusMsgs = []string{ "Starting online upgrade", - "Requeue as pods not running", + "Requeue as not all pods are running", "Create new subclusters to mimic subclusters in the main cluster", fmt.Sprintf("Querying the original value of config parameter %q", ConfigParamDisableNonReplicatableQueries), fmt.Sprintf("Disable non-replicatable queries by setting config parameter %q", ConfigParamDisableNonReplicatableQueries), diff --git a/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml index 2945e6cba..5e3499916 100644 --- a/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-pods-pending/26-assert.yaml @@ -16,4 +16,4 @@ kind: Pod metadata: name: v-base-upgrade-sec2-0 status: - phase: pending + phase: Pending diff --git a/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml index 514fbaf82..ccb58f602 100644 --- a/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml +++ b/tests/e2e-leg-9/online-upgrade-pods-pending/27-assert.yaml @@ -16,11 +16,11 @@ kind: Pod metadata: name: v-base-upgrade-sec2-0 status: - phase: pending + phase: Pending --- apiVersion: vertica.com/v1beta1 kind: VerticaDB metadata: name: v-base-upgrade status: - upgradeStatus: "Requeue as pods not running" \ No newline at end of file + upgradeStatus: "Requeue as not all pods are running" \ No newline at end of file From ef2164c8f871ba2666c54f43e5d5761b6894c98c Mon Sep 17 00:00:00 2001 From: qindotguan Date: Fri, 25 Oct 2024 04:33:36 -0400 Subject: [PATCH 25/27] test with initPolicy CreateSkipPackageInstall --- .../online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml b/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml index 688b93b17..0551d867b 100644 --- a/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml +++ b/tests/e2e-leg-9/online-upgrade-pods-pending/setup-vdb/base/setup-vdb.yaml @@ -24,7 +24,7 @@ metadata: spec: image: kustomize-vertica-image dbName: repUP - initPolicy: Create + initPolicy: CreateSkipPackageInstall upgradePolicy: Online communal: {} local: From e6c83987ab6fb3e3677fbccf37479c1504506417 Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 29 Oct 2024 06:25:52 -0400 Subject: [PATCH 26/27] export anyPodsNotRunning as podfacts moved to a separated pacakge --- pkg/podfacts/podfacts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/podfacts/podfacts.go b/pkg/podfacts/podfacts.go index 2b2c7500a..6fc3fa0e2 100644 --- a/pkg/podfacts/podfacts.go +++ b/pkg/podfacts/podfacts.go @@ -1387,9 +1387,9 @@ func GenPodNames(pods []*PodFact) string { return strings.Join(podNames, ", ") } -// anyPodsNotRunning returns true if any pod isn't running. It could be still pending due to +// AnyPodsNotRunning returns true if any pod isn't running. It could be still pending due to // lack of resources. It will return the name of the first pod that isn't running. -func (p *PodFacts) anyPodsNotRunning() (bool, types.NamespacedName) { +func (p *PodFacts) AnyPodsNotRunning() (bool, types.NamespacedName) { for _, v := range p.Detail { if !v.isPodRunning { return true, v.name From 60fb071979f7c29334b4a236742c4bc23d93136c Mon Sep 17 00:00:00 2001 From: qindotguan Date: Tue, 29 Oct 2024 06:27:42 -0400 Subject: [PATCH 27/27] rename anyPodsNotRunning to AnyPodsNotRunning --- pkg/controllers/vdb/onlineupgrade_reconciler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/vdb/onlineupgrade_reconciler.go b/pkg/controllers/vdb/onlineupgrade_reconciler.go index bedbf697d..4226240ae 100644 --- a/pkg/controllers/vdb/onlineupgrade_reconciler.go +++ b/pkg/controllers/vdb/onlineupgrade_reconciler.go @@ -313,7 +313,7 @@ func (r *OnlineUpgradeReconciler) requeuePodsNotRunning(ctx context.Context) (ct // For pods are pending due to lack of resources, we requeue restarting them and wait // for user operation. mainPFacts := r.PFacts[vapi.MainCluster] - found, _ := mainPFacts.anyPodsNotRunning() + found, _ := mainPFacts.AnyPodsNotRunning() if found { r.Log.Info("Not all pods are running, requeuing.") return ctrl.Result{Requeue: true}, nil