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 1w9zWL-001xoN-2M for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 06:02:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9zWK-00EmI0-0n for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 06:02:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9zWJ-00EmHs-38 for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 06:02:40 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9zWI-00000000ytf-1vaf for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 06:02:39 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so29235715e9.2 for ; Mon, 06 Apr 2026 23:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775541757; x=1776146557; 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=OYtmipF++Qx2nWqWtUV25eDu3r2eJDGI1Gkhz/BG0/A=; b=oJKU6r6R9E0lP1HyVIMv65BrZJF69KnDBC59tg5/d+hTblC5PsxF5cDFtsIbXh9wYV a2UnBWvsnwl5n0wE6guNBUD3Q/EVqh4/EVsDnUi0F3ink3SRSY+wnzahBgvRzyMONux/ IobAabyyVxwdqDsyFYX+8U+WdBHZhVkEOPpmZcOyewocH8SxCPXfBN2dM7oYQJO3mNSZ eCQwqaDDYBXA45vWYXjZYLWbHUebKIYdRRLSahEJckEi2vHZxQpi0PuYw/7kkv5+ZHkO ahUcYZCqIuWl6dOImv3PWzcUAp2dulqxYAKk6ZzpaT9o/CybyYj4NiAa3E9yxkqgq+Mb 4hrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775541757; x=1776146557; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OYtmipF++Qx2nWqWtUV25eDu3r2eJDGI1Gkhz/BG0/A=; b=jrnQS/lYz25YfPyGv++MvT+Lv/qff8PUfifalQUJi+hH4Y1s3D/MxwQC1DHLtQb+gx 0N9lo2m0DmucuTQNChdaJyfZAeraWANwHb2nWG78AaP1vi0lYLoPveQIAi5DrzVINcaB m/JYar3odP119sWN2wB79dkppQKXQn25blmrssjGa9WRpk0Iau2tTd++kOmVU9F6Wt2m EdFIgmfW1ywiJ69Rxd1pHNKv4wmbmKVkMGIWH6DQBcf9aTH0Gd9hY+GN1W/lDJMNEjgv g8pGJ+4Mu3aXfNOG3eKfha49v1v+Jp9l3WhVMwioA7aGS+9qr6xCIoqLO1ZgrFfbpCsX Suzg== X-Forwarded-Encrypted: i=1; AJvYcCWHxy2O48+9GDgoe2TqGk1Asi/fGuZ020U5hHSroheOX1EE4wd8itFFhxBLAKYZhDFhFsfDjUQB/z6qC0Dv@lists.postgresql.org X-Gm-Message-State: AOJu0YzPsdS/ju38GRY3DzvC2QjftbVKPcrcNJ3J9RoC+Nv9GT43xtC0 XsafpTIUqSV51KtxmvSxdQE0DYWjDJITXNol6P7A8ai7Uf3vQXa8SXUa X-Gm-Gg: AeBDievcK6Gzwa4ojxE8QXbKNN5fy2PJIwMzJGtY5dRUjY+NChakwD43KjMrekaArPc W/vYcaPZ+PHDn/ERVDa9Fv1eDuT7Di2rdFpVVo4pqAHx5NCXqjVXfPFrh3B03AESh3efNsXtM7N WaNwv2of+p1Waal2V7Wjvu1ZmJIhmc7UM/8czOWtapErJYyMvvRM8pzeACpyJ2DymOH/dmrxC/9 B2+d7AWzIyyZ0jnCnwMwjvrpXhcpKq7M5ftESLR7g86XBk/2jPlxRrcvZKj0+bA4/7/6DPXKHa3 u7C4FmwfFxURoVi45w26gzbfYXI4H5MccUl0PL23rpS2jm6sFbAW55ymcKkB8QchoT1Sxx1iz7k 2QmPh1/6eB7YWnwmVE2jU4XDjW3gweiy7WS0jFIaadvZJkNHrsDLDNXGJ4doaHcfSKV+HpZj0hW EnUFMcLqjIpEjBbDJVxXp3ixMhN+fMQTw50piXlTGYhd+fTlUxPa4zuEh6/NkLe0p61kCMRosi3 0uF9UZDiiaN3iixT9lKMGMasBIV2FR11mVlmgimX4kjMZy9uFAALb6m2w== X-Received: by 2002:a05:600c:5292:b0:488:8d44:bf98 with SMTP id 5b1f17b1804b1-488996e8254mr233186535e9.7.1775541756991; Mon, 06 Apr 2026 23:02:36 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48899d3a4e9sm221271815e9.6.2026.04.06.23.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 23:02:36 -0700 (PDT) Date: Tue, 7 Apr 2026 06:02:35 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Tomas Vondra , Andres Freund , Jeff Davis , Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics Message-ID: References: <1af63e6d-16d5-4d5b-9b03-11472ef1adf9@vondra.me> 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 Mon, Apr 06, 2026 at 02:11:21PM +0900, Michael Paquier wrote: > On Tue, Mar 31, 2026 at 07:10:51AM +0000, Bertrand Drouvot wrote: > > On Mon, Mar 30, 2026 at 06:11:17PM +0200, Tomas Vondra wrote: > >> Isn't pgstat_lock_flush_cb a bit broken with nowait=true? It'll skip > >> flushing stats for that particular lock type, but then it'll happily > >> reset the pending stats anyway, forgetting the stats. > >> > >> AFAIK it should keep the pending stats, and flush them sometime lager, > >> when the lock is not contended. That's what the other flush callbacks > >> do, at least. This probably means it needs to reset the entries one by > >> one, not the whole struct at once. > > > > Oh right, it's currently misbehaving, thanks for the warning! > > I should not have missed that, So do I... Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com