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 1oIy2V-0000EN-Qx for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Aug 2022 19:58:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIy2U-0003f9-Ji for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Aug 2022 19:58:50 +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 1oIy2U-0003ez-9X for pgsql-hackers@lists.postgresql.org; Tue, 02 Aug 2022 19:58:50 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oIy2Q-000417-KK for pgsql-hackers@postgresql.org; Tue, 02 Aug 2022 19:58:49 +0000 Received: by mail-io1-xd32.google.com with SMTP id o2so11448083iof.8 for ; Tue, 02 Aug 2022 12:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=nr4/tLVcRed2Ouz0yMQ0b+YRfld6v/kBNkZSpwCxttQ=; b=WoRL28tOJuQz+V6scHykiMi3uIN9DKjXHWfq+ljH1UTmvFduhpCG43MPx8FT1hqumm GByCvOsgZ9F4z8cLueXhL3DDlYmjwIktOjy1+Jm5V/O8X0284IfmD4YUzEUV0XmXb+a5 N+EQ/w8Ld5uve7gXloPGW1udZohbjBzqBThQJnHfaU7+4p30x8t8xlDnmPjnxbVPPH0A isRN2FYzICMRMbkVXE4It/LXPBWPWnw1MREaAgs8L8t6DcTTpUFbVM4mdYn03ntfqqsp 7YhdT12B1ExGhXN+5kBfC0GR0Wf3Q14gui2pe6RGseWYEuZJFN+Bep1LR9pu6802PLdo WSbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=nr4/tLVcRed2Ouz0yMQ0b+YRfld6v/kBNkZSpwCxttQ=; b=42JoqU2zulXmnayYTzS1VyzPApALeZXoXp3A/CwBQyXxffWpJjXcyVOGK1e/2Bgeal PR4Tsj1fyTOL3reLVc7T+J4kmwuwsSny0LAw3DOdl85TQ4xXI2xdv+2katabkeh3mTZ1 JWFQYBXwkNlsp9qiEqBdU8TrtA6oQaMq+HnomKdnXifpOVAaxmrcmWPyta/bxLVOwPMp 8Jqip9MkT4EVLk/G67o6AxBrFr79pbUaQ2h5qXAmRluIwjhiYw7z7P77yfJ+35xPiKiI dbK3JLsxAAFiMpg8NoGOpO8CcsldqdUAJ6hxEiR4dwuERB6D32HKl5TT9zbUe3aHrJB8 KzIg== X-Gm-Message-State: AJIora8foeSG+vbut6afWCL9L+yTSiT8B/kvooZReHyLQWKvk0F3FkJZ GAynKIpFNaaOTWFCr9CHs/Vd8guwd07raHWvmTCH8lNLnUkj7vg4 X-Google-Smtp-Source: AGRyM1sOE2WPIFJFsR6U7mpP6srFiJqu0xQ+Q5lC3EgTeN0FhW9VEQD0BI0L9tXa4BDMEhOxCGx+hQUlz95pPx27it8= X-Received: by 2002:a05:6638:4883:b0:33f:7948:e685 with SMTP id ct3-20020a056638488300b0033f7948e685mr9043471jab.138.1659470324958; Tue, 02 Aug 2022 12:58:44 -0700 (PDT) MIME-Version: 1.0 References: <20220729105903.xuiw23kpcdphcvel@alvherre.pgsql> <349302.1659191875@sss.pgh.pa.us> In-Reply-To: From: Thomas Munro Date: Wed, 3 Aug 2022 07:58:08 +1200 Message-ID: Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion) To: Tom Lane Cc: Alvaro Herrera , Kyotaro Horiguchi , Matthias van de Meent , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jul 31, 2022 at 3:46 PM Thomas Munro wrote: > On Sun, Jul 31, 2022 at 2:37 AM Tom Lane wrote: > > Alvaro Herrera writes: > > > WFM, pushed that way. > > > > Looks like conchuela is still intermittently unhappy. > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela&dt=2022-07-30%2004%3A57%3A51 > > And here's one from CI that failed on Linux (this was a cfbot run with > an unrelated patch, parent commit b998196 so a few commits after "Fix > test instability"): > > https://cirrus-ci.com/task/5282155000496128 > > https://api.cirrus-ci.com/v1/artifact/task/5282155000496128/log/src/test/recovery/tmp_check/log/033_replay_tsp_drops_primary1_WAL_LOG.log > > It looks like this sequence is racy and we need to wait for more than > just "connection is made" before dropping the slot? > > $node_standby->start; > > # Make sure connection is made > $node_primary->poll_query_until('postgres', > 'SELECT count(*) = 1 FROM pg_stat_replication'); > $node_primary->safe_psql('postgres', "SELECT > pg_drop_replication_slot('slot')"); > > Why not set the replication slot name so that the standby uses it > "properly", like in other tests? Or to keep doing it this way, does that pg_stat_replication query need a WHERE clause looking at the state?