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 1nce4u-0007zi-ES for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 02:10:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nce4s-0002wJ-Rz for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 02:10:22 +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 1nce4s-0002wA-Gm for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 02:10:22 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nce4p-0000v5-Sw for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 02:10:22 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 125so6526806pgc.11 for ; Thu, 07 Apr 2022 19:10:19 -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=8hYgntH/nRDuGOWRcH8gbkeMKgnwZ5cWaZopDzAxNHg=; b=DHwwoGdKyCQhQt9fZOF4fJO6dvorjTWYRzJnxo5iFyi78Ts0Syx7DcId7FuCQ851H5 i33SfmTbgMCHDWNM0nOWM5Znyeef2SmJkhwtk+lb5ZIcL+y9OtcRy4eWiPRCdvHvoUkE Itcl4ZkbVoYQc9OFgpKURyh0p/bOwLhzmCNSye1y11cEXnk9VLC42aIjLYCqdyfhxtvh VappIAhG0eobWNotz1bfN17jl3WyZv9k5ZnrqhdJs4DqtvREErEgcSLAZBf7B2TVOmxx ERUfggo0/Xxv0pEB0m1qwAqIbjw3Edrv6JwwV5+aW558RGqKAKF7CGjNqA0p4cxQgcWH SE4Q== 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=8hYgntH/nRDuGOWRcH8gbkeMKgnwZ5cWaZopDzAxNHg=; b=zCs0ud71BwfaOHcxktO6FW3e1kZZPCWMrBjl2/QbUMAYEb/F29NsYXr9aZZl2jEIvk 6cuhgqMoNflIBn97Pr/0kOn12APuCODIRA+Ju4WBgAFLbwaSJJoZVHW3uzNdob595yZf eXCp6RCIcLbhNYRQ88FAlKxLmw+2GYIWxwdsfcUaNYKLFz63kLYdkiOFCjUXz3lpa8d/ XJ4D4H62ggTmp0cqHgTd8LMrviIq/xlOdZAga6WUmirHemK/BHZ6MnrbMwj2qLVIJ9l0 Rwv1qb+vE1a0lLnGeNqVgVdLriAQYQIJ7K/l/6HV5hSCU66Kx1/FCM38A+oZaHK7SrpH mjZQ== X-Gm-Message-State: AOAM532ktmR0Qovvmq3hjbjr39W/sEKPLjE7BMqVA6foGOaD8azexKTi VqM2BP6TcFPlIERc+ObO2yaODbSP1ZKRsw== X-Google-Smtp-Source: ABdhPJwcl/mYVK2hZQhFtgdgtZowp8dw/vQqlTJTvf0wFhjGZ3Mg+yl1vgEkuz5ClsmDQ8bFnogrfg== X-Received: by 2002:a63:354f:0:b0:398:4ead:866e with SMTP id c76-20020a63354f000000b003984ead866emr13912290pga.322.1649383817655; Thu, 07 Apr 2022 19:10:17 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id o3-20020a056a0015c300b004fb24adc4b8sm24038429pfu.159.2022.04.07.19.10.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 07 Apr 2022 19:10:17 -0700 (PDT) Date: Fri, 08 Apr 2022 11:10:14 +0900 (JST) Message-Id: <20220408.111014.1139039683831064200.horikyota.ntt@gmail.com> To: andres@anarazel.de Cc: melanieplageman@gmail.com, pryzby@telsasoft.com, thomas.munro@gmail.com, david.g.johnston@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: shared-memory based stats collector - v70 From: Kyotaro Horiguchi In-Reply-To: <20220407233751.i573vgmuwicphd2t@alap3.anarazel.de> References: <20220406030008.2qxipjxo776dwnqs@alap3.anarazel.de> <20220407072845.mwz7ybaode32kk26@alap3.anarazel.de> <20220407233751.i573vgmuwicphd2t@alap3.anarazel.de> 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 Thu, 7 Apr 2022 16:37:51 -0700, Andres Freund wrote in > Hi, > > On 2022-04-07 00:28:45 -0700, Andres Freund wrote: > > I've gotten through the main commits (and then a fix for the apparently > > inevitable bug that's immediately highlighted by the buildfarm), and the first > > test. I'll call it a night now, and work on the other tests & docs tomorrow. > > I've gotten through the tests now. There's one known, not yet addressed, issue > with the stats isolation test, see [1]. > > > Working on the docs. Found a few things worth raising: > > 1) > Existing text: > When the server shuts down cleanly, a permanent copy of the statistics > data is stored in the pg_stat subdirectory, so that > statistics can be retained across server restarts. When recovery is > performed at server start (e.g., after immediate shutdown, server crash, > and point-in-time recovery), all statistics counters are reset. > > The existing docs patch hadn't updated yet. My current edit is > > When the server shuts down cleanly, a permanent copy of the statistics > data is stored in the pg_stat subdirectory, so that > statistics can be retained across server restarts. When crash recovery is > performed at server start (e.g., after immediate shutdown, server crash, > and point-in-time recovery, but not when starting a standby that was shut > down normally), all statistics counters are reset. > > but I'm not sure the parenthetical is easy enough to understand? I can read it. But I'm not sure that the difference is obvious for average users between "starting a standby from a basebackup" and "starting a standby after a normal shutdown".. Other than that, it might be easier to read if the additional part were moved out to the end of the paragraph, prefixing with "Note: ". For example, ... statistics can be retained across server restarts. When crash recovery is performed at server start (e.g., after immediate shutdown, server crash, and point-in-time recovery), all statistics counters are reset. Note that crash recovery is not performed when starting a standby that was shut down normally then all counters are retained. > 2) > The edit is not a problem, but it's hard to understand what the existing > paragraph actually means? > > diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml > index 3247e056663..8bfb584b752 100644 > --- a/doc/src/sgml/high-availability.sgml > +++ b/doc/src/sgml/high-availability.sgml > @@ -2222,17 +2222,17 @@ HINT: You can then restart the server after making the necessary configuration > ... > > - The statistics collector is active during recovery. All scans, reads, blocks, > + The cumulative statistics system is active during recovery. All scans, reads, blocks, > index usage, etc., will be recorded normally on the standby. Replayed > actions will not duplicate their effects on primary, so replaying an > insert will not increment the Inserts column of pg_stat_user_tables. > The stats file is deleted at the start of recovery, so stats from primary > and standby will differ; this is considered a feature, not a bug. > > > Agreed partially. It's too detailed. It might not need to mention WAL replay. > I'll just commit the necessary bit, but we really ought to rephrase this. > > > > > Greetings, > > Andres Freund > > [1] https://www.postgresql.org/message-id/20220407165709.jgdkrzqlkcwue6ko%40alap3.anarazel.de -- Kyotaro Horiguchi NTT Open Source Software Center