@@ -23,12 +23,12 @@ def test_minrecpoint_on_replica(self):
23
23
set_replication = True ,
24
24
initdb_params = ['--data-checksums' ],
25
25
pg_options = {
26
- 'checkpoint_timeout' :'60min' ,
26
+ # 'checkpoint_timeout': '60min',
27
27
'checkpoint_completion_target' :'0.9' ,
28
28
'bgwriter_delay' :'10ms' ,
29
29
'bgwriter_lru_maxpages' :'2000' ,
30
30
'bgwriter_lru_multiplier' :'4.0' ,
31
- 'max_wal_size' :'100GB ' })
31
+ 'max_wal_size' :'256MB ' })
32
32
33
33
backup_dir = os .path .join (self .tmp_path ,module_name ,fname ,'backup' )
34
34
self .init_pb (backup_dir )
@@ -75,36 +75,42 @@ def test_minrecpoint_on_replica(self):
75
75
pgbench .wait ()
76
76
pgbench .stdout .close ()
77
77
78
-
79
78
# generate some more data and leave it in background
80
79
pgbench = node .pgbench (
81
80
stdout = subprocess .PIPE ,
82
81
stderr = subprocess .STDOUT ,
83
- options = ["-c" ,"4" ,"-T" ,"30 " ])
82
+ options = ["-c" ,"4" ,"-j 4" , "- T" ,"100 " ])
84
83
85
84
# get pids of background workers
86
85
startup_pid = replica .safe_psql (
87
86
'postgres' ,
88
- "select pid from pg_stat_activity where backend_type = 'startup'" ).rstrip ()
87
+ "select pid from pg_stat_activity "
88
+ "where backend_type = 'startup'" ).rstrip ()
89
89
90
90
checkpointer_pid = replica .safe_psql (
91
91
'postgres' ,
92
- "select pid from pg_stat_activity where backend_type = 'checkpointer'" ).rstrip ()
92
+ "select pid from pg_stat_activity "
93
+ "where backend_type = 'checkpointer'" ).rstrip ()
93
94
94
95
bgwriter_pid = replica .safe_psql (
95
96
'postgres' ,
96
- "select pid from pg_stat_activity where backend_type = 'background writer'" ).rstrip ()
97
+ "select pid from pg_stat_activity "
98
+ "where backend_type = 'background writer'" ).rstrip ()
97
99
98
100
# wait for shared buffer on replica to be filled with dirty data
99
101
sleep (10 )
100
102
101
103
# break checkpointer on UpdateLastRemovedPtr
102
104
gdb_checkpointer = self .gdb_attach (checkpointer_pid )
105
+ gdb_checkpointer ._execute ('handle SIGINT noprint nostop pass' )
106
+ gdb_checkpointer ._execute ('handle SIGUSR1 noprint nostop pass' )
103
107
gdb_checkpointer .set_breakpoint ('UpdateLastRemovedPtr' )
104
108
gdb_checkpointer .continue_execution_until_break ()
105
109
106
110
# break recovery on UpdateControlFile
107
111
gdb_recovery = self .gdb_attach (startup_pid )
112
+ gdb_recovery ._execute ('handle SIGINT noprint nostop pass' )
113
+ gdb_recovery ._execute ('handle SIGUSR1 noprint nostop pass' )
108
114
gdb_recovery .set_breakpoint ('UpdateMinRecoveryPoint' )
109
115
gdb_recovery .continue_execution_until_break ()
110
116
gdb_recovery .set_breakpoint ('UpdateControlFile' )