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 1sNuAC-00BE3d-7O for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Jun 2024 13:00:16 +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 1sNuA8-00CGHg-U4 for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Jun 2024 13:00:13 +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 1sNuA8-00CGHO-G3 for pgsql-hackers@lists.postgresql.org; Sun, 30 Jun 2024 13:00:12 +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 1sNuA1-004J2L-HI for pgsql-hackers@lists.postgresql.org; Sun, 30 Jun 2024 13:00:11 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52cd628f21cso2119631e87.3 for ; Sun, 30 Jun 2024 06:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719752404; x=1720357204; 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=FcudaUPJJAe+7sx9gm5hGkwuzlp+WctnEFQQFxUNAl8=; b=hF10sasaahBNxt5j/sMb+h1qodVA/KFRpbmdYiziHYzPGgmhDEeSInNnLq03ef5mcZ f53Hcod3sJ6BpVxXAN5fLd9bs7xVSypPGAlxlfmvf2LvRQoweIZXh9eK86Uc8xUXZrfP mFyOmeVETWAxgclrmtqdwbRQEdziwahLk2sBdBBfeG4rTr66bMhtaKU2JhFMP1SqtNCD WrcoB55PoEZAjgHMDIZqjwT9VGWyvoi+EaNdn8n0/XuWwKEBDOnBnObwj7FNGyh3VLMR OKr13LnBjJMdb1mtYMgouFc1pqN94F1FU5KsgVUcWEah1wI8Bcw6AtQVia/yx4Ksnwk7 uc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719752404; x=1720357204; 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=FcudaUPJJAe+7sx9gm5hGkwuzlp+WctnEFQQFxUNAl8=; b=nRFPKnZXUwo/eeFgDllUGA3rtnjdcykQ7JoCgm4dfLUOyB79AF6yTId+HasGFJl9Rm ZzwQLy/q2Z90pXQM6bWzweBhTJcZTeYSYk1Lz5Xvm5RgII39/Ec71awicg56uxutLXb2 aV1ythnbNeua3sn8DV3sBjQfm7Yq1LwEvoJn+ft9W2btdKheDfawRmuTD/aWJSE9NH8R VFSbFsvXRSfaFlEumze+cij/U8z2YiXShhrCCqK3ZDtUaZ+Mo3hBxf8LDTtlNzmBBmj6 g+TxSignAIDVfKx/s/Eck0Rx9joRUTVoxRvFtvL68tO5lI6TT0hhovknAcWXEAhOmesh v0BQ== X-Forwarded-Encrypted: i=1; AJvYcCXGLcaJn45u31HCWgsArJBw4EsyjbDzHrS2tU3OGxLxJMknyeTBRFIcBX3VLCAn0I8Z5oZooAVQpsuEAIyOaCSXEl6QelH2UXQOvYZv5nuUc1MR X-Gm-Message-State: AOJu0Yz+EylcXK9SSa79DcdY+m+d0sSox7zVH/MwC1iIbWmBNScsTsYh H94jUpr4X23iHKS7s4e1BJq2uLcqaP5LWdtuum8j4y0WSwTm7AoMC8vRCwZO X-Google-Smtp-Source: AGHT+IFHuLq9gpIa7VBKyB4nNGxl0MG7nGCS/avdGGrq2i5xfgydn+MSUYUkKo5Y/zLKCFyeG/obHw== X-Received: by 2002:a05:6512:2004:b0:52c:d707:91e6 with SMTP id 2adb3069b0e04-52e82672d15mr1507646e87.21.1719752403284; Sun, 30 Jun 2024 06:00:03 -0700 (PDT) Received: from [1.0.0.7] ([81.23.167.104]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e7ab3f7basm946871e87.305.2024.06.30.06.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Jun 2024 06:00:02 -0700 (PDT) Message-ID: <0dffca12-bf17-4a7a-334d-225569de5e6e@gmail.com> Date: Sun, 30 Jun 2024 16: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: speed up a logical replica setup Content-Language: en-US To: Peter Eisentraut , Euler Taveira , Amit Kapila , Shlok Kyal Cc: Tomas Vondra , "kuroda.hayato@fujitsu.com" , Bharath Rupireddy , "pgsql-hackers@lists.postgresql.org" , Michael Paquier , Andres Freund , Ashutosh Bapat , =?UTF-8?Q?Fabr=c3=adzio_de_Royes_Mello?= , vignesh C References: <9a9c7e65-c47b-4400-a63e-ac6169c0860e@app.fastmail.com> <65b841a8-0c2f-4953-b9cd-240fce84b90b@eisentraut.org> <47524383-6fd1-4b13-8c4e-fb918b1d35ba@enterprisedb.com> <2e86cf53-c806-49d2-9a10-1a1257776d1f@app.fastmail.com> <5da4b286-e570-4341-8262-92d763f6b1a4@app.fastmail.com> <776c5cac-5ef5-4001-b1bc-5b698bc0c62a@app.fastmail.com> <3c024250-3f13-4f4d-b8e9-55f176db4abf@eisentraut.org> From: Alexander Lakhin In-Reply-To: <3c024250-3f13-4f4d-b8e9-55f176db4abf@eisentraut.org> 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 Peter and Euler, 17.06.2024 14:04, Peter Eisentraut wrote: > On 07.06.24 05:49, Euler Taveira wrote: >> Here it is a patch series to fix the issues reported in recent discussions. The >> patches 0001 and 0003 aim to fix the buildfarm issues. The patch 0002 removes >> synchronized failover slots on subscriber since it has no use. I also included >> an optional patch 0004 that improves the usability by checking both servers if >> it already failed in any subscriber check. > > I have committed 0001, 0002, and 0003.  Let's keep an eye on the buildfarm to see if that stabilizes things.  So far > it looks good. > > For 0004, I suggest inverting the result values from check_publisher() and create_subscriber() so that it returns true > if the check is ok. As a recent buildfarm failure [1] shows, that test addition introduced new instability: ### Starting node "node_s" # Running: pg_ctl -w -D /home/bf/bf-build/piculet/HEAD/pgsql.build/testrun/pg_basebackup/040_pg_createsubscriber/data/t_040_pg_createsubscriber_node_s_data/pgdata -l /home/bf/bf-build/piculet/HEAD/pgsql.build/testrun/pg_basebackup/040_pg_createsubscriber/log/040_pg_createsubscriber_node_s.log -o --cluster-name=node_s start waiting for server to start.... done server started # Postmaster PID for node "node_s" is 416482 error running SQL: 'psql::1: ERROR:  skipping slot synchronization as the received slot sync LSN 0/30047F0 for slot "failover_slot" is ahead of the standby position 0/3004708' while running 'psql -XAtq -d port=51506 host=/tmp/pqWohdD5Qj dbname='postgres' -f - -v ON_ERROR_STOP=1' with sql 'SELECT pg_sync_replication_slots()' at /home/bf/bf-build/piculet/HEAD/pgsql/src/test/perl/PostgreSQL/Test/Cluster.pm line 2126. I could reproduce this failure with: --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -517,6 +517,7 @@ WalReceiverMain(char *startup_data, size_t startup_data_len)                       * let the startup process and primary server know about                       * them.                       */ +pg_usleep(300000);                      XLogWalRcvFlush(false, startpointTLI); make -s check -C src/bin/pg_basebackup/ PROVE_TESTS="t/040*" # +++ tap check in src/bin/pg_basebackup +++ t/040_pg_createsubscriber.pl .. 22/? # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 29 just after 23. t/040_pg_createsubscriber.pl .. Dubious, test returned 29 (wstat 7424, 0x1d00) All 23 subtests passed Test Summary Report ------------------- t/040_pg_createsubscriber.pl (Wstat: 7424 Tests: 23 Failed: 0)   Non-zero exit status: 29   Parse errors: No plan found in TAP output Files=1, Tests=23,  4 wallclock secs ( 0.01 usr  0.01 sys +  0.49 cusr  0.44 csys =  0.95 CPU) Moreover, this test may suffer from autovacuum: echo " autovacuum_naptime = 1 autovacuum_analyze_threshold = 1 " > /tmp/temp.config TEMP_CONFIG=/tmp/temp.config make -s check -C src/bin/pg_basebackup/ PROVE_TESTS="t/040*" # +++ tap check in src/bin/pg_basebackup +++ t/040_pg_createsubscriber.pl .. 24/? #   Failed test 'failover slot is synced' #   at t/040_pg_createsubscriber.pl line 273. #          got: '' #     expected: 'failover_slot' t/040_pg_createsubscriber.pl .. 28/? # Looks like you failed 1 test of 33. t/040_pg_createsubscriber.pl .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/33 subtests [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=piculet&dt=2024-06-28%2004%3A42%3A48 Best regards, Alexander