Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4lJF-00042z-0A for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Jul 2021 14:28:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4lIi-0003L7-D1 for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Jul 2021 14:28:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4lIh-0003Je-I3 for pgsql-bugs@lists.postgresql.org; Sat, 17 Jul 2021 14:28:20 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4lIe-0003S4-Ok for pgsql-bugs@lists.postgresql.org; Sat, 17 Jul 2021 14:28:19 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1764A5C010A; Sat, 17 Jul 2021 10:28:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 17 Jul 2021 10:28:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=RV9xseehhO++qAKKe/bVdKkou48iH4uthbFADhSsJ0o=; b=ta/akgii S8p0yaiIjqRUbwE+7lMYl9IwWR3Wv1jixtPE7i/HKtIjyZHvtelfKrMGZJxLWDUD 1Tl750gqcYYKJaU3GZ1SJy5blPXQ9iiRYoOctGTUbSSOQV3AnkOku6jo7EFR3XGC ZVWcZYSdiQ84vu82CUqKkGz6vAsG1YZ8dzeY17J7h4fiIQdjg1vqbMhOYzAyij41 0ap5BxvG3AA/0Ey/lZcydQP0LdnXidySgkgNASDV7X3xdfApf/efLTGbttxc9haJ E5xGaTWyeO37Pl6m2fgXKCfw5gscLJLy8t5gMH+6+RWZgOEQc30+I1Yto0b48XKd X3JLv/DmlM2fxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdehgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehmkeerre dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeehleeukeelieeule egvdfhhffgjeeifeekgeevheelgefhleffgfelkefggeetieenucffohhmrghinhepphho shhtghhrvghsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 Jul 2021 10:28:13 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 99E772A09BE; Sat, 17 Jul 2021 10:28:09 -0400 (-04) Date: Sat, 17 Jul 2021 10:28:09 -0400 From: Alvaro Herrera To: Kyotaro Horiguchi Cc: jeff.janes@gmail.com, mk@071.ovh, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17103: WAL segments are not removed after exceeding max_slot_wal_keep_size Message-ID: <202107171428.gawrkqbqbzzs@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="md26r72p6xn2lfxq" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202107161809.zclasccpfcg3@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --md26r72p6xn2lfxq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2021-Jul-16, Alvaro Herrera wrote: > The buildfarm has remained green so far, but clearly this is something > we need to fix. Maybe it's as simple as adding the loop we use below, > starting at line 219. There are a few failures of this on buildfarm now, https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=flaviventris&dt=2021-07-16%2022%3A30%3A35 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=desmoxytes&dt=2021-07-16%2021%3A52%3A04 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dragonet&dt=2021-07-16%2021%3A52%3A05 I am running the test in a loop with the attached; if it doesn't fail in a few more rounds I'll push it. There are two instances of a different failure: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kittiwake&dt=2021-07-17%2013%3A39%3A43 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hornet&dt=2021-07-16%2021%3A14%3A14 # Failed test 'check that segments have been removed' # at t/019_replslot_limit.pl line 213. # got: '000000010000000000000021' # expected: '000000010000000000000022' # Looks like you failed 1 test of 19. [23:55:14] t/019_replslot_limit.pl .............. Dubious, test returned 1 (wstat 256, 0x100) I'm afraid about this not being something we can fix with some additional wait points ... -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "La grandeza es una experiencia transitoria. Nunca es consistente. Depende en gran parte de la imaginación humana creadora de mitos" (Irulan) --md26r72p6xn2lfxq Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="loop.patch" diff --git a/src/test/recovery/t/019_replslot_limit.pl b/src/test/recovery/t/019_replslot_limit.pl index f1a00c67f2..cb94aca32a 100644 --- a/src/test/recovery/t/019_replslot_limit.pl +++ b/src/test/recovery/t/019_replslot_limit.pl @@ -177,18 +177,21 @@ ok( !find_in_log( my $logstart = get_log_size($node_primary); advance_wal($node_primary, 7); -# This slot should be broken, wait for that to happen -$node_primary->poll_query_until( - 'postgres', - qq[SELECT wal_status = 'lost' FROM pg_replication_slots - WHERE slot_name = 'rep1']); - -# WARNING should be issued -ok( find_in_log( - $node_primary, - "invalidating slot \"rep1\" because its restart_lsn [0-9A-F/]+ exceeds max_slot_wal_keep_size", - $logstart), - 'check that the warning is logged'); +# wait until the WARNING is issued +my $invalidated = 0; +for (my $i = 0; $i < 10000; $i++) +{ + if (find_in_log( + $node_primary, + "invalidating slot \"rep1\" because its restart_lsn [0-9A-F/]+ exceeds max_slot_wal_keep_size", + $logstart)) + { + $invalidated = 1; + last; + } + usleep(100_000); +} +ok($invalidated, 'check that the slot has been invalidated'); $result = $node_primary->safe_psql( 'postgres', --md26r72p6xn2lfxq--