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 1w3TA3-001Fdi-2d for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Mar 2026 06:16:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3TA1-004YWY-0G for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Mar 2026 06:16:41 +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 1w3TA0-004YWO-2Y for pgsql-hackers@lists.postgresql.org; Fri, 20 Mar 2026 06:16:41 +0000 Received: from mail-dl1-x1234.google.com ([2607:f8b0:4864:20::1234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w3T9z-000000007bo-1swb for pgsql-hackers@postgresql.org; Fri, 20 Mar 2026 06:16:40 +0000 Received: by mail-dl1-x1234.google.com with SMTP id a92af1059eb24-127380532eeso4501690c88.1 for ; Thu, 19 Mar 2026 23:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773987398; cv=none; d=google.com; s=arc-20240605; b=DoZBCnQjkh5sBKeqACEgGCRqZ+wRKvmLT6PGvdpIOtREswm+d4VbZutaB/6WV5k9St Hzv8CNI8gQ4sYgeuwjy+Ltz9FZXL6FzD62Z0XkVwSKk15mtPHrJjIfI8TitmKq+bGK1y gIbEeM4FUmVEsRJs+o2zzt0vRU+6zHlU8WPuvJwl4xoPe2xZ9LSnkx2SllCLFei6paLl fG73IvkaUdm0X0EqmsZkBRd5Yy8kAVcHAoOov3s/3U3GuySCUjEi261zuz4eI3XCXAfZ QJQe3o853qwLQwn7Kjya4IwFY7iG6uRwOOVCeJd6Otm7epjK6K6t2u0w8gpUOouwFjnL QKbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IKoX6/g36FiF6qbRK+eu2vTyJBfnfctimRFAFc4CPh0=; fh=vRtTf3kUsYubr5S/QLbJ/nGxHSB49N6AdIhodUg9hf0=; b=ho3Q2rVZ7VHHbsJ3jmu9iRY4fGgtC6ZGV9Tn4no8oWxOQvtMGGPII8KA+93YMufwR6 XrsgKv+z5XSep6haEx97tX02F9vroR5QAakWszqFWZSQAqG5gjiJmb/3JAM4GZ+GXm8J xXxyupJHDEwCU/gwaU17yFFaV+MvMqGG9Co1osbQqSc15vIuj4pDplK2gM32S2mPYVjw NUTtkcp6KOP9FCAM4MlI0RHTH8xVhunU0ajt89yelnXFSH/93N+kbNQG1WKHvJwCTdQJ HvVE96yd7zUQSfZ/KUl9MXuBTALcuLxVteXZxE1CQWXKm0PjhEEqWIqyubwTH9wjaInj //sA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773987398; x=1774592198; 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=IKoX6/g36FiF6qbRK+eu2vTyJBfnfctimRFAFc4CPh0=; b=aYMjVTnlwPDmutgOm97mu3SJApEs1vrfhmpZNfffI0fKqJmnMHaLWZ5Er8NhCqfHqF gYrEw4Mr+VZ5rZylnIXAwZUepOaPRsncj+PxW+Pk44MWyqsVEnMneA0ZbJbHabJWXolC I7DSuNxz1HKVOl+k9PDQe0cJ9hMOUPJWQM+gawT3wUlKNhEfDcooAjB0TQbHm0zfD+2R KNGkmONx/qt/7JxEUBaYejM6TCzuhCk3ahi7unvUPlluiCKaWtPfcyYZ67Bp2uQipAjr +BhZijl9y/Rv2hGxs/ghOAPu9eAECshYEDNYEFPj/WBXqg2guUerl/kOJdF2UROUhxIS pJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773987398; x=1774592198; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IKoX6/g36FiF6qbRK+eu2vTyJBfnfctimRFAFc4CPh0=; b=Tln0xVxnrx6fOEgkezu/Ts/k+DRu+w6WJMsDFY5x6psTcrpZ6PMvrh2eNUpsspVueG QpMfRO1W207oyomr4MASGGkWCYqUq0nIaycfmdaXcaTFOfOlbzwdUZAeu8/ha0lg3d7h sLu+hlzVp+ql8luiatUNoHBLygXoQdussEVnCo3w7FxCUdeopEtMZa3QXetT/h46xgQR absx8V0MwcpB7soPzga/L0IVo7i6+8rmC2WtuqHCQ2Q42H948IK9ZowT0CVoOPBvh2K8 S5H+gJd+Eqr/bKHZab72Kp+Cot8rLkWYBGVCjsb04N3W/DCjiyUKXoGKr3nIxBM9WCt8 +6qg== X-Forwarded-Encrypted: i=1; AJvYcCU6RpyiX/FmQr+iClj/8q0NpZrXE1Ewm9aEbOAEVsOYjM17zHWkkxkMtOp5xy9G3f+HrTpsnVgj/2bafH1Q@postgresql.org X-Gm-Message-State: AOJu0YxbNdkNqymbsxk2LM98LJ10G2/WfpDb65mrniCG8ofMKZbHzKg8 gI02wum1eqQaix5k859d0glvYtD93tjn1QbvaR+NioFQ1hIf1ZQzdNInDKQ8Oj7LlLFK7QO1Zdw RyXi8CoWK0vQCSkE1sfazDIQBkfAjqgU= X-Gm-Gg: ATEYQzxJPUi2ebiNxGK+DgYdxYsbhsSY7JfI9QuMjGHqct1YNOrf2qxaBB6gv3LelB3 FpLpU6tEH4BxK+imDV1Vo6/VXyEvqHTYpJs/t6we3Vft7jISMvGkpqV6VZ1yARSUMV/KMy63wNl of9y1GG/IrZnxWRRwwdBfJrkYBtIF7k013ZM/jNC284rZ+LjZqF9irXyqKyHs2W6up6Uz23kp6m PXvXqul13DZwnIBq5orEG0Q9/0OWixZeodUJgKNm6WQfS3o1/TN9U32r4TrOgO1UjnVgW9TU67Q uRjq0GRAd0iXpIg6Yw== X-Received: by 2002:a05:7022:485:b0:128:d0df:a66b with SMTP id a92af1059eb24-12a726c018cmr795916c88.26.1773987398364; Thu, 19 Mar 2026 23:16:38 -0700 (PDT) MIME-Version: 1.0 References: <449DFC8A-CF54-493E-9366-AF9C73C782AA@yandex-team.ru> <14B4E29D-7B08-4972-BE9E-491A8A6A77CF@yandex-team.ru> In-Reply-To: From: Soumya S Murali Date: Fri, 20 Mar 2026 11:47:04 +0530 X-Gm-Features: AaiRm51TTQKwoj01iN6SYAkBAueev3OfaKUh-ToJA_gKTZ4RLSbwf9DGcw0COqI Message-ID: Subject: Re: Fix gistkillitems & add regression test to microvacuum To: Kirill Reshke Cc: Andrey Borodin , pgsql-hackers , Andres Freund 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 Hi all, On Wed, Mar 18, 2026 at 11:12=E2=80=AFAM Kirill Reshke wrote: > > On Wed, 11 Feb 2026 at 17:18, Soumya S Murali > wrote: > > > > Hi all, > > > > Thank you for the updated patch. > > I reproduced the issue locally by filling a GiST root page, deleting > > all tuples, and triggering a microvacuum by an index-only scan. > > With the patch, The root page is now handled consistently with other > > leaf pages. so->curBlkno and so->curPageLSN are properly set during > > scan, and gistkillitems() operates safely and correctly on the root > > page. > > Based on runtime validation and code inspection, the fix LGTM. > > > > > > Rebased due to f5eb854ab6d[0] > > I have added a [0]committer to CC. > > Andres, can you please take a look at this thread, if by chance you > have spare time for it? You have changed kill tuples-related logic > frequently, so you might be interested... > > [0] https://git.postgresql.org/cgit/postgresql.git/commit/?id=3Df5eb854ab= 6d6281ec2d3143657944bdda6676341 > I performed a follow-up test on top of the v3 patch with a strictly controlled setup to ensure a single-page GiST index (confirming that block 1 is out of range). To force the cleanup path, I executed an index-only scan after deleting all tuples and used a narrow WAL window to isolate the relevant records. The WAL output shows GiST PAGE_UPDATE on block 0, confirming that the root page is modified after the scan. However even in this setup, I do not observe any XLOG_GIST_DELETE records. This seems while the patch correctly initializes curBlkno and enables proper handling of the root page, the DELETE WAL emission depends on whether killitems actually marks tuples as DEAD under the given visible conditions. Overall, the fix looks correct from a code perspective, but in this scenario the cleanup does not result in a DELETE WAL record. Regards, Soumya