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 1pm9n6-0003h8-PO for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2023 08:55:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pm9n4-000824-QA for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2023 08:55:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pm9n4-00081v-AE for pgsql-hackers@lists.postgresql.org; Tue, 11 Apr 2023 08:55:50 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pm9n2-0001Ui-0m for pgsql-hackers@postgresql.org; Tue, 11 Apr 2023 08:55:49 +0000 Received: by mail-wm1-x32d.google.com with SMTP id l26-20020a05600c1d1a00b003edd24054e0so5551683wms.4 for ; Tue, 11 Apr 2023 01:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681203345; h=in-reply-to:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Z7r7Z7c1stT/I9dckbHxwLw8YnBP30J+IkXHmPsABqs=; b=Adexvvb72KzoHzB4YU5SXOBxVQYuZnOexQiDE9TIZAEeb8CA/MAZXGTtUYXAa7dXZl 8lM3l7rqbCv2KRToHXezrHgYv1fbIIzCh/GCe4KhHuRQ1jXIPZpdXAkUVfgwphfVbTNf 5RLUNnPBOANx2BB5lVJullpLaFW9M7GQocVLHgfc2YWgos9vXEAR9sQ8ppFuGzWfY7ot hYvsaO0tyuN1mwiD3hORadAMFcTs0VbFjJpmmxkqs5CcAL0r6CrY+13h+pKfRT+EEOS+ RYxNq1b5/tWKMuzLx3Syu97jfnL14zaZgHSK+9YcO++zlwcuUEJ4ED+7C03VRCQGjdNr RgNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681203345; h=in-reply-to:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Z7r7Z7c1stT/I9dckbHxwLw8YnBP30J+IkXHmPsABqs=; b=HiaMjs4cLzP7SP7EqOVcIQUpWsjyWfklSENC1KxISs820lT3XWooPnZApO7XyG84w2 Rt9Qxa5uKWlsriOtGnA+sIV0nB5/SGPaaBxJGeQANWSjdoI3rYTqRU1GyYkjQKZzNe/t 04eWG3vRGLVPgzgzPBKCxy/zRLaP1iR8TSLWd12v1mlQiAcqu2fja/GJNqLxV2EYLRtx 7Um/3M5GwSCvGDTddVpF4cBPxbjRmwBXIiDKOuFO10Gi7tUYsx+qdpzbM/MhzGAW/XCO 7XK7CqQQYaCov/a4uWU4jxMlC+kOUi4/Nt0NrpTuTRfiasiWN5cnFhy30ljS1Hw2Quao qnUg== X-Gm-Message-State: AAQBX9fPblqSjtUrMasGC3Yf15j07uua0hcI6knrBIpo9wIHlDNiJXxa Si0sx8m1R/11h0sDF7oE4cQ= X-Google-Smtp-Source: AKy350b62SMol/HB2nbWtDllVuzBdIiWsJgTjY1jEZ4AdSmtKldwR7MmhCaZXCJuhQe2HLNxqeLdsw== X-Received: by 2002:a05:600c:364f:b0:3f0:46ca:f204 with SMTP id y15-20020a05600c364f00b003f046caf204mr1533709wmq.3.1681203345434; Tue, 11 Apr 2023 01:55:45 -0700 (PDT) Received: from [192.168.27.87] ([54.239.6.186]) by smtp.gmail.com with ESMTPSA id c24-20020a7bc858000000b003ef5b011b30sm16408540wml.8.2023.04.11.01.55.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 01:55:45 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------hvZVoQq2QkdAfGYgE0zuRmYG" Message-ID: Date: Tue, 11 Apr 2023 10:55:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: Minimal logical decoding on standbys Content-Language: en-US From: "Drouvot, Bertrand" To: Noah Misch , Andres Freund Cc: Amit Kapila , Alvaro Herrera , Jeff Davis , Robert Haas , Thomas Munro , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers References: <1903ca9b-1dc9-20a6-404a-d4c460c7bdcc@gmail.com> <2b002763-f39f-0814-e98e-c48989ddc3c3@gmail.com> <3c9d4998-a338-081f-a5f6-d038ead75384@gmail.com> <20230407055618.33gjg5vd5hq3kje4@awork3.anarazel.de> <71c3d91a-6b3b-5c0a-ffb9-630f17fe693e@gmail.com> <20230407075009.igg7be27ha2htkbt@awork3.anarazel.de> <1e923731-ed09-3621-c8b9-61f938b4c355@gmail.com> <20230407154757.ywqnldz4nsycap3g@awork3.anarazel.de> <20230407181226.6oyt4jcazy6eh7rx@awork3.anarazel.de> <20230411053657.GA1177147@rfd.leadboat.com> <7eb26a22-a6b2-f938-6d3c-6adcf4785004@gmail.com> In-Reply-To: <7eb26a22-a6b2-f938-6d3c-6adcf4785004@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------hvZVoQq2QkdAfGYgE0zuRmYG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, On 4/11/23 10:20 AM, Drouvot, Bertrand wrote: > Hi, > > On 4/11/23 7:36 AM, Noah Misch wrote: >> On Fri, Apr 07, 2023 at 11:12:26AM -0700, Andres Freund wrote: >>> --- /dev/null >>> +++ b/src/test/recovery/t/035_standby_logical_decoding.pl >>> @@ -0,0 +1,720 @@ >>> +# logical decoding on standby : test logical decoding, >>> +# recovery conflict and standby promotion. >> ... >>> +$node_primary->append_conf('postgresql.conf', q{ >>> +wal_level = 'logical' >>> +max_replication_slots = 4 >>> +max_wal_senders = 4 >>> +log_min_messages = 'debug2' >>> +log_error_verbosity = verbose >>> +}); >> >> Buildfarm member hoverfly stopped reporting in when this test joined the tree. >> It's currently been stuck here for 140 minutes: >> > > Thanks for the report! > > It's looping on: > > 2023-04-11 02:57:52.516 UTC [62718288:5] 035_standby_logical_decoding.pl LOG:  00000: statement: SELECT restart_lsn IS NOT NULL >                         FROM pg_catalog.pg_replication_slots WHERE slot_name = 'promotion_inactiveslot' > > And the reason is that the slot is not being created: > > $ grep "CREATE_REPLICATION_SLOT" 035_standby_logical_decoding_standby.log | tail -2 > 2023-04-11 02:57:47.287 UTC [9241178:15] 035_standby_logical_decoding.pl STATEMENT:  CREATE_REPLICATION_SLOT "otherslot" LOGICAL "test_decoding" ( SNAPSHOT 'nothing') > 2023-04-11 02:57:47.622 UTC [9241178:23] 035_standby_logical_decoding.pl STATEMENT:  CREATE_REPLICATION_SLOT "otherslot" LOGICAL "test_decoding" ( SNAPSHOT 'nothing') > > Not sure why the slot is not being created. > > There is also "replication apply delay" increasing: > > 2023-04-11 02:57:49.183 UTC [13304488:253] DEBUG:  00000: sendtime 2023-04-11 02:57:49.111363+00 receipttime 2023-04-11 02:57:49.183512+00 replication apply delay 644 ms transfer latency 73 ms > 2023-04-11 02:57:49.184 UTC [13304488:259] DEBUG:  00000: sendtime 2023-04-11 02:57:49.183461+00 receipttime 2023-04-11 02:57:49.1842+00 replication apply delay 645 ms transfer latency 1 ms > 2023-04-11 02:57:49.221 UTC [13304488:265] DEBUG:  00000: sendtime 2023-04-11 02:57:49.184166+00 receipttime 2023-04-11 02:57:49.221059+00 replication apply delay 682 ms transfer latency 37 ms > 2023-04-11 02:57:49.222 UTC [13304488:271] DEBUG:  00000: sendtime 2023-04-11 02:57:49.221003+00 receipttime 2023-04-11 02:57:49.222144+00 replication apply delay 683 ms transfer latency 2 ms > 2023-04-11 02:57:49.222 UTC [13304488:277] DEBUG:  00000: sendtime 2023-04-11 02:57:49.222095+00 receipttime 2023-04-11 02:57:49.2228+00 replication apply delay 684 ms transfer latency 1 ms > > Noah, I think hoverfly is yours, would it be possible to have access (I'm not an AIX expert though) or check if you see a slot creation hanging and if so why? > Well, we can see in 035_standby_logical_decoding_standby.log: 2023-04-11 02:57:49.180 UTC [62718258:5] [unknown] FATAL: 3D000: database "testdb" does not exist While, on the primary: 2023-04-11 02:57:48.505 UTC [62718254:5] 035_standby_logical_decoding.pl LOG: 00000: statement: CREATE DATABASE testdb The TAP test is doing: " ################################################## # Test standby promotion and logical decoding behavior # after the standby gets promoted. ################################################## $node_standby->reload; $node_primary->psql('postgres', q[CREATE DATABASE testdb]); $node_primary->safe_psql('testdb', qq[CREATE TABLE decoding_test(x integer, y text);]); # create the logical slots create_logical_slots($node_standby, 'promotion_'); " I think we might want to add: $node_primary->wait_for_replay_catchup($node_standby); before calling the slot creation. It's done in the attached, would it be possible to give it a try please? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --------------hvZVoQq2QkdAfGYgE0zuRmYG Content-Type: text/plain; charset=UTF-8; name="hoverfly.patch" Content-Disposition: attachment; filename="hoverfly.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy90ZXN0L3JlY292ZXJ5L3QvMDM1X3N0YW5kYnlfbG9naWNhbF9k ZWNvZGluZy5wbCBiL3NyYy90ZXN0L3JlY292ZXJ5L3QvMDM1X3N0YW5kYnlfbG9naWNhbF9k ZWNvZGluZy5wbAppbmRleCBiYTk4YTE4YmQyLi5hZDg0NWFlZTI4IDEwMDY0NAotLS0gYS9z cmMvdGVzdC9yZWNvdmVyeS90LzAzNV9zdGFuZGJ5X2xvZ2ljYWxfZGVjb2RpbmcucGwKKysr IGIvc3JjL3Rlc3QvcmVjb3ZlcnkvdC8wMzVfc3RhbmRieV9sb2dpY2FsX2RlY29kaW5nLnBs CkBAIC02NTMsNiArNjUzLDkgQEAgJG5vZGVfc3RhbmRieS0+cmVsb2FkOwogJG5vZGVfcHJp bWFyeS0+cHNxbCgncG9zdGdyZXMnLCBxW0NSRUFURSBEQVRBQkFTRSB0ZXN0ZGJdKTsKICRu b2RlX3ByaW1hcnktPnNhZmVfcHNxbCgndGVzdGRiJywgcXFbQ1JFQVRFIFRBQkxFIGRlY29k aW5nX3Rlc3QoeCBpbnRlZ2VyLCB5IHRleHQpO10pOwogCisjIFdhaXQgZm9yIHRoZSBzdGFu ZGJ5IHRvIGNhdGNodXAgYmVmb3JlIGNyZWF0aW5nIHRoZSBzbG90cworJG5vZGVfcHJpbWFy eS0+d2FpdF9mb3JfcmVwbGF5X2NhdGNodXAoJG5vZGVfc3RhbmRieSk7CisKICMgY3JlYXRl IHRoZSBsb2dpY2FsIHNsb3RzCiBjcmVhdGVfbG9naWNhbF9zbG90cygkbm9kZV9zdGFuZGJ5 LCAncHJvbW90aW9uXycpOwogCg== --------------hvZVoQq2QkdAfGYgE0zuRmYG--