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 1na8nY-0003zN-60 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 04:22:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1na8nW-0002qu-1N for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 04:22:06 +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 1na8nV-0002qk-Mr for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 04:22:05 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1na8nS-0002eP-Hc for pgsql-hackers@postgresql.org; Fri, 01 Apr 2022 04:22:03 +0000 Received: by mail-pg1-x533.google.com with SMTP id c11so1448038pgu.11 for ; Thu, 31 Mar 2022 21:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=G2+zfMMzp5jtTB+/WpKp+py4TocgpMhtCfxULXnZS00=; b=YQ6BGPbpQhlL8+nMaBw1ejOOJGinCpuEUDpFQVuek0o64pKdFvFVFrJlVq8NLP/tXX Kf3WPWM8+50pzRGOprYA31Bg0oU0jaJramVpIU1D2BoB+g+hQxrWl6vlBmUtUZWSDXEa CqTTtWsfMNpDQrpOkOGOwjbfVfeEOmhVU5b5cfP3dYRo35t6g8Zi75c4Vnzx4o9V9EFE 6i7dH2o9dRCaExQvDbj49FxMhiY7D5LEuFIW2R1/KWmvXTAP15szJakDcgFKJn0r9Sqb AAQeCadxtQENljiKustMlCn7Qu2RGBtEm1HabSCg8YDCF4kTuGSdykAPNQzuiKpMTbYE dY1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=G2+zfMMzp5jtTB+/WpKp+py4TocgpMhtCfxULXnZS00=; b=c+97xrYOxqMdegygGP299VA9zSb7L0x75uHWa+TvyIUfbDDRvaQ9uWhVz+HzHQM5Ms X//4RT89SxbOvXV6NjHFF5/TI4JYhESCjEHmRWgla+lWhszaMMiaa7lCl0c9tIqmS+JU ZkZHIv/cAq4FdLYY3vQ7RX8ons9dyeKXw10bq6uf9l+495w25RjTCLIJFCKJah2yhIkn KXV4jqdpBNQNtNntsij9/409hPZrBUQhVu1ZUd03keRW8xAuF4d2L4D3j1V2aEDmWUB2 TRgQrpZo2sdOEDo3VITiKt7UqoH1QShwvwWYjZtsCqdb+gd17Vs3yAGehJLvWseT2W6Q Hkjw== X-Gm-Message-State: AOAM533InLWWFqFb5gplDnmh9wQOwkNtzbE2iX9cBIeowlz8JIe3/VtD HzGk+1KG6TPjPXpf+wNupf4= X-Google-Smtp-Source: ABdhPJxNArmLut7aZ23kdfeoq1SwPjyhSj36ZvTjYREd8u+LExmgvCF10dMH6TpMb9/P4R/9JwPC0A== X-Received: by 2002:a63:3f0e:0:b0:386:1d94:312a with SMTP id m14-20020a633f0e000000b003861d94312amr13545460pga.317.1648786921317; Thu, 31 Mar 2022 21:22:01 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id l67-20020a633e46000000b003986e01e982sm854353pga.67.2022.03.31.21.21.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Mar 2022 21:22:00 -0700 (PDT) Date: Fri, 01 Apr 2022 13:21:57 +0900 (JST) Message-Id: <20220401.132157.1998467224568735059.horikyota.ntt@gmail.com> To: robertmhaas@gmail.com Cc: alvherre@alvh.no-ip.org, michael@paquier.xyz, rjuju123@gmail.com, pgsql-hackers@postgresql.org Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion) From: Kyotaro Horiguchi In-Reply-To: References: <202203291328.jpagzownc7r7@alvherre.pgsql> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Tue, 29 Mar 2022 09:31:42 -0400, Robert Haas wrote in > On Tue, Mar 29, 2022 at 9:28 AM Alvaro Herrera wrote: > > OK, this is a bug that's been open for years. A fix can be committed > > after the feature freeze anyway. > > +1 By the way, may I ask how do we fix this? The existing recovery code already generates just-to-be-delete files in a real directory in pg_tblspc sometimes, and elsewise skip applying WAL records on nonexistent heap pages. It is the "mixed" way. 1. stop XLogReadBufferForRedo creating a file in nonexistent directories then remember the failure (I'm not sure how big the impact is.) 2. unconditionally create all objects required for recovery to proceed.. 2.1 and igore the failures. 2.2 and remember the failures. 3. Any other? 2 needs to create a real directory in pg_tblspc. So 1? regards. -- Kyotaro Horiguchi NTT Open Source Software Center