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 1tIDWZ-00CyV1-O9 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 21:00:07 +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 1tIDWW-003QSE-SM for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 21:00:06 +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 1tIDWW-003QRg-Hn for pgsql-hackers@lists.postgresql.org; Mon, 02 Dec 2024 21:00:05 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIDWV-000iGx-0t for pgsql-hackers@postgresql.org; Mon, 02 Dec 2024 21:00:05 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso3809684f8f.1 for ; Mon, 02 Dec 2024 13:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1733173202; x=1733778002; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mjtUQhzwG/bOAR8h8SV0HXIo6CbJZdDJc42j2YfDx3E=; b=OSdhWONsNIxS41RB1E4bcjdtBAp6252bl3/cJeM+F+040RC9Pcf+Y8exA8iYpKiy3S 0Z35scboeuEzFqSxq3wFK5tF7vL5qlY+eHsWttzl98a1OqoyjZJto3iqzZa2V7osBT8T EU7mVofJuCmIGPW/43rbG1iXtIUMWgvedvvPQdzOflqjAeRncVHEjUFzJ4BeE2N6Vpyw W/VuY1rLtnIrrGEdzt4cbWUk1RiEyG4KPQ8KyGHasgFML/V7ADI5Od/DKsdmS+UbQLkW WuejvqezJAWTD94cC1piUy3aZCsREFMFvCuaYWwrDbeNYVetLSemg1wP956yVdQkiWaB 1vuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733173202; x=1733778002; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mjtUQhzwG/bOAR8h8SV0HXIo6CbJZdDJc42j2YfDx3E=; b=Qq3Z3ihVrXuhrlHTbgQp+ohdtP+5xaxOHxyoycG3pKBtIY4JXzJAYhBTYmmq+YPkXS TViiDVY49oUpeGIcFbO4PuFZIBHSDNzA26EHYZ7HPvNMQb9gbN6nTLfOzjnJm60gl960 f6/omvZNIN5ajKfZLw8Z41ahUaT8jlwOhJDKPa+4AZuNX5W45QSMW+SpKCwsA8OZFfe1 Gy3iUZ9YYije7buGMpRKyvCS4CmtVnv8rz25vQ3yr9vku1QaoUos+jLSIEASYuFAqya3 g2WJgsQVlcfs+OACWm3FsQn1jZ+4fC4i8Qh9FHn9g3vZAlDxcbF/nhXVEo5sE6yIdIE0 nwzw== X-Forwarded-Encrypted: i=1; AJvYcCV49MLzSAWIjWN+AYGWlmiOQBlBCnvRWQvHBwVSwzu1vzalE7ZHnMsO/XWZvrapq2S1D3NJPghvS/CtBDva@postgresql.org X-Gm-Message-State: AOJu0YzO0Mhn8ZDSvSCyoRybOQpACRuE5uD4jR5ZCGJAkv8c7VZiVcGW BQk7PJvXiBw5Xgyy023FX/p4iXvpIi7RuxthdkFW5/sAO5uHDJDNN3NA2gjZcPImIUYvnHgwSbA wN68WsTPYo1ql97Y7W4MSpGQ6a62nKXpSEqV0ig== X-Gm-Gg: ASbGncsUpqvENWcxs5mpzUx1NOIAWD1xxX9wMRE8qpKSPtlk1gpvoGqUKnk81FBe/X7 HNM07CQT7DagFz07aRKNpmlrYXk1lGQg= X-Google-Smtp-Source: AGHT+IFgsp4LzNKCbyUU137LxXCTZZf7T/Ar48bwmbOg2Tw6iXI+AepCAjT9ZGZomiRiWDq71YtraTpDWmRm/FZI004= X-Received: by 2002:a05:6000:480c:b0:385:ebc4:1c62 with SMTP id ffacd0b85a97d-385ebc453cdmr9961485f8f.24.1733173202299; Mon, 02 Dec 2024 13:00:02 -0800 (PST) MIME-Version: 1.0 References: <873c33c5-ef9e-41f6-80b2-2f5e11869f1c@garret.ru> <4vhpxjxmwedmnly6tm7i3rwwvqhzax6uf5g7dxvkixj252mbth@3l2h2kpnw4p5> In-Reply-To: From: Peter Geoghegan Date: Mon, 2 Dec 2024 15:59:36 -0500 Message-ID: Subject: Re: Incorrect result of bitmap heap scan. To: Andres Freund Cc: Matthias van de Meent , Andrew Dunstan , Melanie Plageman , Thomas Munro , Konstantin Knizhnik , PostgreSQL Hackers , Alexander Kuzmenkov , Tom Lane , Heikki Linnakangas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 2, 2024 at 3:56=E2=80=AFPM Peter Geoghegan wrote: > I took what you wrote, and repurposed it to prove my old theory about > GiST index-only scans being broken due to the lack of an appropriate > interlock against concurrent TID recycling. See the attached patch. BTW, if you change the test case to use the default B-Tree index AM (by removing "USING GIST"), you'll see that VACUUM blocks on acquiring a cleanup lock (and so the test just times out). The problem is that GiST VACUUM just doesn't care about cleanup locks/TID recycling safety -- though clearly it should. --=20 Peter Geoghegan