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

Commit9762426

Browse files
author
Sergey Fukanchik
committed
PBCKP-732 ignore PGDATA setting in catchup mode as we use --source-pgdata instead
1 parenta29e378 commit9762426

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

‎src/pg_probackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ main(int argc, char *argv[])
682682
if (instance_config.pgdata!=NULL)
683683
canonicalize_path(instance_config.pgdata);
684684
if (instance_config.pgdata!=NULL&&
685-
backup_subcmd!=ARCHIVE_GET_CMD&&
685+
(backup_subcmd!=ARCHIVE_GET_CMD&&backup_subcmd!=CATCHUP_CMD)&&
686686
!is_absolute_path(instance_config.pgdata))
687687
elog(ERROR,"-D, --pgdata must be an absolute path");
688688

‎tests/catchup_test.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,3 +1585,42 @@ def test_dry_run_catchup_delta(self):
15851585

15861586
# Cleanup
15871587
src_pg.stop()
1588+
1589+
deftest_pgdata_is_ignored(self):
1590+
""" In catchup we still allow PGDATA to be set either from command line
1591+
or from the env var. This test that PGDATA is actually ignored and
1592+
--source-pgadta is used instead
1593+
"""
1594+
node=self.make_simple_node('node',
1595+
set_replication=True
1596+
)
1597+
node.slow_start()
1598+
1599+
# do full catchup
1600+
dest=self.make_empty_node('dst')
1601+
self.catchup_node(
1602+
backup_mode='FULL',
1603+
source_pgdata=node.data_dir,
1604+
destination_node=dest,
1605+
options= ['-d','postgres','-p',str(node.port),'--stream','--pgdata=xxx']
1606+
)
1607+
1608+
self.compare_pgdata(
1609+
self.pgdata_content(node.data_dir),
1610+
self.pgdata_content(dest.data_dir)
1611+
)
1612+
1613+
os.environ['PGDATA']='xxx'
1614+
1615+
dest2=self.make_empty_node('dst')
1616+
self.catchup_node(
1617+
backup_mode='FULL',
1618+
source_pgdata=node.data_dir,
1619+
destination_node=dest2,
1620+
options= ['-d','postgres','-p',str(node.port),'--stream']
1621+
)
1622+
1623+
self.compare_pgdata(
1624+
self.pgdata_content(node.data_dir),
1625+
self.pgdata_content(dest2.data_dir)
1626+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp