Skip to content

Commit ef4e475

Browse files
author
hackorum
committed
Apply 031_recovery_conflict-mod.patch
1 parent f5635c2 commit ef4e475

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎src/test/recovery/t/031_recovery_conflict.pl‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@
214214

215215
## RECOVERY CONFLICT 5: Deadlock
216216
$sect = "startup deadlock";
217-
$expected_conflicts++;
218217

219218
# Want to test recovery deadlock conflicts, not buffer pin conflicts. Without
220219
# changing max_standby_streaming_delay it'd be timing dependent what we hit
@@ -226,13 +225,19 @@
226225
$node_standby->restart();
227226
$psql_standby->reconnect_and_clear();
228227

228+
for (my $i = 1; $i <= 100; $i++) {
229+
diag("iteration $i");
230+
231+
$expected_conflicts++;
232+
229233
# Generate a few dead rows, to later be cleaned up by vacuum. Then acquire a
230234
# lock on another relation in a prepared xact, so it's held continuously by
231235
# the startup process. The standby psql will block acquiring that lock while
232236
# holding a pin that vacuum needs, triggering the deadlock.
233237
$node_primary->safe_psql(
234238
$test_db,
235239
qq[
240+
DROP TABLE IF EXISTS $table1;
236241
CREATE TABLE $table1(a int, b int);
237242
INSERT INTO $table1 VALUES (1);
238243
BEGIN;
@@ -274,10 +279,18 @@
274279

275280
check_conflict_log("User transaction caused buffer deadlock with recovery.");
276281
$psql_standby->reconnect_and_clear();
277-
check_conflict_stat("deadlock");
282+
## check_conflict_stat("deadlock");
278283

279284
# clean up for next tests
280285
$node_primary->safe_psql($test_db, qq[ROLLBACK PREPARED 'lock';]);
286+
287+
$node_standby->restart();
288+
$psql_standby->reconnect_and_clear();
289+
290+
}
291+
292+
# clean up for next tests
293+
## $node_primary->safe_psql($test_db, qq[ROLLBACK PREPARED 'lock';]);
281294
$node_standby->adjust_conf('postgresql.conf', 'max_standby_streaming_delay',
282295
'50ms');
283296
$node_standby->restart();

0 commit comments

Comments
 (0)