postgres.git / summary / log / commit / refs
commit 3197e0f5ae9d58a0dd45e1bf8646ce83791bb2de
Author: Andres Freund <andres@anarazel.de>
Date: Wed May 04 19:50:38 2022 +0000
First released in: 15.0, REL_10_STABLE (reverted before release), REL_11_STABLE (reverted before release), REL_12_STABLE (reverted before release), REL_13_STABLE (reverted before release), REL_14_STABLE (reverted before release)
Reverted by: 14f9d8b7e3b3 (in 10.21), 8b9991cf07c0 (in 11.16), 8019423764e4 (in 12.11), 27e97d0747ad (in 13.7), 6e2924b57793 (in 14.3)
Fix timing issue in deadlock recovery conflict test.
Per buildfarm members longfin and skink.
Discussion: https://postgr.es/m/20220413002626.udl7lll7f3o7nre7@alap3.anarazel.de
Backpatch: 10-
src/test/recovery/t/031_recovery_conflict.pl | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/test/recovery/t/031_recovery_conflict.pl b/src/test/recovery/t/031_recovery_conflict.pl
index aa36582d110..a2e4c659f20 100644
--- a/src/test/recovery/t/031_recovery_conflict.pl
+++ b/src/test/recovery/t/031_recovery_conflict.pl
@@ -231,6 +231,14 @@ check_conflict_stat("lock");
$sect = "startup deadlock";
$expected_conflicts++;
+# Want to test recovery deadlock conflicts, not buffer pin conflicts. Without
+# changing max_standby_streaming_delay it'd be timing dependent what we hit
+# first
+$node_standby->adjust_conf('postgresql.conf', 'max_standby_streaming_delay',
+ "${PostgreSQL::Test::Utils::timeout_default}s");
+$node_standby->restart();
+reconnect_and_clear();
+
# Generate a few dead rows, to later be cleaned up by vacuum. Then acquire a
# lock on another relation in a prepared xact, so it's held continuously by
# the startup process. The standby psql will block acquiring that lock while
@@ -286,6 +294,9 @@ check_conflict_stat("deadlock");
# clean up for next tests
$node_primary->safe_psql($test_db, qq[ROLLBACK PREPARED 'lock';]);
+$node_standby->adjust_conf('postgresql.conf', 'max_standby_streaming_delay', '50ms');
+$node_standby->restart();
+reconnect_and_clear();
# Check that expected number of conflicts show in pg_stat_database. Needs to
[parent: b1f35a36e6d5]