File tree Expand file tree Collapse file tree
stackgres-k8s/src/operator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,6 +381,7 @@ do_backup() {
381381 -- psql -v ON_ERROR_STOP=1 -t -A > /tmp/backup-psql-out 2>&1 &
382382 echo $! > /tmp/backup-psql-pid
383383
384+ echo " Starting backup"
384385 cat << EOF >> /tmp/backup-psql
385386SELECT 'Backup bootstrap';
386387EOF
@@ -455,6 +456,7 @@ spec:
455456 source:
456457 persistentVolumeClaimName: $( cat /tmp/current-primary-pvc)
457458EOF
459+ echo " Performing cleanup of backup restored files before creating the VolumeSnapshot"
458460 if ! retry kubectl exec -n " $CLUSTER_NAMESPACE " " $( cat /tmp/current-primary) " -c patroni -- \
459461 rm -rf " $PG_DATA_PATH .backup" " $PG_DATA_PATH /.restored_from_volume_snapshot" > /tmp/backup-cleanup 2>&1
460462 then
466468 kill " $( cat /tmp/backup-tail-pid) " || true
467469 exit 1
468470 fi
471+ echo " Creating VolumeSnapshot"
469472 cat /tmp/backup-cleanup
470473 if ! retry kubectl create -f /tmp/snapshot-to-create > /tmp/backup-snapshot 2>&1
471474 then
521524 sleep 1
522525 done
523526
527+ echo " Stopping backup"
524528 cat << EOF >> /tmp/backup-psql
525529SET client_min_messages TO WARNING;
526530SELECT
Original file line number Diff line number Diff line change 154154 esac
155155 done
156156 ;;
157+ (" exec -n $CLUSTER_NAMESPACE $( cat /tmp/current-primary) -c patroni -- rm -rf " * )
158+ ;;
157159 (" create -f /tmp/snapshot-to-create" )
158160 ;;
159161 (" get $VOLUME_SNAPSHOT_CRD_NAME -n $CLUSTER_NAMESPACE $BACKUP_NAME -o json" )
You can’t perform that action at this time.
0 commit comments