Skip to content

Commit

Permalink
chore: support PostgreSQL PITR if exists multi timeline (apecloud#3438)
Browse files Browse the repository at this point in the history
  • Loading branch information
dengshaojiang authored May 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4468b16 commit 746d815
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deploy/postgresql/templates/backuptool-pitr.yaml
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ spec:
- |
set -e;
rm -f ${CONF_DIR}/recovery.conf;
rm -rf ${PITR_DIR};
physical:
restoreCommands:
- |
@@ -52,7 +53,10 @@ spec:
echo "[[ -d '${DATA_DIR}.old' ]] && mv -f ${DATA_DIR}.old/* ${DATA_DIR}/;" >> ${RESTORE_SCRIPT_DIR}/kb_restore.sh;
echo "sync;" >> ${RESTORE_SCRIPT_DIR}/kb_restore.sh;
chmod +x ${RESTORE_SCRIPT_DIR}/kb_restore.sh;
echo "restore_command='mv ${PITR_DIR}/%f %p'\nrecovery_target_time='${RECOVERY_TIME}'\nrecovery_target_action='promote'" > ${CONF_DIR}/recovery.conf;
echo "restore_command='case "%f" in *history) cp ${PITR_DIR}/%f %p ;; *) mv ${PITR_DIR}/%f %p ;; esac'" > ${CONF_DIR}/recovery.conf;
echo "recovery_target_time='${RECOVERY_TIME}'" >> ${CONF_DIR}/recovery.conf;
echo "recovery_target_action='promote'" >> ${CONF_DIR}/recovery.conf;
echo "recovery_target_timeline='latest'" >> ${CONF_DIR}/recovery.conf;
mv ${DATA_DIR} ${DATA_DIR}.old;
echo "done.";
sync;

0 comments on commit 746d815

Please sign in to comment.