Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6by-00014L-0w for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:29:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wi6bw-00Gp4d-2Q for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:29:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6bw-00Gp4V-1b for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 08:29:29 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wi6bu-00000000caZ-2g70 for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 08:29:28 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id B821E640F80 for ; Fri, 10 Jul 2026 10:29:26 +0200 (CEST) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id A900E63FB70; Fri, 10 Jul 2026 10:29:26 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s980.loopia.se (Postfix) with ESMTP id A7B702201656; Fri, 10 Jul 2026 10:29:26 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s472.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s981.loopia.se ([172.22.191.5]) by localhost (s472.loopia.se [172.22.190.12]) (amavis, port 10024) with LMTP id C5MCF_Upg0_7; Fri, 10 Jul 2026 10:29:26 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s981.loopia.se (Postfix) with ESMTPSA id 1B71222B1773; Fri, 10 Jul 2026 10:29:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1783672166; bh=V4LWnvAejI6O2wGISaU49XHtl7U3MrwS/dYAV2VnR18=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=owgEIH41bJhitYLanBxZ7WrVsPWBnWpyhLmSCYKEzAvJuhBej6uqfAv/sc5UaVxZ/ FiMq+ZwEx/R9Wa/khQ66lmrYOu51UPAo9gi3WRE8aPSH0JZQgjgiYRKXbc3+6I7llW DSgP+vPTscXq4s8DZmgP6Yzk7choqc/lMDNN3lvRn1Fc0xaVV0YGHZ3gW2GeNnRy2n ASphI3a+uzvsaeWDlZW8dPtvUjMcpKwZHl1Cx08qEPgUVlZDJ61XAZd/8oE0zG0ERq hMICuqNv/h49LlC5D9g7/T76T3ljwoCoC8tjlrdhd+NkWK93QrX7Tz9zRgfM2DweZL z6B17QZJROW6w== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.12\)) Subject: Re: Fix pg_stat_progress_data_checksums counter initialization From: Daniel Gustafsson In-Reply-To: Date: Fri, 10 Jul 2026 10:29:15 +0200 Cc: PostgreSQL Hackers Content-Transfer-Encoding: 7bit Message-Id: References: To: Fujii Masao X-Mailer: Apple Mail (2.3776.700.51.11.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 10 Jul 2026, at 09:13, Fujii Masao wrote: > The attached patch fixes this by initializing all data checksum progress > counters to -1 immediately after progress reporting starts for both > launcher and worker processes. > > While looking at this code, I also found that blocks_done is not reset > when a worker starts processing a new relation fork. As a result, > blocks_done can temporarily exceed blocks_total, or a stale blocks_done > value can remain visible for an empty relation fork. The attached patch > resets blocks_done together with blocks_total when starting each > relation fork. LGTM, thanks! -- Daniel Gustafsson