@@ -1466,21 +1466,16 @@ def test_dry_run_catchup_full(self):
1466
1466
# preparation 1: source
1467
1467
src_pg = self .make_simple_node (
1468
1468
base_dir = os .path .join (module_name , self .fname , 'src' ),
1469
- set_replication = True ,
1470
- pg_options = { 'wal_log_hints' : 'on' }
1469
+ set_replication = True
1471
1470
)
1472
1471
src_pg .slow_start ()
1473
1472
1474
1473
# preparation 2: make clean shutdowned lagging behind replica
1475
1474
dst_pg = self .make_empty_node (os .path .join (module_name , self .fname , 'dst' ))
1476
1475
1477
- src_pg .safe_psql (
1478
- "postgres" ,
1479
- "CREATE TABLE ultimate_question(answer int)" )
1480
1476
src_pg .pgbench_init (scale = 10 )
1481
1477
pgbench = src_pg .pgbench (options = ['-T' , '10' , '--no-vacuum' ])
1482
1478
pgbench .wait ()
1483
- src_pg .safe_psql ("postgres" , "INSERT INTO ultimate_question VALUES(42)" )
1484
1479
1485
1480
# save the condition before dry-run
1486
1481
content_before = self .pgdata_content (dst_pg .data_dir )
@@ -1501,30 +1496,25 @@ def test_dry_run_catchup_full(self):
1501
1496
1502
1497
# Cleanup
1503
1498
src_pg .stop ()
1504
- dst_pg .stop ()
1505
1499
self .del_test_dir (module_name , self .fname )
1506
1500
1507
1501
def test_dry_run_catchup_ptrack (self ):
1508
1502
"""
1509
1503
Test dry-run option for catchup in incremental ptrack mode
1510
1504
"""
1511
- if not self .ptrack :
1512
- return unittest .skip ('Skipped because ptrack support is disabled' )
1513
-
1514
- # preparation 1: source
1505
+ # preparation 1: source
1515
1506
src_pg = self .make_simple_node (
1516
1507
base_dir = os .path .join (module_name , self .fname , 'src' ),
1517
1508
set_replication = True ,
1518
- pg_options = { 'wal_log_hints' : 'on' }
1509
+ ptrack_enable = True ,
1510
+ initdb_params = ['--data-checksums' ]
1519
1511
)
1520
1512
src_pg .slow_start ()
1521
- src_pg .safe_psql (
1522
- "postgres" ,
1523
- "CREATE TABLE ultimate_question(answer int)" )
1513
+ src_pg .safe_psql ("postgres" , "CREATE EXTENSION ptrack" )
1514
+
1524
1515
src_pg .pgbench_init (scale = 10 )
1525
1516
pgbench = src_pg .pgbench (options = ['-T' , '10' , '--no-vacuum' ])
1526
1517
pgbench .wait ()
1527
- src_pg .safe_psql ("postgres" , "INSERT INTO ultimate_question VALUES(42)" )
1528
1518
1529
1519
# preparation 2: make clean shutdowned lagging behind replica
1530
1520
dst_pg = self .make_empty_node (os .path .join (module_name , self .fname , 'dst' ))
@@ -1560,7 +1550,6 @@ def test_dry_run_catchup_ptrack(self):
1560
1550
1561
1551
# Cleanup
1562
1552
src_pg .stop ()
1563
- dst_pg .stop ()
1564
1553
self .del_test_dir (module_name , self .fname )
1565
1554
1566
1555
def test_dry_run_catchup_delta (self ):
@@ -1572,18 +1561,16 @@ def test_dry_run_catchup_delta(self):
1572
1561
src_pg = self .make_simple_node (
1573
1562
base_dir = os .path .join (module_name , self .fname , 'src' ),
1574
1563
set_replication = True ,
1564
+ initdb_params = ['--data-checksums' ],
1575
1565
pg_options = { 'wal_log_hints' : 'on' }
1576
1566
)
1577
1567
src_pg .slow_start ()
1578
- src_pg .safe_psql (
1579
- "postgres" ,
1580
- "CREATE TABLE ultimate_question(answer int)" )
1568
+
1581
1569
src_pg .pgbench_init (scale = 10 )
1582
1570
pgbench = src_pg .pgbench (options = ['-T' , '10' , '--no-vacuum' ])
1583
1571
pgbench .wait ()
1584
- src_pg .safe_psql ("postgres" , "INSERT INTO ultimate_question VALUES(42)" )
1585
1572
1586
- # preparation 2: make clean shutdowned lagging behind replica
1573
+ # preparation 2: make clean shutdowned lagging behind replica
1587
1574
dst_pg = self .make_empty_node (os .path .join (module_name , self .fname , 'dst' ))
1588
1575
self .catchup_node (
1589
1576
backup_mode = 'FULL' ,
@@ -1601,12 +1588,12 @@ def test_dry_run_catchup_delta(self):
1601
1588
# save the condition before dry-run
1602
1589
content_before = self .pgdata_content (dst_pg .data_dir )
1603
1590
1604
- # do incremental catchup
1591
+ # do delta catchup
1605
1592
self .catchup_node (
1606
1593
backup_mode = 'DELTA' ,
1607
1594
source_pgdata = src_pg .data_dir ,
1608
1595
destination_node = dst_pg ,
1609
- options = ['-d' , 'postgres' , '-p' , str (src_pg .port ), '--stream' , ' --dry-run' ]
1596
+ options = ['-d' , 'postgres' , '-p' , str (src_pg .port ), '--stream' , " --dry-run" ]
1610
1597
)
1611
1598
1612
1599
# compare data dirs before and after cathup
@@ -1617,6 +1604,5 @@ def test_dry_run_catchup_delta(self):
1617
1604
1618
1605
# Cleanup
1619
1606
src_pg .stop ()
1620
- dst_pg .stop ()
1621
1607
self .del_test_dir (module_name , self .fname )
1622
1608
0 commit comments