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 1wAX9S-00049s-1y for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 17:57:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAX8R-0013tY-35 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 17:56:16 +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 1wAX8R-0013tQ-2D for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 17:56:16 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAX8Q-000000002kd-1O77 for pgsql-hackers@postgresql.org; Wed, 08 Apr 2026 17:56:16 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-7d9b21d1461so26750a34.1 for ; Wed, 08 Apr 2026 10:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775670972; x=1776275772; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wveTS6SL26U6J+0Y03oefAopCW820vRBl3PoVXQ3xDc=; b=pqFxE9mDpMepRyqnlc+x+Q9x+X2SpGpjkLXTSA7LTLyD0xftYw8O/W5btVMUUB5MJG tnULZOMDXQJH8GKprl5xAEpEva0q3otVcR30zC/hg8OG5QJ8bju0ehXmC/U5MoeOiiG/ 298FU9EbXg0dtbAE0f/6jEpdZlPSSTXA6xx2TQDUEfBYVAf7osMXprjq+d9zR5CYV8ge aBdP98iryU+fOEtfVAwIW6lYcJIPYapIUEe7h+ieEXOK5UXUlwIGLLavxDm/grtRDxtw 3hBfEVCpCPdPzmKR08kZAwVJWSzhm3masRuSaufZHKAWWnhTVLB99GlaJZisLs3gxQgq 7tqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775670972; x=1776275772; h=in-reply-to:content-transfer-encoding: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=wveTS6SL26U6J+0Y03oefAopCW820vRBl3PoVXQ3xDc=; b=aEDkawb/OQD89CrJCBBKSIb2+bYLIWH1yD44yQ8E8UfWshpH6lE79eGmY7nN6J4KCf NtPXZ3NxfQ269ercAaiNJjCs3YgYugb1iApdU2GumUu03o7077rGHeN8yegzbqsMNOOF OoIKwPX2GevkBfB7sokZKQ48fOmiI+5Vtd7p/U8tgmeH9G4tX2hMCY3WnQcTm04WbQ4j JM3qmFIKtB3B4nHQVK0WE2MeAxruiDZ5bojHTfLeGpHmDxm5HdVSDMbneh57cmmuTVdA YYtbGVehpsAhKU7ivvnshWGb0e+aVs6BWhbFDT3oQ8tSzcUCTov8V6jSW5b3ki/0Id8Y yH1w== X-Forwarded-Encrypted: i=1; AJvYcCVF7Of90s09C6EIF3flmqa1kLqmyWUPCM8SwAmAnFCuBwA1K9WymBUNSLiMDA8OvO8WnzP6PoRW616F0Ukk@postgresql.org X-Gm-Message-State: AOJu0YzKBWvn+qfEEwQ/0zhxLABX0Z+vEpMoVILVPHLA3sJgihwDaqVr AFjPe51TKPiCXM1Ik7onKngbpUEbQkszo8xuvr10+FMGmOiTSuB6g7MO X-Gm-Gg: AeBDievahfGBQ5D98IjNbt/zmcX+K/kydKiAb2EsLuFMbxWdXTzjcz+yqNRQJ29Ghge S0aetAU5eLTlYMjPZK62rSLQy7+cRutThuOZBArHWMwMvNsnRMHgS7DOVfifKuCupdqEZMkQGwm 7X72hiIcqQ+/FeCO4l0w2IP4cXfIgfXdLt/uwFHkdJvFQkQEPDR/9sAphQXHuHK+DIr23wSyrBB 8+FXNh+OD6y7S6vWBENR7kWrUaBojUOPQun2y0XQm2SfpnF/pcRF7tuVbccnDy6Ln2jITYBpwwA UxwU33qFV8y76qBUfyZqLQKKCTh1ygesZweUn8IbhLSORe8LKdPItqnqj0CrUfSa2WJk7uUEbsz 2E+dH56mZ3f2S4HpzLBvTsxzCZc/JKvUWXR5dMqYJdQ8e+HxfvyPRWtNxV8NRJ58ekEbjDkVwQx 97zBJ0BdSxC4nPafw3JYxs+6wIXxv2U7cKKI2x5KWEak7uOWY3a3SuUax4Pi5IoDg8lk200rX46 7nk4wQk9518cgLwfpKJlg== X-Received: by 2002:a05:6820:81c3:b0:67d:e78f:38d2 with SMTP id 006d021491bc7-68a6b73b02amr188967eaf.25.1775670972112; Wed, 08 Apr 2026 10:56:12 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-683f73389besm7260134eaf.5.2026.04.08.10.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 10:56:11 -0700 (PDT) Date: Wed, 8 Apr 2026 12:56:09 -0500 From: Nathan Bossart To: Tom Lane Cc: Alexander Lakhin , Sami Imseih , Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers , tndrwang@gmail.com Subject: Re: Add pg_stat_autovacuum_priority Message-ID: References: <5684f479-858e-4c5d-b8f5-bcf05de1f909@gmail.com> <3077290.1775668665@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3077290.1775668665@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 08, 2026 at 01:17:45PM -0400, Tom Lane wrote: > Alexander Lakhin writes: >> Please look at a new anomaly, I and SQLsmith have discovered: >> SELECT (SELECT score FROM pg_stat_get_autovacuum_scores() LIMIT 1), >>     (SELECT score FROM pg_stat_get_autovacuum_scores() LIMIT 1); >> ERROR:  detected double pfree in PgStat Snapshot 0x5f6fa4d95d50 > > Good catch, but you're not the first: > > https://www.postgresql.org/message-id/CAHewXNkJKdwb3D5OnksrdOqzqUnXUEMpDam1TPW0vfUkW%3D7jUw%40mail.gmail.com Hm. I can't get excited about checking pgstat_fetch_consistency (as proposed in that other report), but I see that commit 02502c1bca added the freeing behavior in question. I wonder if it makes sense to just skip freeing when relation_needs_vacanalyze() is called from the view, i.e., not an autovacuum worker. On the other hand, maybe we shouldn't be caching entries for a view like this that looks through all tables in the database... -- nathan