Skip to content

Commit 8f5420d

Browse files
committed
Merge branch '20240206-fixes' into 'main'
🚆 Fix Train 06-02-2025 See merge request ongresinc/stackgres!1651
2 parents f0c4c0a + 93790aa commit 8f5420d

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

stackgres-k8s/install/helm/stackgres-operator/templates/check-upgrade.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ $version := $deployment.metadata.labels.version }}
1010
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
1111
{{ if or (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) (and (not (eq $version $chart.Version)) (regexMatch "(-alpha[0-9]|-beta[0-9])" $version)) }}
12-
{{ fail (print "Upgrading from version " $version " version is not supported. You may force upgrading from an unsupported version setting the parameter \"forceUpgradeFromUnsupportedVersion\" to \"true\". If you do so do it at your own risk. It has not been tested and some functionality may break. If you are conscious of the risk of such a dangerous action we recommend to perform security upgrades of all your SGCluster and SGShardedCluster as soon as possible after upgrading from an unsupported version of the operator upgrade") }}
12+
{{ fail (print "Upgrading from version " $version " version is not supported. You may force upgrading from an unsupported version setting the parameter \"forceUpgradeFromUnsupportedVersion\" to \"true\". If you do so do it at your own risk. It has not been tested and some or all functionalities may break. Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGClusters and SGShardedClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart restart SGDbOps or SGShardedDbOps of all your SGClusters and SGShardedClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
1313
{{ end }}
1414
{{ end }}
1515
{{ end }}
@@ -23,7 +23,11 @@
2323
{{ if (index $shardedcluster.metadata.annotations "stackgres.io/operatorVersion") }}
2424
{{ $version := (index $shardedcluster.metadata.annotations "stackgres.io/operatorVersion") }}
2525
{{ if (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) }}
26-
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". You have to run a SGShardedDbOps of type securityUpgrade on those SGShardedClusters first.") }}
26+
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
27+
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". You have to run a SGShardedDbOps of type securityUpgrade on those SGShardedClusters first.") }}
28+
{{ else }}
29+
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGShardedClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart SGShardedDbOps of all your SGShardedClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
30+
{{ end }}
2731
{{ end }}
2832
{{ end }}
2933
{{ end }}
@@ -38,7 +42,11 @@
3842
{{ if (index $cluster.metadata.annotations "stackgres.io/operatorVersion") }}
3943
{{ $version := (index $cluster.metadata.annotations "stackgres.io/operatorVersion") }}
4044
{{ if (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) }}
41-
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". You have to run a SGDbOps of type securityUpgrade on those SGClusters first.") }}
45+
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
46+
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". You have to run a SGDbOps of type securityUpgrade on those SGClusters first.") }}
47+
{{ else }}
48+
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart SGDbOps of all your SGClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
49+
{{ end }}
4250
{{ end }}
4351
{{ end }}
4452
{{ end }}

stackgres-k8s/install/helm/stackgres-operator/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ developer:
545545
volumes: []
546546
# -- Pod's container volume mounts. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#volumemount-v1-core
547547
volumeMounts: []
548-
# Section to define volumes to be used by the distributedlogs controller container
549-
distributedlogsController:
548+
# Section to define volumes to be used by the stream container
549+
stream:
550550
# -- Pod volumes. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#volume-v1-core
551551
volumes: []
552552
# -- Pod's container volume mounts. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#volumemount-v1-core

stackgres-k8s/src/operator/src/main/java/io/stackgres/operator/conciliation/ReconciliatorWorkerThreadPool.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ void executeReconciliation(ReconciliationRunnable r) {
213213
LOGGER.trace("{} has been scheduled to be reconcilied",
214214
r);
215215
}
216-
toExecuteReconciliations.stream().filter(r::equals).forEach(this::execute);
216+
toExecuteReconciliations.forEach(ter -> {
217+
if (ter.equals(r)) {
218+
this.execute(ter);
219+
}
220+
});
217221
toExecuteReconciliations.remove(r);
218222
}
219223
}

stackgres-k8s/src/operator/src/main/resources/templates/run-major-version-upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,17 +609,17 @@ rollback_major_version_upgrade() {
609609
610610
if [ -z "$SOURCE_BACKUP_PATH" ]
611611
then
612-
echo "Rollback major version upgrade by setting postgres version to $SOURCE_VERSION, postgres config to $SOURCE_POSTGRES_CONFIG and replication mode to $SOURCE_REPLICATION_MODE..."
612+
echo "Rollback major version upgrade by setting postgres version to $SOURCE_VERSION, postgres config to $SOURCE_POSTGRES_CONFIG and replication mode to async..."
613613
else
614-
echo "Rollback major version upgrade by setting postgres version to $SOURCE_VERSION, postgres config to $SOURCE_POSTGRES_CONFIG, replication mode to $SOURCE_REPLICATION_MODE and backup path to $SOURCE_BACKUP_PATH..."
614+
echo "Rollback major version upgrade by setting postgres version to $SOURCE_VERSION, postgres config to $SOURCE_POSTGRES_CONFIG, replication mode to async and backup path to $SOURCE_BACKUP_PATH..."
615615
fi
616616
echo
617617
until {
618618
CLUSTER="$({ kubectl get "$CLUSTER_CRD_NAME.$CRD_GROUP" -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json || printf .; } | jq -c .)"
619619
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '.spec.postgres.version = "'"$SOURCE_VERSION"'"')"
620620
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '.spec.postgres.extensions = '"$SOURCE_EXTENSIONS")"
621621
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '.spec.configurations.sgPostgresConfig = "'"$SOURCE_POSTGRES_CONFIG"'"')"
622-
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '.spec.replication.mode = "'"$SOURCE_REPLICATION_MODE"'"')"
622+
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '.spec.replication.mode = "async"')"
623623
if [ -n "$SOURCE_BACKUP_PATH" ]
624624
then
625625
CLUSTER="$(printf '%s' "$CLUSTER" | jq -c '

0 commit comments

Comments
 (0)