Skip to content

Commit 054226d

Browse files
committed
Remove recovery-target- substring from restore option.
1 parent 0f16f1f commit 054226d

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

doc/pg_arman.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ the file manually.
9595
It is recommended to take a full backup as soon as possible after recovery
9696
has succeeded.
9797

98-
If "--recovery-target-timeline" is not specifed, the last checkpoint's
98+
If "--timeline" is not specifed, the last checkpoint's
9999
TimeLineID in control file ($PGDATA/global/pg_control) will be the restore
100100
target. If pg_control is not present, TimeLineID in the full backup used by
101101
the restore will be a restore target.
@@ -184,7 +184,7 @@ STATUS=OK
184184
```
185185

186186
You can check the "RECOVERY_XID" and "RECOVERY_TIME" which are used for
187-
restore option "--recovery-target-xid", "--recovery-target-time".
187+
restore option "--xid", "--time".
188188

189189
The delete command deletes backup files not required by recovery after
190190
the specified ID. This command also cleans up in the WAL archive the
@@ -250,19 +250,19 @@ absolute paths; relative paths are not allowed.
250250
The parameters whose name start are started with --recovery refer to
251251
the same parameters as the ones in recovery.confin recovery.conf.
252252

253-
**--recovery-target-timeline**=_TIMELINE_:
253+
**--timeline**=_TIMELINE_:
254254
Specifies recovering into a particular timeline. If not specified,
255255
the current timeline is used.
256256

257-
**--recovery-target-time**=TIMESTAMP:
257+
**--time**=TIMESTAMP:
258258
This parameter specifies the timestamp up to which recovery will
259259
proceed.
260260

261-
**--recovery-target-xid**=XID:
261+
**--xid**=XID:
262262
This parameter specifies the transaction ID up to which recovery
263263
will proceed.
264264

265-
**--recovery-target-inclusive**:
265+
**--inclusive**:
266266
Specifies whether server pauses when recovery target is reached.
267267

268268
**-j**=NUMBER / **--threads**=NUMBER:
@@ -348,10 +348,10 @@ Short Long Env File
348348
--validate VALIDATE Yes
349349
--keep-data-generations KEEP_DATA_GENERATIONS Yes
350350
--keep-data-days KEEP_DATA_DAYS Yes
351-
--recovery-target-timeline RECOVERY_TARGET_TIMELINE Yes
352-
--recovery-target-xid RECOVERY_TARGET_XID Yes
353-
--recovery-target-time RECOVERY_TARGET_TIME Yes
354-
--recovery-target-inclusive RECOVERY_TARGET_INCLUSIVE Yes
351+
--timeline RECOVERY_TARGET_TIMELINE Yes
352+
--xid RECOVERY_TARGET_XID Yes
353+
--time RECOVERY_TARGET_TIME Yes
354+
--inclusive RECOVERY_TARGET_INCLUSIVE Yes
355355
```
356356

357357
Variable names in configuration file are the same as long names or names

expected/option.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Backup options:
2626
-S, --slot=SLOTNAME replication slot to use
2727

2828
Restore options:
29-
--recovery-target-time time stamp up to which recovery will proceed
30-
--recovery-target-xid transaction ID up to which recovery will proceed
31-
--recovery-target-inclusive whether we stop just after the recovery target
32-
--recovery-target-timeline recovering into a particular timeline
29+
--time time stamp up to which recovery will proceed
30+
--xid transaction ID up to which recovery will proceed
31+
--inclusive whether we stop just after the recovery target
32+
--timeline recovering into a particular timeline
3333

3434
Catalog options:
3535
-a, --show-all show deleted backup too

expected/restore.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OK: recovery.conf has the given target timeline.
2727
###### recovery to target XID ######
2828
0
2929
0
30-
OK: recovery-target-xid options works well.
30+
OK: xid options works well.
3131

