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

Commitba28354

Browse files
committed
Merge branch 'master' into release_2_5
2 parents07127b8 +8846e19 commitba28354

File tree

17 files changed

+143
-82
lines changed

17 files changed

+143
-82
lines changed

‎.travis.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ notifications:
2626

2727
# Default MODE is basic, i.e. all tests with PG_PROBACKUP_TEST_BASIC=ON
2828
env:
29+
-PG_VERSION=14 PG_BRANCH=REL_14_STABLE
2930
-PG_VERSION=13 PG_BRANCH=REL_13_STABLE
3031
-PG_VERSION=12 PG_BRANCH=REL_12_STABLE
3132
-PG_VERSION=11 PG_BRANCH=REL_11_STABLE
@@ -42,9 +43,11 @@ env:
4243
# - PG_VERSION=12 PG_BRANCH=REL_12_STABLE MODE=replica
4344
# - PG_VERSION=12 PG_BRANCH=REL_12_STABLE MODE=retention
4445
# - PG_VERSION=12 PG_BRANCH=REL_12_STABLE MODE=restore
46+
-PG_VERSION=15 PG_BRANCH=master
4547

46-
#jobs:
47-
# allow_failures:
48+
jobs:
49+
allow_failures:
50+
-if:env(PG_BRANCH) = master
4851
# - if: env(MODE) IN (archive, backup, delta, locking, merge, replica, retention, restore)
4952

5053
# Only run CI for master branch commits to limit our travis usage

‎src/stream.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ StreamLog(void *arg)
184184
#endif
185185

186186

