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

Commit84d7ec5

Browse files
author
Michael Paquier
committed
Add comment telling why enforced pg_switch_xlog() is needed
Without that, there is no way to be sure that the segments neededup to the target recovery will be here.
1 parent9f1424b commit84d7ec5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎sql/restore.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ 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-
# 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.
129131
psql --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.
130133
pg_ctl stop -m fast> /dev/null2>&1
131134
pg_arman restore -B${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --quiet;echo$?
132135
pg_ctl start -w -t 600> /dev/null2>&1
@@ -151,7 +154,11 @@ pgbench -p ${TEST_PGPORT} pgbench > /dev/null 2>&1
151154
psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -c"SELECT * FROM pgbench_branches;">${TEST_BASE}/TEST-0007-before.out
152155
TARGET_XID=`psql --no-psqlrc -p${TEST_PGPORT} -d pgbench -tAq -c"INSERT INTO tbl0007 VALUES ('inserted') RETURNING (xmin);"`
153156
pgbench -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.
154160
psql --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.
155162
pg_ctl stop -m fast> /dev/null2>&1
156163
pg_arman restore -B${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --recovery-target-inclusive=false --quiet;echo$?
157164
pg_ctl start -w -t 600> /dev/null2>&1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp