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 1ngxP3-0002ko-7A for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2022 23:37:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngxP1-0002mO-LC for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2022 23:36:59 +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 1ngxP1-0002mF-9B for pgsql-hackers@lists.postgresql.org; Tue, 19 Apr 2022 23:36:59 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ngxOy-0003CO-Rj for pgsql-hackers@lists.postgresql.org; Tue, 19 Apr 2022 23:36:58 +0000 Received: by mail-pj1-x102e.google.com with SMTP id mp16-20020a17090b191000b001cb5efbcab6so3338254pjb.4 for ; Tue, 19 Apr 2022 16:36:56 -0700 (PDT) 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=eCJMInfuaU2cw7PZltEk9WeicJEwDAq8im323ETMh68=; b=XdjJGemJwPy1dVFCFLx9hBgu915To0LhRE0HBd3VPtzcOnqYyHXbwFV5NrTU/Qep+R m9ajHhhum+pbjrK+vwKouw/LXJIGgoyRZjeaPIwSBeqc6CdDNg4EVLNCL/Qj44XpyZn/ +m/Jm9d76cjiBJwCouNUj/pLPRDVW+4W3aArgpUwXXCPm/1zde9Gze9D87EeQEYgHB0E 0fUqUtGRChVAtgj5wXas5U//TII3bpx/pUI6zr5tqd//RHRmfMIjjapufV8dX3o6DX3W tL27TX7fJts/IGwF/Sn+PBO/wff7jeaAFaxaRombsGXU0/nsBACRAEPs7G+Ut/W8Wbm/ Dtqw== 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=eCJMInfuaU2cw7PZltEk9WeicJEwDAq8im323ETMh68=; b=VVknX+6G6ebdUNL4uye0Lh7mT7NDoXktM5ZBuPAbz6Q9b2TNi+hKrg7Ul1X7Dyv/qI 0Z76/vEpHkq6nrJpMopuYUNfDUBSm8Gm18apBvap5tbwr7CAZNM6Y6T6lcIzhkqaeiSX P86Xz+s2hxUJVQa3GjKODZt7rEYE3xASKzxHccbXNLA28VgeptbC4ujQEQykVtGqeT6q 4pkslGvFoM6+akETpcb37yXP1E9PYx7kfhGkel1dg1KBsYkgg4s0LK4Bie6PnI7kKN33 nZq7cC4BOb9nu2HfJxBfC9BmooNvGichmYnR/q6V4uesjgeujFedzzFaLjT/8RRixpTx 2xGw== X-Gm-Message-State: AOAM532Xeeyv1VZnRAO5/G22kkPOLAcGRl8oyh5MeZfrTT8upLJY+Kr5 XvdJ0U53jjglksN19gYICTo= X-Google-Smtp-Source: ABdhPJx3mXhnxNan9GdbhY0LF90sie1DEbfNCf78sg3dJl8vsTuAICvIgDiBa5UeU3+Ti3I9iQuKuA== X-Received: by 2002:a17:902:bc8c:b0:151:8278:d2bf with SMTP id bb12-20020a170902bc8c00b001518278d2bfmr17969485plb.114.1650411413990; Tue, 19 Apr 2022 16:36:53 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id w9-20020a056a0014c900b004fb2ca5f6d7sm17705566pfu.136.2022.04.19.16.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 16:36:53 -0700 (PDT) Date: Tue, 19 Apr 2022 16:36:51 -0700 From: Nathan Bossart To: "David G. Johnston" Cc: PostgreSQL Hackers Subject: Re: Odd off-by-one dirty buffers and checkpoint buffers written Message-ID: <20220419233651.GA2578385@nathanxps13> References: 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 Tue, Apr 19, 2022 at 04:21:21PM -0700, David G. Johnston wrote: > I've done this four times in a row and while the number of dirty buffers > shown each time vary (see below) I see that "wrote N buffers" is always > exactly one more than the total count of dirty buffers. I'm just curious > if anyone has a quick answer for this unusual correspondence. I see that SlruInternalWritePage() increments ckpt_bufs_written, so my first guess would be that it's due to something like CheckPointCLOG(). -- Nathan Bossart Amazon Web Services: https://aws.amazon.com