187-
#ifPG_VERSION_NUM >=110000
187+
#ifPG_VERSION_NUM >=150000
188+
/* Create temp repslot */
189+
if (temp_slot)
190+
CreateReplicationSlot(stream_arg->conn,replication_slot,
191+
NULL,temp_slot, true, true, false, false);
192+
#elifPG_VERSION_NUM >=110000
188193
/* Create temp repslot */
189194
if (temp_slot)
190195
CreateReplicationSlot(stream_arg->conn,replication_slot,

‎tests/Readme.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ Specify path to pg_probackup binary file. By default tests use <Path to Git repo
3030
Remote backup depends on key authentication to local machine via ssh as current user.
3131
export PGPROBACKUP_SSH_REMOTE=ON
3232
33+
Run tests that are relied on advanced debugging features. For this mode, pg_probackup should be compiled without optimizations. For example:
34+
CFLAGS="-O0" ./configure --prefix=/path/to/prefix --enable-debug --enable-cassert --enable-depend --enable-tap-tests
35+
36+
export PGPROBACKUP_GDB=ON
37+
3338
Run suit of basic simple tests:
3439
export PG_PROBACKUP_TEST_BASIC=ON
3540

‎tests/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def load_tests(loader, tests, pattern):
2525
suite.addTests(loader.loadTestsFromModule(archive))
2626
suite.addTests(loader.loadTestsFromModule(backup))
2727
suite.addTests(loader.loadTestsFromModule(catchup))
28-
suite.addTests(loader.loadTestsFromModule(compatibility))
28+
if'PGPROBACKUPBIN_OLD'inos.environandos.environ['PGPROBACKUPBIN_OLD']:
29+
suite.addTests(loader.loadTestsFromModule(compatibility))
2930
suite.addTests(loader.loadTestsFromModule(checkdb))
3031
suite.addTests(loader.loadTestsFromModule(config))
3132
# suite.addTests(loader.loadTestsFromModule(cfs_backup))

‎tests/archive.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,8 @@ def test_archive_catalog_1(self):
15571557
double segment - compressed and not
15581558
"""
15591559
ifnotself.archive_compress:
1560-
returnself.fail(
1561-
'You need to enable ARCHIVE_COMPRESSIONfor this test to run')
1560+
self.skipTest('You need to enable ARCHIVE_COMPRESSION '
1561+
'for this test to run')
15621562

15631563
fname=self.id().split('.')[3]
15641564
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
@@ -1612,8 +1612,8 @@ def test_archive_catalog_2(self):
16121612
double segment - compressed and not
16131613
"""
16141614
ifnotself.archive_compress:
1615-
returnself.fail(
1616-
'You need to enable ARCHIVE_COMPRESSIONfor this test to run')
1615+
self.skipTest('You need to enable ARCHIVE_COMPRESSION '
1616+
'for this test to run')
16171617

16181618
fname=self.id().split('.')[3]
16191619
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
@@ -1669,6 +1669,9 @@ def test_archive_options(self):
16691669
check that '--archive-host', '--archive-user', '--archiver-port'
16701670
and '--restore-command' are working as expected.
16711671
"""
1672+
ifnotself.remote:
1673+
self.skipTest("You must enable PGPROBACKUP_SSH_REMOTE"
1674+
" for run this test")
16721675
fname=self.id().split('.')[3]
16731676
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
16741677
node=self.make_simple_node(

‎tests/backup.py‎

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,45 +2350,47 @@ def test_backup_with_less_privileges_role(self):
23502350

23512351
replica.slow_start(replica=True)
23522352

2353+
# Archive backups from replica in this test are disabled,
2354+
# because WAL archiving on replica in idle DB in PostgreSQL is broken:
2355+
# replica will not archive the previous WAL until it receives new records in the next WAL file,
2356+
# this "lazy" archiving can be seen in src/backend/replication/walreceiver.c:XLogWalRcvWrite()
2357+
# (see !XLByteInSeg checking and XLogArchiveNotify() calling).
2358+
#
23532359
# self.switch_wal_segment(node)
2354-
# self.switch_wal_segment(node)
2355-
2356-
self.backup_node(
2357-
backup_dir,'replica',replica,
2358-
datname='backupdb',options=['-U','backup'])
2360+
#self.backup_node(
2361+
# backup_dir, 'replica', replica,
2362+
# datname='backupdb', options=['-U', 'backup'])
23592363

23602364
# stream full backup from replica
23612365
self.backup_node(
23622366
backup_dir,'replica',replica,
23632367
datname='backupdb',options=['--stream','-U','backup'])
23642368

2365-
# self.switch_wal_segment(node)
2366-
23672369
# PAGE backup from replica
2368-
self.switch_wal_segment(node)
2369-
self.backup_node(
2370-
backup_dir,'replica',replica,backup_type='page',
2371-
datname='backupdb',options=['-U','backup','--archive-timeout=30s'])
2370+
#self.switch_wal_segment(node)
2371+
#self.backup_node(
2372+
# backup_dir, 'replica', replica, backup_type='page',
2373+
# datname='backupdb', options=['-U', 'backup', '--archive-timeout=30s'])
23722374

23732375
self.backup_node(
23742376
backup_dir,'replica',replica,backup_type='page',
23752377
datname='backupdb',options=['--stream','-U','backup'])
23762378

23772379
# DELTA backup from replica
2378-
self.switch_wal_segment(node)
2379-
self.backup_node(
2380-
backup_dir,'replica',replica,backup_type='delta',
2381-
datname='backupdb',options=['-U','backup'])
2380+
#self.switch_wal_segment(node)
2381+
#self.backup_node(
2382+
# backup_dir, 'replica', replica, backup_type='delta',
2383+
# datname='backupdb', options=['-U', 'backup'])
23822384
self.backup_node(
23832385
backup_dir,'replica',replica,backup_type='delta',
23842386
datname='backupdb',options=['--stream','-U','backup'])
23852387

23862388
# PTRACK backup from replica
23872389
ifself.ptrack:
2388-
self.switch_wal_segment(node)
2389-
self.backup_node(
2390-
backup_dir,'replica',replica,backup_type='ptrack',
2391-
datname='backupdb',options=['-U','backup'])
2390+
#self.switch_wal_segment(node)
2391+
#self.backup_node(
2392+
# backup_dir, 'replica', replica, backup_type='ptrack',
2393+
# datname='backupdb', options=['-U', 'backup'])
23922394
self.backup_node(
23932395
backup_dir,'replica',replica,backup_type='ptrack',
23942396
datname='backupdb',options=['--stream','-U','backup'])

‎tests/checkdb.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,11 @@ def test_checkdb_block_validation_sanity(self):
450450
# @unittest.skip("skip")
451451
deftest_checkdb_sigint_handling(self):
452452
""""""
453+
ifnotself.gdb:
454+
self.skipTest(
455+
"Specify PGPROBACKUP_GDB and build without "
456+
"optimizations for run this test"
457+
)
453458
fname=self.id().split('.')[3]
454459
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
455460
node=self.make_simple_node(

‎tests/delta.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ def test_delta_vacuum_full(self):
472472
make node, make full and delta stream backups,
473473
restore them and check data correctness
474474
"""
475+
ifnotself.gdb:
476+
self.skipTest(
477+
"Specify PGPROBACKUP_GDB and build without "
478+
"optimizations for run this test"
479+
)
475480
fname=self.id().split('.')[3]
476481
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
477482
node=self.make_simple_node(
@@ -508,7 +513,7 @@ def test_delta_vacuum_full(self):
508513
process.start()
509514

510515
whilenotgdb.stopped_in_breakpoint:
511-
sleep(1)
516+
time.sleep(1)
512517

513518
gdb.continue_execution_until_break(20)
514519

‎tests/external.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ def test_external_backward_compatibility(self):
373373
restore delta backup, check that incremental chain
374374
restored correctly
375375
"""
376+
ifnotself.probackup_old_path:
377+
self.skipTest("You must specify PGPROBACKUPBIN_OLD"
378+
" for run this test")
376379
fname=self.id().split('.')[3]
377380
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
378381
node=self.make_simple_node(
@@ -474,6 +477,9 @@ def test_external_backward_compatibility_merge_1(self):
474477
take delta backup with new binary and 2 external directories
475478
merge delta backup ajd restore it
476479
"""
480+
ifnotself.probackup_old_path:
481+
self.skipTest("You must specify PGPROBACKUPBIN_OLD"
482+
" for run this test")
477483
fname=self.id().split('.')[3]
478484
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
479485
node=self.make_simple_node(
@@ -566,6 +572,9 @@ def test_external_backward_compatibility_merge_2(self):
566572
take delta backup with new binary and 2 external directories
567573
merge delta backup and restore it
568574
"""
575+
ifnotself.probackup_old_path:
576+
self.skipTest("You must specify PGPROBACKUPBIN_OLD"
577+
" for run this test")
569578
fname=self.id().split('.')[3]
570579
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
571580
node=self.make_simple_node(
@@ -687,6 +696,9 @@ def test_external_backward_compatibility_merge_2(self):
687696
# @unittest.skip("skip")
688697
deftest_external_merge(self):
689698
""""""
699+
ifnotself.probackup_old_path:
700+
self.skipTest("You must specify PGPROBACKUPBIN_OLD"
701+
" for run this test")
690702
fname=self.id().split('.')[3]
691703
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
692704
node=self.make_simple_node(

‎tests/helpers/ptrack_helpers.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ def __init__(self, *args, **kwargs):
184184
self.test_env['LC_MESSAGES']='C'
185185
self.test_env['LC_TIME']='C'
186186

187-
self.paranoia=False
188-
if'PG_PROBACKUP_PARANOIA'inself.test_env:
189-
ifself.test_env['PG_PROBACKUP_PARANOIA']=='ON':
190-
self.paranoia=True
191-
192-
self.archive_compress=False
193-
if'ARCHIVE_COMPRESSION'inself.test_env:
194-
ifself.test_env['ARCHIVE_COMPRESSION']=='ON':
195-
self.archive_compress=True
187+
self.gdb='PGPROBACKUP_GDB'inos.environand \
188+
os.environ['PGPROBACKUP_GDB']=='ON'
189+
190+
self.paranoia='PG_PROBACKUP_PARANOIA'inself.test_envand \
191+
self.test_env['PG_PROBACKUP_PARANOIA']=='ON'
192+
193+
self.archive_compress='ARCHIVE_COMPRESSION'inself.test_envand \
194+
self.test_env['ARCHIVE_COMPRESSION']=='ON'
195+
196196
try:
197197
testgres.configure_testgres(
198198
cache_initdb=False,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp