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

Commit697a451

Browse files
committed
Merge branch 'master' into pgpro-2573
2 parentsc230189 +f0de44e commit697a451

File tree

4 files changed

+66
-9
lines changed

4 files changed

+66
-9
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ As compared to other backup solutions, `pg_probackup` offers the following benef
1010
* Implementing a single backup strategy for multi-server PostgreSQL clusters
1111
* Automatic data consistency checks and on-demand backup validation without actual data recovery
1212
* Managing backups in accordance with retention policy
13-
* Running backup, restore, and validation processes on multiple parallel threads
13+
* Merging incremental into full backups without actual data recovery
14+
* Running backup, restore, merge and validation processes on multiple parallel threads
1415
* Storing backup data in a compressed state to save disk space
1516
* Taking backups from a standby server to avoid extra load on the master server
1617
* Extended logging settings

‎src/help.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ help_pg_probackup(void)
122122
printf(_(" [--external-dirs=external-directory-path]\n"));
123123

124124
printf(_("\n %s restore -B backup-path --instance=instance_name\n"),PROGRAM_NAME);
125-
printf(_(" [-D pgdata-path] [-i backup-id] [--progress]\n"));
125+
printf(_(" [-D pgdata-path] [-i backup-id] [-j num-threads]\n"));
126126
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
127-
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
127+
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR] [--progress]\n"));
128128
printf(_(" [--external-mapping=OLDDIR=NEWDIR]\n"));
129129
printf(_(" [--immediate] [--recovery-target-name=target-name]\n"));
130130
printf(_(" [--recovery-target-action=pause|promote|shutdown]\n"));
@@ -147,8 +147,9 @@ help_pg_probackup(void)
147147
printf(_("\n %s delete -B backup-path --instance=instance_name\n"),PROGRAM_NAME);
148148
printf(_(" [--wal] [-i backup-id | --expired | --merge-expired]\n"));
149149
printf(_(" [--dry-run]\n"));
150+
150151
printf(_("\n %s merge -B backup-path --instance=instance_name\n"),PROGRAM_NAME);
151-
printf(_(" -i backup-id\n"));
152+
printf(_(" -i backup-id [--progress] [-j num-threads]\n"));
152153

153154
printf(_("\n %s add-instance -B backup-path -D pgdata-path\n"),PROGRAM_NAME);
154155
printf(_(" --instance=instance_name\n"));
@@ -228,7 +229,7 @@ help_backup(void)
228229
printf(_(" --skip-block-validation set to validate only file-level checksum\n"));
229230
printf(_(" -E --external-dirs=external-directory-path\n"));
230231
printf(_(" backup some directories not from pgdata \n"));
231-
printf(_("(example: --external-dirs=/tmp/dirA:/tmp/dirB)\n"));
232+
printf(_(" (example: --external-dirs=/tmp/dir1:/tmp/dir2)\n"));
232233

