Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit075c37b

Browse files
committed
Fix backup if we do full backup.
1 parente3b0f44 commit075c37b

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

‎backup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
129129
"or validate existing one.");
130130
}
131131

132+
if (current.backup_mode!=BACKUP_MODE_DIFF_PTRACK)
133+
pg_ptrack_clear();
134+
132135
/* notify start of backup to PostgreSQL server */
133136
time2iso(label,lengthof(label),current.start_time);
134137
strncat(label," with pg_arman",lengthof(label));
@@ -148,8 +151,6 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
148151
elog(ERROR,"backup_label does not exist in PGDATA.");
149152
}
150153

151-
if (current.backup_mode!=BACKUP_MODE_DIFF_PTRACK)
152-
pg_ptrack_clear();
153154
/*
154155
* List directories and symbolic links with the physical path to make
155156
* mkdirs.sh, then sort them in order of path. Omit $PGDATA.

‎expected/restore.out

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,25 @@ OK: recovery-target-xid options works well.
3232
###### RESTORE COMMAND TEST-0006 ######
3333
###### recovery to latest from full + ptrack backups ######
3434
0
35-
0
35+
1
3636
0
3737

3838
###### RESTORE COMMAND TEST-0007 ######
3939
###### recovery to latest from full + ptrack + ptrack backups ######
4040
0
41+
1
42+
1
4143
0
44+
45+
###### RESTORE COMMAND TEST-0010 ######
46+
###### recovery to latest from full + page backups with loads when full backup do ######
4247
0
48+
1
4349
0
4450

4551
###### RESTORE COMMAND TEST-0009 ######
4652
###### recovery to latest from full + ptrack backups with loads when full backup do ######
4753
0
48-
0
54+
1
4955
0
5056

51-
###### RESTORE COMMAND TEST-0008 ######
52-
###### recovery with target inclusive false ######
53-
0
54-
0
55-
OK: recovery-target-inclusive=false works well.

‎sql/restore.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,15 @@ echo ''
172172

173173

174174
echo'###### RESTORE COMMAND TEST-0010 ######'
175-
echo'###### recovery to latest from full + page backups with loads whenfull backup do ######'
175+
echo'###### recovery to latest from full + page backups with loads whenptrack backup do ######'
176176
init_backup
177-
pgbench_objs 0009
178-
pgbench -p${TEST_PGPORT} -d pgbench -c 4 -T 8> /dev/null2>&1&
179-
PGBENCH_PID=$!
177+
pgbench_objs 0010
180178
pg_arman backup -B${BACKUP_PATH} -b full -j 4 -p${TEST_PGPORT} -d postgres --verbose>${TEST_BASE}/TEST-0010-run.out2>&1;echo$?
181179
pg_arman validate -B${BACKUP_PATH} --verbose>>${TEST_BASE}/TEST-0010-run.out2>&1
182-
#kill $PGBENCH_PID 2> /dev/null
183-
sleep 12
184-
#psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT count(*) FROM pgbench_history;" > ${TEST_BASE}/TEST-0010-count1.out
185-
pg_arman backup -B${BACKUP_PATH} -b page -j 4 -p${TEST_PGPORT} -d postgres --verbose>>${TEST_BASE}/TEST-0010-run.out2>&1;echo$?
180+
pgbench -p${TEST_PGPORT} -d pgbench -c 4 -T 8> /dev/null2>&1&
181+
pg_arman backup -B${BACKUP_PATH} -b ptrack -j 4 -p${TEST_PGPORT} -d postgres --verbose>>${TEST_BASE}/TEST-0010-run.out2>&1;echo$?
186182
pg_arman validate -B${BACKUP_PATH} --verbose>>${TEST_BASE}/TEST-0010-run.out2>&1
183+
sleep 12
187184
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT sum(bbalance) FROM pgbench_branches;">${TEST_BASE}/TEST-0010-count1.out
188185
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT sum(delta) FROM pgbench_history;">${TEST_BASE}/TEST-0010-count2.out
189186
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
193190
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT sum(bbalance) FROM pgbench_branches;">${TEST_BASE}/TEST-0010-count1.out
194191
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT sum(delta) FROM pgbench_history;">${TEST_BASE}/TEST-0010-count2.out
195192
diff${TEST_BASE}/TEST-0010-count1.out${TEST_BASE}/TEST-0010-count2.out
193+
196194
echo''
197195

198196

@@ -201,7 +199,7 @@ echo '###### recovery to latest from full + ptrack backups with loads when full
201199
init_backup
202200
pgbench_objs 0009
203201
pgbench -p${TEST_PGPORT} -d pgbench -c 4 -T 8> /dev/null2>&1&
204-
PGBENCH_PID=$!
202+
#PGBENCH_PID=$!
205203
pg_arman backup -B${BACKUP_PATH} -b full -j 4 -p${TEST_PGPORT} -d postgres --verbose>${TEST_BASE}/TEST-0009-run.out2>&1;echo$?
206204
pg_arman validate -B${BACKUP_PATH} --verbose>>${TEST_BASE}/TEST-0009-run.out2>&1
207205
#kill $PGBENCH_PID 2> /dev/null

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp