@@ -287,6 +287,16 @@ def test_replica_archive_page_backup(self):
287
287
288
288
self .wait_until_replica_catch_with_master (master , replica )
289
289
290
+ master .pgbench_init (scale = 5 )
291
+ # Continuous making some changes on master,
292
+ # because WAL archiving on replica in idle DB in PostgreSQL is broken:
293
+ # replica will not archive the previous WAL until it receives new records in the next WAL file,
294
+ # this "lazy" archiving can be seen in src/backend/replication/walreceiver.c:XLogWalRcvWrite()
295
+ # (see !XLByteInSeg checking and XLogArchiveNotify() calling).
296
+ pgbench = master .pgbench (
297
+ stdout = subprocess .PIPE , stderr = subprocess .STDOUT ,
298
+ options = ['-T' , '3' , '-c' , '1' , '--no-vacuum' ])
299
+
290
300
backup_id = self .backup_node (
291
301
backup_dir , 'replica' , replica ,
292
302
options = [
@@ -295,6 +305,9 @@ def test_replica_archive_page_backup(self):
295
305
'--master-db=postgres' ,
296
306
'--master-port={0}' .format (master .port )])
297
307
308
+ pgbench .wait ()
309
+ pgbench .stdout .close ()
310
+
298
311
self .validate_pb (backup_dir , 'replica' )
299
312
self .assertEqual (
300
313
'OK' , self .show_pb (backup_dir , 'replica' , backup_id )['status' ])
@@ -317,8 +330,6 @@ def test_replica_archive_page_backup(self):
317
330
# Change data on master, make PAGE backup from replica,
318
331
# restore taken backup and check that restored data equal
319
332
# to original data
320
- master .pgbench_init (scale = 5 )
321
-
322
333
pgbench = master .pgbench (
323
334
options = ['-T' , '30' , '-c' , '2' , '--no-vacuum' ])
324
335
0 commit comments