Skip to content

Commit 16e9c0f

Browse files
committed
Merge branch 'snapshot-creation-checkpoint' into 'master'
fix: add checkpoints before stopping sync-instance and promotion containers See merge request postgres-ai/database-lab!110
2 parents c684905 + ea71c53 commit 16e9c0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/create_zfs_snapshot.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ previous_snapshot_time=$(sudo zfs list -t snapshot -r ${zfs_pool} -H -o dblab:da
5656
# .. and in the very end: select pg_stop_backup();
5757

5858
#echo "Stopping sync instance..."
59+
#sudo docker exec ${sync_instance} psql -U ${pg_username} -d ${pg_db} -XAtc 'checkpoint'
5960
#sudo docker stop ${sync_instance}
6061

6162
# If you have a running sync instance, uncomment this line before getting a snapshot.
@@ -260,6 +261,7 @@ fi
260261
################################################################################
261262

262263
# Finally, stop Postgres and create the base snapshot ready to be used for thin provisioning
264+
sudo docker exec ${container_name} psql -p ${clone_port} -U ${pg_username} -d ${pg_db} -h ${pg_sock_dir} -XAtc 'checkpoint'
263265
sudo docker stop ${container_name}
264266

265267
${sudo_cmd} rm -rf ${clone_pgdata_dir}/pg_log

0 commit comments

Comments
 (0)