233234
printf(_("\n Logging options:\n"));
234235
printf(_(" --log-level-console=log-level-console\n"));
@@ -290,7 +291,7 @@ static void
290291
help_restore(void)
291292
{
292293
printf(_("%s restore -B backup-path --instance=instance_name\n"),PROGRAM_NAME);
293-
printf(_(" [-D pgdata-path] [-i backup-id] [--progress]\n"));
294+
printf(_(" [-D pgdata-path] [-i backup-id] [-j num-threads] [--progress]\n"));
294295
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
295296
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
296297
printf(_(" [--external-mapping=OLDDIR=NEWDIR]\n"));
@@ -305,6 +306,7 @@ help_restore(void)
305306

306307
printf(_(" -D, --pgdata=pgdata-path location of the database storage area\n"));
307308
printf(_(" -i, --backup-id=backup-id backup to restore\n"));
309+
printf(_(" -j, --threads=NUM number of parallel threads\n"));
308310

309311
printf(_(" --progress show progress\n"));
310312
printf(_(" --time=time time stamp up to which recovery will proceed\n"));
@@ -519,7 +521,7 @@ help_set_config(void)
519521
printf(_(" --instance=instance_name name of the instance\n"));
520522
printf(_(" -E --external-dirs=external-directory-path\n"));
521523
printf(_(" backup some directories not from pgdata \n"));
522-
printf(_("(example: --external-dirs=/tmp/dirA:/tmp/dirB)\n"));
524+
printf(_(" (example: --external-dirs=/tmp/dir1:/tmp/dir2)\n"));
523525

524526
printf(_("\n Logging options:\n"));
525527
printf(_(" --log-level-console=log-level-console\n"));
@@ -595,7 +597,7 @@ help_add_instance(void)
595597
printf(_(" --instance=instance_name name of the new instance\n"));
596598
printf(_(" -E --external-dirs=external-directory-path\n"));
597599
printf(_(" backup some directories not from pgdata \n"));
598-
printf(_("(example: --external-dirs=/tmp/dirA:/tmp/dirB)\n"));
600+
printf(_(" (example: --external-dirs=/tmp/dir1:/tmp/dir2)\n"));
599601
}
600602

601603
staticvoid

‎tests/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
retention,pgpro560,pgpro589,pgpro2068,false_positive,replica, \
66
compression,page,ptrack,archive,exclude,cfs_backup,cfs_restore, \
77
cfs_validate_backup,auth_test,time_stamp,snapfs,logging, \
8-
locking,remote,external
8+
locking,remote,external,config
99

1010

1111
defload_tests(loader,tests,pattern):
@@ -14,6 +14,7 @@ def load_tests(loader, tests, pattern):
1414
suite.addTests(loader.loadTestsFromModule(archive))
1515
suite.addTests(loader.loadTestsFromModule(backup_test))
1616
suite.addTests(loader.loadTestsFromModule(compatibility))
17+
suite.addTests(loader.loadTestsFromModule(config))
1718
# suite.addTests(loader.loadTestsFromModule(cfs_backup))
1819
# suite.addTests(loader.loadTestsFromModule(cfs_restore))
1920
# suite.addTests(loader.loadTestsFromModule(cfs_validate_backup))

‎tests/config.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
importunittest
2+
importsubprocess
3+
importos
4+
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
5+
fromsysimportexit
6+
7+
module_name='config'
8+
9+
10+
classConfigTest(ProbackupTest,unittest.TestCase):
11+
12+
# @unittest.expectedFailure
13+
# @unittest.skip("skip")
14+
deftest_remove_instance_config(self):
15+
"""remove pg_probackup.conf"""
16+
fname=self.id().split('.')[3]
17+
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
18+
node=self.make_simple_node(
19+
base_dir=os.path.join(module_name,fname,'node'),
20+
set_replication=True,
21+
initdb_params=['--data-checksums'])
22+
23+
self.init_pb(backup_dir)
24+
self.add_instance(backup_dir,'node',node)
25+
self.show_pb(backup_dir)
26+
self.set_archiving(backup_dir,'node',node)
27+
node.slow_start()
28+
29+
self.backup_node(backup_dir,'node',node)
30+
31+
self.backup_node(
32+
backup_dir,'node',node,backup_type='page')
33+
34+
conf_file=os.path.join(
35+
backup_dir,'backups','node','pg_probackup.conf')
36+
37+
os.unlink(os.path.join(backup_dir,'backups','node','pg_probackup.conf'))
38+
39+
try:
40+
self.backup_node(
41+
backup_dir,'node',node,backup_type='page')
42+
self.assertEqual(
43+
1,0,
44+
"Expecting Error because pg_probackup.conf is missing. "
45+
".\n Output: {0}\n CMD: {1}".format(
46+
repr(self.output),self.cmd))
47+
exceptProbackupExceptionase:
48+
self.assertIn(
49+
'ERROR: could not open file "{0}": '
50+
'No such file or directory'.format(conf_file),
51+
e.message,
52+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
53+
repr(e.message),self.cmd))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp