@@ -26,7 +26,8 @@ def test_page_vacuum_truncate(self):
26
26
pg_options = {
27
27
'wal_level' : 'replica' ,
28
28
'max_wal_senders' : '2' ,
29
- 'checkpoint_timeout' : '300s'
29
+ 'checkpoint_timeout' : '300s' ,
30
+ 'autovacuum' : 'off'
30
31
}
31
32
)
32
33
node_restored = self .make_simple_node (
@@ -70,8 +71,7 @@ def test_page_vacuum_truncate(self):
70
71
)
71
72
72
73
self .backup_node (
73
- backup_dir , 'node' , node , backup_type = 'page' ,
74
- options = ['--log-level-file=verbose' ]
74
+ backup_dir , 'node' , node , backup_type = 'page'
75
75
)
76
76
77
77
if self .paranoia :
@@ -95,6 +95,21 @@ def test_page_vacuum_truncate(self):
95
95
"postgresql.auto.conf" , "port = {0}" .format (node_restored .port ))
96
96
node_restored .start ()
97
97
98
+ while node_restored .safe_psql (
99
+ "postgres" , "select pg_is_in_recovery()" ) == 't\n ' :
100
+ time .sleep (1 )
101
+
102
+ # Logical comparison
103
+ result1 = node .safe_psql (
104
+ "postgres" ,
105
+ "select * from t_heap"
106
+ )
107
+ result2 = node_restored .safe_psql (
108
+ "postgres" ,
109
+ "select * from t_heap"
110
+ )
111
+ self .assertEqual (result1 , result2 )
112
+
98
113
# Clean after yourself
99
114
self .del_test_dir (module_name , fname )
100
115
@@ -280,12 +295,15 @@ def test_page_multiple_segments(self):
280
295
pgdata_restored = self .pgdata_content (restored_node .data_dir )
281
296
282
297
# START RESTORED NODE
283
- restored_node .append_conf ("postgresql.auto.conf" , "port = {0}" .format (restored_node .port ))
298
+ restored_node .append_conf (
299
+ "postgresql.auto.conf" , "port = {0}" .format (restored_node .port ))
284
300
restored_node .start ()
285
- while restored_node .safe_psql ("postgres" , "select pg_is_in_recovery()" ) == 't\n ' :
301
+ while restored_node .safe_psql (
302
+ "postgres" , "select pg_is_in_recovery()" ) == 't\n ' :
286
303
time .sleep (1 )
287
304
288
- result_new = restored_node .safe_psql ("postgres" , "select * from pgbench_accounts" )
305
+ result_new = restored_node .safe_psql (
306
+ "postgres" , "select * from pgbench_accounts" )
289
307
290
308
# COMPARE RESTORED FILES
291
309
self .assertEqual (result , result_new , 'data is lost' )
0 commit comments