Skip to content

Commit 1b0eb68

Browse files
committed
tests: fix pgpro2068
1 parent d38b5e6 commit 1b0eb68

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tests/pgpro2068.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def test_minrecpoint_on_replica(self):
2323
set_replication=True,
2424
initdb_params=['--data-checksums'],
2525
pg_options={
26-
'checkpoint_timeout': '60min',
26+
# 'checkpoint_timeout': '60min',
2727
'checkpoint_completion_target': '0.9',
2828
'bgwriter_delay': '10ms',
2929
'bgwriter_lru_maxpages': '2000',
3030
'bgwriter_lru_multiplier': '4.0',
31-
'max_wal_size': '100GB'})
31+
'max_wal_size': '256MB'})
3232

3333
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
3434
self.init_pb(backup_dir)
@@ -75,36 +75,42 @@ def test_minrecpoint_on_replica(self):
7575
pgbench.wait()
7676
pgbench.stdout.close()
7777

78-
7978
# generate some more data and leave it in background
8079
pgbench = node.pgbench(
8180
stdout=subprocess.PIPE,
8281
stderr=subprocess.STDOUT,
83-
options=["-c", "4", "-T", "30"])
82+
options=["-c", "4", "-j 4", "-T", "100"])
8483

8584
# get pids of background workers
8685
startup_pid = replica.safe_psql(
8786
'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()
8989

9090
checkpointer_pid = replica.safe_psql(
9191
'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()
9394

9495
bgwriter_pid = replica.safe_psql(
9596
'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()
9799

98100
# wait for shared buffer on replica to be filled with dirty data
99101
sleep(10)
100102

101103
# break checkpointer on UpdateLastRemovedPtr
102104
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')
103107
gdb_checkpointer.set_breakpoint('UpdateLastRemovedPtr')
104108
gdb_checkpointer.continue_execution_until_break()
105109

106110
# break recovery on UpdateControlFile
107111
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')
108114
gdb_recovery.set_breakpoint('UpdateMinRecoveryPoint')
109115
gdb_recovery.continue_execution_until_break()
110116
gdb_recovery.set_breakpoint('UpdateControlFile')

0 commit comments

Comments
 (0)