Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFnFQ-0066yy-M4 for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jun 2024 04:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sFnFN-00FJEp-IR for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jun 2024 04:00:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFnFN-00FJEh-7C for pgsql-hackers@lists.postgresql.org; Sat, 08 Jun 2024 04:00:06 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sFnFL-000Yhi-87 for pgsql-hackers@lists.postgresql.org; Sat, 08 Jun 2024 04:00:05 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52bc29c79fdso1184353e87.1 for ; Fri, 07 Jun 2024 21:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717819202; x=1718424002; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MFRbniEaysAuAh1c5u1wcLhtlLd98ltsjklsMMKwXUY=; b=SBbEO5qBCk62v/hchvZyDM6kfX9HerYPvTtMuy+g93MfBg2NJyybkweBweielqJEb3 Dyv+M4HEJ/HdtB9Wk8Y97eLYlaKvzhDI9Ap0WI6g7KcNiq3vdoGGFUD9eTA15eRXE25O 6ytn7j9qQK0ED6i2gMttJcjSGLkJSmiINTFmfTV5h9QwfazK4uISVR65mcGc0eHs5CGi gXvhNLIZetDNDqoH9kFTwbBz7GGOb90yEBSUI3EdCbI8X+rii9SVVQyjELniWEVwKNhW MKjSnFEIFtWVdZb3g7xwPGGOi/dnhDhnNdEA2j1581w4/6i6cz27JTktdJP7c+vVCSV7 2bfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717819202; x=1718424002; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MFRbniEaysAuAh1c5u1wcLhtlLd98ltsjklsMMKwXUY=; b=NJA9aBJsxS/AKJW6BehJCz/ZVeIBLCiuG++KbJWiUsBIw/o8xTZVE64gCbhGUxgv3U vGD8b0j4vExK4gUZCoHmUKVXKOnDffQQ1RdA4gId8mscUryFERLSxyzUB86ta69ChULo vrRbwZNav0StPG/a/gCiySyD+XNpI+8ZXeDF67sBSdDF1O0oVzCx+hWu/x98lHTzhrTX VKDc8n5Du9RJV9XfrPn+CiEpCcaleKh4MAApNsEnwBsXKME2rRHcFDo+8OPwIjVYYPXB ae+5RZneSKmgiw86YwoH9CDKEDPkyuYJTFURKkiJqPLbhBlE63GF/pIWgwvzNH/xD7y5 Veug== X-Gm-Message-State: AOJu0YyRQJl0+WyPhLdjXGHmaZW35poXFemYv1XmrVD1nuglyGSznx6K VOkly1ks58X1OJcSGS8eX0nlCCVLhdznFpL8kMfJ7hTc/XHTRHW1 X-Google-Smtp-Source: AGHT+IGHPHaDeyYzzh5iguk4HLkkO5zcHq4VKCo+/sdiXDru29OKTR9iuuxGV4Zi9D38lSdLqp45lg== X-Received: by 2002:ac2:5498:0:b0:52b:fac5:a3e9 with SMTP id 2adb3069b0e04-52bfac5a481mr1037297e87.9.1717819201766; Fri, 07 Jun 2024 21:00:01 -0700 (PDT) Received: from [1.0.0.7] ([178.155.25.76]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb434da7dsm718608e87.297.2024.06.07.21.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jun 2024 21:00:01 -0700 (PDT) Message-ID: <657815a2-5a89-fcc1-1c9d-d77a6986bc26@gmail.com> Date: Sat, 8 Jun 2024 07:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed Content-Language: en-US To: Bertrand Drouvot , Michael Paquier Cc: PostgreSQL Hackers References: From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Bertrand and Michael, 23.01.2024 11:07, Bertrand Drouvot wrote: > On Tue, Jan 23, 2024 at 02:50:06PM +0900, Michael Paquier wrote: > >> Anyway, that's not the end of it. What should we do for snapshot >> snapshot records coming from the bgwriter? > What about? > > 3) depending on how stabilized this test (and others that suffer from "random" > xl_running_xacts) is, then think about the bgwriter. A recent buildfarm failure [1] reminds me of that remaining question. Here we have a slow machine (a successful run, for example [2], shows 541.13s duration of the test) and the following information logged: [13:55:13.725](34.411s) ok 25 - inactiveslot slot invalidation is logged with vacuum on pg_class [13:55:13.727](0.002s) not ok 26 - activeslot slot invalidation is logged with vacuum on pg_class [13:55:13.728](0.001s) #   Failed test 'activeslot slot invalidation is logged with vacuum on pg_class' #   at C:/prog/bf/root/HEAD/pgsql/src/test/recovery/t/035_standby_logical_decoding.pl line 229. [14:27:42.995](1949.267s) # poll_query_until timed out executing this query: # select (confl_active_logicalslot = 1) from pg_stat_database_conflicts where datname = 'testdb' # expecting this output: # t # last actual query output: # f # with stderr: [14:27:42.999](0.004s) not ok 27 - confl_active_logicalslot updated [14:27:43.000](0.001s) #   Failed test 'confl_active_logicalslot updated' #   at C:/prog/bf/root/HEAD/pgsql/src/test/recovery/t/035_standby_logical_decoding.pl line 235. Timed out waiting confl_active_logicalslot to be updated at C:/prog/bf/root/HEAD/pgsql/src/test/recovery/t/035_standby_logical_decoding.pl line 235. --- 035_standby_logical_decoding_standby.log: 2024-06-06 13:55:07.715 UTC [9172:7] LOG:  invalidating obsolete replication slot "row_removal_inactiveslot" 2024-06-06 13:55:07.715 UTC [9172:8] DETAIL:  The slot conflicted with xid horizon 754. 2024-06-06 13:55:07.715 UTC [9172:9] CONTEXT:  WAL redo at 0/4020A80 for Heap2/PRUNE_ON_ACCESS: snapshotConflictHorizon: 754, isCatalogRel: T, nplans: 0, nredirected: 0, ndead: 1, nunused: 0, dead: [48]; blkref #0: rel 1663/16384/2610, blk 0 2024-06-06 13:55:14.372 UTC [7532:1] [unknown] LOG:  connection received: host=127.0.0.1 port=55328 2024-06-06 13:55:14.381 UTC [7532:2] [unknown] LOG:  connection authenticated: identity="EC2AMAZ-P7KGG90\\pgrunner" method=sspi (C:/prog/bf/root/HEAD/pgsql.build/testrun/recovery/035_standby_logical_decoding/data/t_035_standby_logical_decoding_standby_data/pgdata/pg_hba.conf:2) 2024-06-06 13:55:14.381 UTC [7532:3] [unknown] LOG:  connection authorized: user=pgrunner database=postgres application_name=035_standby_logical_decoding.pl 2024-06-06 13:55:14.443 UTC [7532:4] 035_standby_logical_decoding.pl LOG:  statement: select (confl_active_logicalslot = 1) from pg_stat_database_conflicts where datname = 'testdb' 2024-06-06 13:55:14.452 UTC [7532:5] 035_standby_logical_decoding.pl LOG:  disconnection: session time: 0:00:00.090 user=pgrunner database=postgres host=127.0.0.1 port=55328 # (there is no `invalidating obsolete replication slot "row_removal_activeslot"` message) ... 2024-06-06 14:27:42.675 UTC [4032:4] 035_standby_logical_decoding.pl LOG:  statement: select (confl_active_logicalslot = 1) from pg_stat_database_conflicts where datname = 'testdb' 2024-06-06 14:27:42.681 UTC [4032:5] 035_standby_logical_decoding.pl LOG:  disconnection: session time: 0:00:00.080 user=pgrunner database=postgres host=127.0.0.1 port=58713 2024-06-06 14:27:43.095 UTC [7892:2] FATAL:  could not receive data from WAL stream: server closed the connection unexpectedly         This probably means the server terminated abnormally         before or while processing the request. It's hard to determine from this info, why row_removal_activeslot was not invalidated, but running this test on a slowed down Windows VM, I (still) get the same looking failures caused by RUNNING_XACTS appeared just before `invalidating obsolete replication slot "row_removal_inactiveslot"`. So I would consider this failure as yet another result of bgwriter activity and add it to the list of known failures as such... [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=drongo&dt=2024-06-06%2012%3A36%3A11 [2] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=drongo&dt=2024-06-05%2017%3A03%3A13&stg=misc-check Best regards, Alexander