From a360f952ff028f8b85029334c54c025c716eb68e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 18 Jul 2018 17:39:27 -0400 Subject: [PATCH] Remove race-prone hot_standby_feedback test cases in 001_stream_rep.pl. This script supposed that if it turned hot_standby_feedback on and then shut down the standby server, at least one feedback message would be guaranteed to be sent before the standby stops. But there is no such guarantee, if the standby's walreceiver process is slow enough --- and we've seen multiple failures in the buildfarm showing that that does happen in practice. While we could rearrange the walreceiver logic to make it less likely, it seems probably impossible to create a really bulletproof guarantee of that sort; and if we tried, we might create situations where the walreceiver wouldn't react in a timely manner to shutdown commands. It seems better instead to remove the script's assumption that feedback will occur before shutdown. But once we do that, these last few tests seem quite redundant with the earlier tests in the script. So let's just drop them altogether and save some buildfarm cycles. Backpatch to v10 where these tests were added. Discussion: https://postgr.es/m/1922.1531592205@sss.pgh.pa.us --- src/test/recovery/t/001_stream_rep.pl | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl index a0d3e8f357..8dff5fc720 100644 --- a/src/test/recovery/t/001_stream_rep.pl +++ b/src/test/recovery/t/001_stream_rep.pl @@ -3,7 +3,7 @@ use strict; use warnings; use PostgresNode; use TestLib; -use Test::More tests => 28; +use Test::More tests => 26; # Initialize master node my $node_master = get_new_node('master'); @@ -282,27 +282,3 @@ is($catalog_xmin, '', is($xmin, '', 'xmin of cascaded slot null with hs feedback reset'); is($catalog_xmin, '', 'catalog xmin of cascaded slot still null with hs_feedback reset'); - -note "re-enabling hot_standby_feedback and disabling while stopped"; -$node_standby_2->safe_psql('postgres', - 'ALTER SYSTEM SET hot_standby_feedback = on;'); -$node_standby_2->reload; - -$node_master->safe_psql('postgres', qq[INSERT INTO tab_int VALUES (11000);]); -replay_check(); - -$node_standby_2->safe_psql('postgres', - 'ALTER SYSTEM SET hot_standby_feedback = off;'); -$node_standby_2->stop; - -($xmin, $catalog_xmin) = - get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NOT NULL"); -isnt($xmin, '', 'xmin of cascaded slot non-null with postgres shut down'); - -# Xmin from a previous run should be cleared on startup. -$node_standby_2->start; - -($xmin, $catalog_xmin) = - get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NULL"); -is($xmin, '', - 'xmin of cascaded slot reset after startup with hs feedback reset');