@@ -125,8 +125,11 @@ pgbench -p ${TEST_PGPORT} pgbench > /dev/null 2>&1
125125psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c" SELECT * FROM pgbench_branches;" > ${TEST_BASE} /TEST-0006-before.out
126126TARGET_XID=` psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -tAq -c" INSERT INTO tbl0006 VALUES ('inserted') RETURNING (xmin);" `
127127pgbench -p${TEST_PGPORT} -d pgbench> /dev/null2>&1
128- # Enforce segment to be archived to ensure that recovery goes well.
128+ # Enforce segment to be archived to ensure that recovery goes up to the
129+ # wanted point. There is no way to ensure that all segments needed have
130+ # been archived up to the xmin point saved earlier without that.
129131psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c' SELECT pg_switch_xlog()' > /dev/null2>&1
132+ # Fast mode is used to ensure that the last segment is archived as well.
130133pg_ctl stop -m fast> /dev/null2>&1
131134pg_arman restore -B${BACKUP_PATH} --recovery-target-xid=" ${TARGET_XID} " --quiet; echo $?
132135pg_ctl start -w -t 600> /dev/null2>&1
@@ -151,7 +154,11 @@ pgbench -p ${TEST_PGPORT} pgbench > /dev/null 2>&1
151154psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c" SELECT * FROM pgbench_branches;" > ${TEST_BASE} /TEST-0007-before.out
152155TARGET_XID=` psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -tAq -c" INSERT INTO tbl0007 VALUES ('inserted') RETURNING (xmin);" `
153156pgbench -p${TEST_PGPORT} -d pgbench> /dev/null2>&1
157+ # Enforce segment to be archived to ensure that recovery goes up to the
158+ # wanted point. There is no way to ensure that all segments needed have
159+ # been archived up to the xmin point saved earlier without that.
154160psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c' SELECT pg_switch_xlog()' > /dev/null2>&1
161+ # Fast mode is used to ensure that the last segment is archived as well.
155162pg_ctl stop -m fast> /dev/null2>&1
156163pg_arman restore -B${BACKUP_PATH} --recovery-target-xid=" ${TARGET_XID} " --recovery-target-inclusive=false --quiet; echo $?
157164pg_ctl start -w -t 600> /dev/null2>&1