3232
###### RESTORE COMMAND TEST-0006 ######
3333
###### recovery to latest from full + ptrack backups ######
@@ -64,4 +64,4 @@ OK: recovery-target-xid options works well.
6464
###### recovery with target inclusive false ######
6565
0
6666
0
67-
OK: recovery-target-inclusive=false works well.
67+
OK: inclusive=false works well.

pg_arman.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ static pgut_option options[] =
7171
/* { 'i', 1, "keep-data-generations", &keep_data_generations, SOURCE_ENV },
7272
{ 'i', 2, "keep-data-days", &keep_data_days, SOURCE_ENV },*/
7373
/* restore options */
74-
{ 's', 3, "recovery-target-time", &target_time, SOURCE_ENV },
75-
{ 's', 4, "recovery-target-xid", &target_xid, SOURCE_ENV },
76-
{ 's', 5, "recovery-target-inclusive", &target_inclusive, SOURCE_ENV },
77-
{ 'u', 6, "recovery-target-timeline", &target_tli, SOURCE_ENV },
74+
{ 's', 3, "time", &target_time, SOURCE_ENV },
75+
{ 's', 4, "xid", &target_xid, SOURCE_ENV },
76+
{ 's', 5, "inclusive", &target_inclusive, SOURCE_ENV },
77+
{ 'u', 6, "timeline", &target_tli, SOURCE_ENV },
7878
/* catalog options */
7979
{ 'b', 'a', "show-all", &show_all },
8080
/* delete options */
@@ -249,10 +249,10 @@ pgut_help(bool details)
249249
printf(_(" --backup-pg-log start backup pg_log directory\n"));
250250
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
251251
printf(_("\nRestore options:\n"));
252-
printf(_(" --recovery-target-time time stamp up to which recovery will proceed\n"));
253-
printf(_(" --recovery-target-xid transaction ID up to which recovery will proceed\n"));
254-
printf(_(" --recovery-target-inclusive whether we stop just after the recovery target\n"));
255-
printf(_(" --recovery-target-timeline recovering into a particular timeline\n"));
252+
printf(_(" --time time stamp up to which recovery will proceed\n"));
253+
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
254+
printf(_(" --inclusive whether we stop just after the recovery target\n"));
255+
printf(_(" --timeline recovering into a particular timeline\n"));
256256
printf(_("\nCatalog options:\n"));
257257
printf(_(" -a, --show-all show deleted backup too\n"));
258258
printf(_("\nDelete options:\n"));

