1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

Fix backup if we do full backup.

This commit is contained in:
stalkerg 2016-05-11 21:49:26 +03:00
parent e3b0f4485b
commit 075c37ba68
3 changed files with 18 additions and 18 deletions

View File

@ -129,6 +129,9 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
"or validate existing one.");
}
if (current.backup_mode != BACKUP_MODE_DIFF_PTRACK)
pg_ptrack_clear();
/* notify start of backup to PostgreSQL server */
time2iso(label, lengthof(label), current.start_time);
strncat(label, " with pg_arman", lengthof(label));
@ -148,8 +151,6 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
elog(ERROR, "backup_label does not exist in PGDATA.");
}
if (current.backup_mode != BACKUP_MODE_DIFF_PTRACK)
pg_ptrack_clear();
/*
* List directories and symbolic links with the physical path to make
* mkdirs.sh, then sort them in order of path. Omit $PGDATA.

View File

@ -32,24 +32,25 @@ OK: recovery-target-xid options works well.
###### RESTORE COMMAND TEST-0006 ######
###### recovery to latest from full + ptrack backups ######
0
0
1
0
###### RESTORE COMMAND TEST-0007 ######
###### recovery to latest from full + ptrack + ptrack backups ######
0
1
1
0
###### RESTORE COMMAND TEST-0010 ######
###### recovery to latest from full + page backups with loads when full backup do ######
0
1
0
###### RESTORE COMMAND TEST-0009 ######
###### recovery to latest from full + ptrack backups with loads when full backup do ######
0
0
1
0
###### RESTORE COMMAND TEST-0008 ######
###### recovery with target inclusive false ######
0
0
OK: recovery-target-inclusive=false works well.

View File

@ -172,18 +172,15 @@ echo ''
echo '###### RESTORE COMMAND TEST-0010 ######'
echo '###### recovery to latest from full + page backups with loads when full backup do ######'
echo '###### recovery to latest from full + page backups with loads when ptrack backup do ######'
init_backup
pgbench_objs 0009
pgbench -p ${TEST_PGPORT} -d pgbench -c 4 -T 8 > /dev/null 2>&1 &
PGBENCH_PID=$!
pgbench_objs 0010
pg_arman backup -B ${BACKUP_PATH} -b full -j 4 -p ${TEST_PGPORT} -d postgres --verbose > ${TEST_BASE}/TEST-0010-run.out 2>&1;echo $?
pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0010-run.out 2>&1
#kill $PGBENCH_PID 2> /dev/null
sleep 12
#psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT count(*) FROM pgbench_history;" > ${TEST_BASE}/TEST-0010-count1.out
pg_arman backup -B ${BACKUP_PATH} -b page -j 4 -p ${TEST_PGPORT} -d postgres --verbose >> ${TEST_BASE}/TEST-0010-run.out 2>&1;echo $?
pgbench -p ${TEST_PGPORT} -d pgbench -c 4 -T 8 > /dev/null 2>&1 &
pg_arman backup -B ${BACKUP_PATH} -b ptrack -j 4 -p ${TEST_PGPORT} -d postgres --verbose >> ${TEST_BASE}/TEST-0010-run.out 2>&1;echo $?
pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0010-run.out 2>&1
sleep 12
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT sum(bbalance) FROM pgbench_branches;" > ${TEST_BASE}/TEST-0010-count1.out
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT sum(delta) FROM pgbench_history;" > ${TEST_BASE}/TEST-0010-count2.out
diff ${TEST_BASE}/TEST-0010-count1.out ${TEST_BASE}/TEST-0010-count2.out
@ -193,6 +190,7 @@ pg_ctl start -w -t 600 > /dev/null 2>&1
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT sum(bbalance) FROM pgbench_branches;" > ${TEST_BASE}/TEST-0010-count1.out
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT sum(delta) FROM pgbench_history;" > ${TEST_BASE}/TEST-0010-count2.out
diff ${TEST_BASE}/TEST-0010-count1.out ${TEST_BASE}/TEST-0010-count2.out
echo ''
@ -201,7 +199,7 @@ echo '###### recovery to latest from full + ptrack backups with loads when full
init_backup
pgbench_objs 0009
pgbench -p ${TEST_PGPORT} -d pgbench -c 4 -T 8 > /dev/null 2>&1 &
PGBENCH_PID=$!
#PGBENCH_PID=$!
pg_arman backup -B ${BACKUP_PATH} -b full -j 4 -p ${TEST_PGPORT} -d postgres --verbose > ${TEST_BASE}/TEST-0009-run.out 2>&1;echo $?
pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0009-run.out 2>&1
#kill $PGBENCH_PID 2> /dev/null