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 1psHFd-0002gK-5n for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Apr 2023 06:06:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1psHFc-0006UU-45 for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Apr 2023 06:06:36 +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 1psHFb-0006UB-Rq for pgsql-bugs@lists.postgresql.org; Fri, 28 Apr 2023 06:06:35 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1psHFZ-005WZB-4b for pgsql-bugs@lists.postgresql.org; Fri, 28 Apr 2023 06:06:35 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-63b8b19901fso11307192b3a.3 for ; Thu, 27 Apr 2023 23:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682661991; x=1685253991; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=EMvBxnSC0ysrAiwG7UB3IlkoZLbtWo0BRFNDnHEL9A8=; b=BkdMKG7u6hGpGcgX/Y6TlcNo6gYFS+/TJlh4KdXVRfNHx7oEv4exrzoS9cEzSe1iTq hN5uqJIckErqnEBkbly477z+ywNSYagDHUMt2ZhY6TcRDgCX8j5J9As9jx6AejbUMUmn 9ktEG0uGooJzDcTcnaMwSxD3Cldo14eHaD3fPe0y3uV9sZhm8UXi/ZNrCFN+UABH9U2S T6qcMpd7Y9N9/yqMhGqCusTPM79vMn1j2cyud5gZN8DYadZBE7Bu5tAGRLdg6TGZ9fvS Xt8KdGbGfeEr0U9w2SkrhHkwdA8Ir3wdTkLp5WAdfnY1QZZP7URCFWiHf1+QzcZHsFBU NCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682661991; x=1685253991; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EMvBxnSC0ysrAiwG7UB3IlkoZLbtWo0BRFNDnHEL9A8=; b=G7V2+XtvKGEwuNWGVNYrKbtmAlvNC/FGll+6UQfZURJwOEKOAD5ZLtUdkn2zND9eix Upb722+AF3TJzMnEgnPONFYdVzSU/mZPF3oXSeh+UdkEy+1fixNW8xIgnGLxmH6+fAlI IEhEL83zceUPDVi4eoUZTWUN36LhSM2t45lPwmS5b06vA0hDn+wuzDFNW5XFWtpnrjUH 0bUeGAoaKdU8jmD1vHcdZCvqeHVZ8KRk9NcuZbr+0oQdLX1QQ9iSHvacisR2Ffavhahs QQHAnuBK/IitniXDE3p4khbpLgQRRO8fSKeo7zTwbKtRZxFB7QEF7RcxWPsZ73O1p8eI A0Og== X-Gm-Message-State: AC+VfDz+wODelRNWyGYuCgx2+K+12zWC3USdmZzXq4TB7skSaEeyfgrN ZCmAvvLgiaflfXwGCxpCIdw= X-Google-Smtp-Source: ACHHUZ6K+GNLQ6g7tjBbeaXFiRxKvDK9lWNEPfr5bmQRp+YomDqOPNwrD6RVohkWyBrnmAom0k06rw== X-Received: by 2002:a05:6a00:c8e:b0:63d:2d99:2e7c with SMTP id a14-20020a056a000c8e00b0063d2d992e7cmr6623019pfv.0.1682661990847; Thu, 27 Apr 2023 23:06:30 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id p8-20020a62ab08000000b0062e0010c6c1sm14159164pff.164.2023.04.27.23.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 23:06:30 -0700 (PDT) Date: Fri, 28 Apr 2023 15:06:28 +0900 (JST) Message-Id: <20230428.150628.727832009396744479.horikyota.ntt@gmail.com> To: michael@paquier.xyz Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17804: Assertion failed in pg_stat after fetching from pg_stat_database and switching cache->snapshot From: Kyotaro Horiguchi In-Reply-To: <20230428.150404.2168290194163999912.horikyota.ntt@gmail.com> References: <0d45c9c1-17a1-932f-3925-86484f150c94@gmail.com> <20230428.150404.2168290194163999912.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 27.2 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 Fri, 28 Apr 2023 15:04:04 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 28 Apr 2023 13:37:23 +0900, Michael Paquier wrote in > > FWIW, I was looking at this patch and this proposal of relying on a > > static flag to conditionally clear a snapshot looks rather brittle by > > design to me because this relies on quite a few assumptions that the > > snapshot will always be cleared when necessary, as proved by the two > > code paths of pgstat.c patched where each gain a check on > > pgstat_get_stat_snapshot_timestmp() necessarily requires that. Just Sorry, this is actually the opposite. pgstat_get_stat_snapshot_timestmp() doesn't necessarily requires that. Just > for seeming consistency. The only significant part is > gstat_prep_snapshot, which is always called when the caller wants a > snapshot. Regards. -- Kyotaro Horiguchi NTT Open Source Software Center