sql/restore.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pg_arman restore -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0003-run.out 2
6969
pg_ctl start -w -t 600 > /dev/null 2>&1
7070
pgbench -p ${TEST_PGPORT} -d pgbench > /dev/null 2>&1
7171
pg_ctl stop -m immediate > /dev/null 2>&1
72-
pg_arman restore -B ${BACKUP_PATH} --recovery-target-timeline=${TARGET_TLI} --verbose >> ${TEST_BASE}/TEST-0003-run.out 2>&1;echo $?
72+
pg_arman restore -B ${BACKUP_PATH} --timeline=${TARGET_TLI} --verbose >> ${TEST_BASE}/TEST-0003-run.out 2>&1;echo $?
7373
echo "checking recovery.conf..."
7474
TARGET_TLI_IN_RECOVERY_CONF=`grep "recovery_target_timeline = " ${PGDATA_PATH}/recovery.conf | awk '{print $3}' | sed -e "s/'//g"`
7575
if [ ${TARGET_TLI} = ${TARGET_TLI_IN_RECOVERY_CONF} ]; then
@@ -95,7 +95,7 @@ pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0004-run.out
9595
TARGET_TIME=`date +"%Y-%m-%d %H:%M:%S"`
9696
pgbench -p ${TEST_PGPORT} -d pgbench > /dev/null 2>&1
9797
pg_ctl stop -m immediate > /dev/null 2>&1
98-
pg_arman restore -B ${BACKUP_PATH} --recovery-target-time="${TARGET_TIME}" --verbose >> ${TEST_BASE}/TEST-0004-run.out 2>&1;echo $?
98+
pg_arman restore -B ${BACKUP_PATH} --time="${TARGET_TIME}" --verbose >> ${TEST_BASE}/TEST-0004-run.out 2>&1;echo $?
9999
pg_ctl start -w -t 600 > /dev/null 2>&1
100100
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT * FROM pgbench_branches;" > ${TEST_BASE}/TEST-0004-after.out
101101
diff ${TEST_BASE}/TEST-0004-before.out ${TEST_BASE}/TEST-0004-after.out
@@ -118,15 +118,15 @@ pgbench -p ${TEST_PGPORT} -d pgbench > /dev/null 2>&1
118118
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c 'SELECT pg_switch_xlog()' > /dev/null 2>&1
119119
# Fast mode is used to ensure that the last segment is archived as well.
120120
pg_ctl stop -m fast > /dev/null 2>&1
121-
pg_arman restore -B ${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --verbose >> ${TEST_BASE}/TEST-0005-run.out 2>&1;echo $?
121+
pg_arman restore -B ${BACKUP_PATH} --xid="${TARGET_XID}" --verbose >> ${TEST_BASE}/TEST-0005-run.out 2>&1;echo $?
122122
pg_ctl start -w -t 600 > /dev/null 2>&1
123123
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT * FROM pgbench_branches;" > ${TEST_BASE}/TEST-0005-after.out
124124
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT * FROM tbl0005;" > ${TEST_BASE}/TEST-0005-tbl.dump
125125
diff ${TEST_BASE}/TEST-0005-before.out ${TEST_BASE}/TEST-0005-after.out
126126
if grep "inserted" ${TEST_BASE}/TEST-0005-tbl.dump > /dev/null ; then
127-
echo 'OK: recovery-target-xid options works well.'
127+
echo 'OK: xid options works well.'
128128
else
129-
echo 'NG: recovery-target-xid options does not work well.'
129+
echo 'NG: xid options does not work well.'
130130
pg_ctl stop -m immediate -D ${PGDATA_PATH} > /dev/null 2>&1
131131
exit 1
132132
fi
@@ -252,15 +252,15 @@ pgbench -p ${TEST_PGPORT} -d pgbench > /dev/null 2>&1
252252
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c 'SELECT pg_switch_xlog()' > /dev/null 2>&1
253253
# Fast mode is used to ensure that the last segment is archived as well.
254254
pg_ctl stop -m fast > /dev/null 2>&1
255-
pg_arman restore -B ${BACKUP_PATH} --recovery-target-xid="${TARGET_XID}" --recovery-target-inclusive=false --verbose >> ${TEST_BASE}/TEST-0008-run.out 2>&1;echo $?
255+
pg_arman restore -B ${BACKUP_PATH} --xid="${TARGET_XID}" --inclusive=false --verbose >> ${TEST_BASE}/TEST-0008-run.out 2>&1;echo $?
256256
pg_ctl start -w -t 600 > /dev/null 2>&1
257257
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT * FROM pgbench_branches;" > ${TEST_BASE}/TEST-0008-after.out
258258
psql --no-psqlrc -p ${TEST_PGPORT} -d pgbench -c "SELECT * FROM tbl0008;" > ${TEST_BASE}/TEST-0008-tbl.dump
259259
diff ${TEST_BASE}/TEST-0008-before.out ${TEST_BASE}/TEST-0008-after.out
260260
if grep "inserted" ${TEST_BASE}/TEST-0008-tbl.dump > /dev/null ; then
261-
echo 'NG: recovery-target-inclusive=false does not work well.'
261+
echo 'NG: inclusive=false does not work well.'
262262
else
263-
echo 'OK: recovery-target-inclusive=false works well.'
263+
echo 'OK: inclusive=false works well.'
264264
pg_ctl stop -m immediate -D ${PGDATA_PATH} > /dev/null 2>&1
265265
exit 1
266266
fi

0 commit comments

Comments
 (0)