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 1nFKVo-0007LM-0D for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Feb 2022 18:37:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFKVm-0007Bi-8z for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Feb 2022 18:37:46 +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 1nFKVl-0007BZ-TU for pgsql-hackers@lists.postgresql.org; Wed, 02 Feb 2022 18:37:45 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nFKVj-0001Oh-3u for pgsql-hackers@lists.postgresql.org; Wed, 02 Feb 2022 18:37:45 +0000 Received: by mail-pj1-x1033.google.com with SMTP id my12-20020a17090b4c8c00b001b528ba1cd7so364683pjb.1 for ; Wed, 02 Feb 2022 10:37:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WWEgcgevjRIFHT/IXLqKIL0OBSDcCngThN6D9Btlr3o=; b=q6AGQZwn/GhYLOtrJVTlsxCwMYXYR3R89F4IpUjq10TpwDaRaYmIddJJSQaJ6dXXKU skvJXSZCx1u15UQLU8PxUl3f9umcoFbXRCA5QpOutSLzGsZc5xBUYcxMyW/19+xHRTrF 5Y65C+IdU976SaByOJabZSUSqwlvwTZCb+FT4F9yoBjtL1h21tD3WSqeBbcDMNrZNleK CgGfn3hTqz2OfXSbdKhn3xpS9MBp20jSWVIisnacB/IQ2e1DqxSr/t1jb8ljoECyNbnv bDQv4Ayz1cDGnQKdrDlRa9bRW4wLAgSlAkE59U4XZfe+zZzCM3DEWhgc4H77aLnBmZ07 4qnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WWEgcgevjRIFHT/IXLqKIL0OBSDcCngThN6D9Btlr3o=; b=jolLh63J6eZkrVL10PW+A201BOaYepBxwarLcDxjcoILQp5JezSgorO8iO/a2bfujJ jwE0JOS5NRBz4Tkse3mmIbns5m7TaFRZJxHcXECwNLoCbrWHEjsSpZn96DmMgsntq2vQ XReMSx0+AfqseXMmzzVF92hDjXzJ0tMwhofA3cIBma2V88c4T5RGyJXUw/7CBkUEb4bS Uj1JWcJXR/+EYhUggeZG+g6e4g0COkhkCAdiZluUdjIFEl+HRYH5AfGgQw1vhqS94e2G QMOEkpAR5lZbbENhsQbhTs6/2KyEOhqh5WCC3CnrmemL4U2K+1HoPXJxykATA3XbMp5x MwQQ== X-Gm-Message-State: AOAM532BYfw5sgEw29ArDmreQMIdJnpaaJMWq9NpezoDScKdEtLK/Ylz bFts5hhcqrZvnT7p2FQ/H9k= X-Google-Smtp-Source: ABdhPJxzn127TBxd6XGTYe3D4zhESOI7gyhtL7UH3y0jNk2nt/A7QIcUDV4q0ZXCYj0gHVGyrWk19g== X-Received: by 2002:a17:902:d4ca:: with SMTP id o10mr31701678plg.29.1643827060670; Wed, 02 Feb 2022 10:37:40 -0800 (PST) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id oa5sm7581125pjb.0.2022.02.02.10.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:37:40 -0800 (PST) Date: Wed, 2 Feb 2022 10:37:38 -0800 From: Nathan Bossart To: Bharath Rupireddy Cc: Andres Freund , "Bossart, Nathan" , Tom Lane , Julien Rouhaud , PostgreSQL Hackers Subject: Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work Message-ID: <20220202183738.GA746893@nathanxps13> References: <773619.1642632823@sss.pgh.pa.us> <21F86990-CC52-42B2-8A85-A3DA110F57F1@amazon.com> <20220120194618.hmfd4kxkng2cgryh@alap3.anarazel.de> <614DB439-2AB6-4EDC-8CE0-159C7FEB21AB@amazon.com> <867F2E29-2782-4869-970E-B984C6D35A8F@amazon.com> <20220121194956.br76car5qzqhji5s@alap3.anarazel.de> <20220127010109.GA352793@nathanxps13> <20220201235538.GA740616@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Feb 02, 2022 at 05:19:26PM +0530, Bharath Rupireddy wrote: > On Wed, Feb 2, 2022 at 5:25 AM Nathan Bossart wrote: >> However, I'm not sure about the change to ReadDirExtended(). That might be >> okay for CheckPointSnapBuild(), which is just trying to remove old files, >> but CheckPointLogicalRewriteHeap() is responsible for ensuring that files >> are flushed to disk for the checkpoint. If we stop reading the directory >> after an error and let the checkpoint continue, isn't it possible that some >> mappings files won't be persisted to disk? > > Unless I mis-read your above statement, with LOG level in > ReadDirExtended, I don't think we stop reading the files in > CheckPointLogicalRewriteHeap. Am I missing something here? ReadDirExtended() has the following comment: * If elevel < ERROR, returns NULL after any error. With the normal coding * pattern, this will result in falling out of the loop immediately as * though the directory contained no (more) entries. If there is a problem reading the directory, we will LOG and then exit the loop. If we didn't scan through all the entries in the directory, there is a chance that we didn't fsync() all the files that need it. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com