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

Commitc5c07d8

Browse files
author
Michael Paquier
committed
Fix failure in a couple of regression tests
The method used here is to enforce the archiving of the last segmentavailable to ensure that recovery works up to the point defined bythe tests.
1 parent751519d commitc5c07d8

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

‎expected/restore.out

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,3 @@ NOTICE: pg_stop_backup complete, all required WAL segments have been archived
4848
0
4949
OK: recovery-target-inclusive=false works well.
5050

51-
###### RESTORE COMMAND TEST-0008 ######
52-
###### recovery from page backup after database creation ######
53-
NOTICE: pg_stop_backup complete, all required WAL segments have been archived
54-
0
55-
NOTICE: pg_stop_backup complete, all required WAL segments have been archived
56-
0
57-
0
58-

‎sql/restore.sh

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ pgbench -p ${TEST_PGPORT} pgbench > /dev/null 2>&1
125125
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0006-before.out
126126
TARGET_XID=`psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -tAq -c"INSERT INTO tbl0006 VALUES ('inserted') RETURNING (xmin);"`
127127
pgbench -p${TEST_PGPORT} -d pgbench> /dev/null2>&1
128-
pg_ctl stop -m immediate> /dev/null2>&1
128+
# Enforce segment to be archived to ensure that recovery goes well.
129+
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c'SELECT pg_switch_xlog()'> /dev/null2>&1
130+
pg_ctl stop -m fast> /dev/null2>&1
129131
pg_arman restore -B${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --quiet;echo$?
130132
pg_ctl start -w -t 600> /dev/null2>&1
131133
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0006-after.out
@@ -149,7 +151,8 @@ pgbench -p ${TEST_PGPORT} pgbench > /dev/null 2>&1
149151
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0007-before.out
150152
TARGET_XID=`psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -tAq -c"INSERT INTO tbl0007 VALUES ('inserted') RETURNING (xmin);"`
151153
pgbench -p${TEST_PGPORT} -d pgbench> /dev/null2>&1
152-
pg_ctl stop -m immediate> /dev/null2>&1
154+
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c'SELECT pg_switch_xlog()'> /dev/null2>&1
155+
pg_ctl stop -m fast> /dev/null2>&1
153156
pg_arman restore -B${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --recovery-target-inclusive=false --quiet;echo$?
154157
pg_ctl start -w -t 600> /dev/null2>&1
155158
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0007-after.out
@@ -162,26 +165,6 @@ else
162165
fi
163166
echo''
164167

165-
echo'###### RESTORE COMMAND TEST-0008 ######'
166-
echo'###### recovery from page backup after database creation ######'
167-
init_backup
168-
pgbench_objs 0008
169-
pg_ctl start -w -t 600> /dev/null2>&1
170-
pg_arman backup -B${BACKUP_PATH} -b full -Z -p${TEST_PGPORT} -d postgres --quiet;echo$?
171-
pg_arman validate -B${BACKUP_PATH} --quiet
172-
createdb db0008 -p${TEST_PGPORT}
173-
pgbench -i -s$SCALE -d db0008 -p${TEST_PGPORT}>${TEST_BASE}/TEST-0008-db0008-init.out2>&1
174-
pg_arman backup -B${BACKUP_PATH} -b page -Z -p${TEST_PGPORT} -d postgres --quiet;echo$?
175-
pg_arman validate -B${BACKUP_PATH} --quiet
176-
pgbench -p${TEST_PGPORT} -d db0008>>${TEST_BASE}/TEST-0008-db0008-init.out2>&1
177-
psql --no-psqlrc -p${TEST_PGPORT} -d db0008 -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0008-before.out
178-
pg_ctl stop -m immediate> /dev/null2>&1
179-
pg_arman restore -B${BACKUP_PATH} --quiet;echo$?
180-
pg_ctl start -w -t 600> /dev/null2>&1
181-
psql --no-psqlrc -p${TEST_PGPORT} -d db0008 -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0008-after.out
182-
diff${TEST_BASE}/TEST-0008-before.out${TEST_BASE}/TEST-0008-after.out
183-
echo''
184-
185168
# clean up the temporal test data
186169
pg_ctl stop -m immediate> /dev/null2>&1
187170
rm -fr${PGDATA_PATH}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp