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.94.2) (envelope-from ) id 1tY5ob-003U9W-Do for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jan 2025 16:00:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tY5oZ-00DWia-0q for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jan 2025 16:00:19 +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.94.2) (envelope-from ) id 1tY5oY-00DWiR-MI for pgsql-hackers@lists.postgresql.org; Wed, 15 Jan 2025 16:00:19 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tY5oW-000Zhe-1m for pgsql-hackers@lists.postgresql.org; Wed, 15 Jan 2025 16:00:18 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361f796586so73097675e9.3 for ; Wed, 15 Jan 2025 08:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736956814; x=1737561614; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2tIskkgRWRZ1Kxf6QwemOHh7CMgk0GkcPsc5RHjjZKM=; b=Eahv+454mcfEA9QSgv5NK78FkAgbVAGxoqAXc+2zPUoHB4KV82kHcC2TbrvDWBP0Xy TcoZPMo94s0LPRPEL996up+lz9CY4/l+Hqfh2lUNKL5PR+ak7c8ra0ZjURFHDJHBZpgF 0llW3JRXpjhm+HL+nbduW5fK/qSAeiYCnzitRVoZtT8XdCa+9WX3E1jy7fpBA21gNnXF EmosZ8dypKvrhVV79PyRlyl+AAkco3O3JVdi5xO+ezGoIc8pmTIJCa2zenkxG0Sm/ZjX KSIjg/hprJL3oRdJSfCRnvedqgC9WDuIoAMT9iw9y+6UK9fivXEO927Cum4xKOfIfuub TJeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736956814; x=1737561614; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2tIskkgRWRZ1Kxf6QwemOHh7CMgk0GkcPsc5RHjjZKM=; b=k9fdCr6AC7MwtUYn4pMOOifKbt/b/mNSNtD2G91wNmpf4WbQg/sld6FNJky6lHsJU6 hjX6bBtkMLSJPCJZFZgSbRlAQ+GstReHrBH3YVvucLqD1OAi7uuO8ioKEql1cxM9R7uk Ti7Ruy51zPpNy0U9Wz4D84T49vTz2+JSvMAeWHj2B7mebPXql3teqPC2YGptg8QRumt8 W5vmHIAnz+dFiUW/hKvItctGHYmxQydr9e3dPvahK0hvkV8I5RDy/JMCF8HxTsol3DLq v2SMepOLJC9QGOfVJVuLSlfbg0DCUPPbcl7/duLrRXkHoZMdOnowANJmzgIFjk52wDv1 cxog== X-Forwarded-Encrypted: i=1; AJvYcCVaZaWaBsU9dDaZQYuXjveidnhTCnV0VR9ymIM3Wje9xeW3pHmRISHkUr6fHdkpxU/8wGTsGgPM+Zwt2BG0@lists.postgresql.org X-Gm-Message-State: AOJu0YxWBke/+xi4RLBe6Er4COUFNDfrDH32R4ezmrC0Kqc5S8niU4NJ BENxYkyvOjlfVQ3gqu+lwaL6JVl1WY8vZW6lM4qbId9BWZjy8dqZ X-Gm-Gg: ASbGnctjpoLftsN/PdHMp/6KfSCtp0O+9C0q5MX08j7U9W6LNiXD986LsnRWMUnlL8z zMqN/eCRY5F+ZNZKegZzcBf4vQxzpUFgFNbXolVExiQ5wGRhxGb0uPhHY+0Kn6a68jp5GZ/xrmN Ek6LQROuHL4BpeXk0FxdliPJBT8HQdDuXFJKjRtFYfyGSEc73sG54vq4ab0MWrpy5smfM1wzm1y tAv0AkFTjh8OlnAVoTR05KTXRsmkEaa8TLbws9rUx6gRP8JCa4OhokqPPzDpYlraQWa4qzzmyxb PYEjUxnPZ4jFPfIJwJ9Ll2ib3/hQwecYK8W99+evYkBLoPPGidzC61PAKeRSR5TCZ7ZqhlVYZJy CgVZWrXI= X-Google-Smtp-Source: AGHT+IH2VTxVsmIkFuEEjUE/Hem+SPzGrFguNNz1IijnRRwZpRQpn9HEPFJ0Xd8xopi5b4WZbFZiBw== X-Received: by 2002:a05:600c:4f4e:b0:436:1ac2:1acf with SMTP id 5b1f17b1804b1-436e26e28cemr264094635e9.20.1736956814256; Wed, 15 Jan 2025 08:00:14 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74ac207sm27883815e9.12.2025.01.15.08.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 08:00:13 -0800 (PST) Date: Wed, 15 Jan 2025 16:00:12 +0000 From: Bertrand Drouvot To: Nazir Bilal Yavuz Cc: Michael Paquier , Alvaro Herrera , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, Andres Freund Subject: Re: per backend I/O statistics Message-ID: 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 Hi, On Wed, Jan 15, 2025 at 05:20:57PM +0300, Nazir Bilal Yavuz wrote: > While doing the initdb, we are restoring stats with the > pgstat_restore_stats() and we do not expect any pending stats. The > problem goes like that: > > I was a bit surprised that Bertrand did not encounter the same problem > while working on the 'per backend WAL statistics' patch. Then I found > the reason, it is because this problem happens only for WAL read and > WAL init IOs which are starting to be tracked in my patch. By saying > that, I could not decide which thread to write about this problem, > migrating WAL stats thread or this thread. Since this thread is active > and other stats may cause the same problem, I decided to write here. > Please warn me if you think I need to write this to the migrating WAL > stats thread. Thanks for the report! As it looks like that you hit the issue for "WAL read and WAL init IOs which are starting to be tracked in my patch", then I think it would make more sense to mention the issue in the "migrating WAL stats thread" so that one could try to reproduce it (with a patch producing the issue at hands). So it seems to me that the "migrating WAL stats thread" is a better place to discuss about it. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com