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 1vvO97-00GwVb-2m for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 23:18:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvO95-008w61-30 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 23:18: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.96) (envelope-from ) id 1vvO95-008w5s-1v for pgsql-hackers@lists.postgresql.org; Wed, 25 Feb 2026 23:18:19 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvO92-00000001IHZ-0pHj for pgsql-hackers@postgresql.org; Wed, 25 Feb 2026 23:18:19 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-79801df3e21so1846067b3.2 for ; Wed, 25 Feb 2026 15:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772061495; cv=none; d=google.com; s=arc-20240605; b=dzcUJHkQMqSGKhr+/Tr2WTi0YcOfSDOIH3KskB31ZS38kpHXAs7POLTtoSSxl/80J0 CCfsrlHgZHnalTeVpyQ6c0tgFmCA8CiGWx9ExxwnkomRpw2bnM/JOq7gqbNBAgwuqEta 23/Am9fzq4TxsrpuGx6uqz4DjHsWCSTsp+tTGx4ivP+SUlhalFaOlm/G96n/EMxLfueQ C22RWTH0nORd4lO7Xn4XiVrEEorq1PTco7GzAwxQa411dbpR3uecQOfDNKp2VXpXevGX jOeNiB3sML6fUusqH/w12rjvUUzaWj3NVMOTyivVW1jpRVIgoaPXVpkX2CwXzt5bY7Ar 1ZCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=hirytBVFA9ddeGFBaEZWMRhoOkE3vHhn68bhVlMSKoA=; fh=G5cGxfjYRvVCYwt6Qb8HYs4xDLOpdgq2Vs3d+wUxfwU=; b=f3OPD1n/UkX0nggUhICSpuchJVXiWVBTMHXq94EyK0SNlcVn2AW7Z6qqNQnpz37GWm Q1WtH/HFthKx6A/dmseXutWcSw/WkDvDLDtW+fBN25kXlIDYVgum31p6B5lioXMwT/S3 C7tbknPACQDUYqCXHiRwTwOjrUTcNW5OuEJ9q9MN9Zbu9bPofWKXvdYypZ57AjeIxX2d ztdDyyro6BZ/xOHwsrl7KCedj+wvOxBzr1Viw0DgsyvU9iT3bzk5yoOuiW35lfx7bVdf uFWfKsp8TcKY3pTGTcqlWJ+KEMoLpzkjfUD8yiaSg+ihLWR6dmDIHsIHpfN8hTzbjdK3 bk7Q==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1772061495; x=1772666295; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hirytBVFA9ddeGFBaEZWMRhoOkE3vHhn68bhVlMSKoA=; b=Fj9QOj/3xthgLzGZfiJjpUBJMZSZV2wyFh5lato+7Ge/ebFp149SQ4InRmNU+Vke4d qfw9h6Suw6JzPpr8qmuqElifpVLqr0VX8DBVLvCgUJGFet/wFq0VsMyW/idqdlR4x/L7 gRRGXLXuihBlVskdDtby34oHQU3V85D+vabss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772061495; x=1772666295; h=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=hirytBVFA9ddeGFBaEZWMRhoOkE3vHhn68bhVlMSKoA=; b=REd6mjfpEYYe0om6hkiTyGIf6XF5FqXbo+0bg5oz+JkcIXJvX44oAXGEDbB/q0gjQq RWiUbcWKjKMrcGohFWfqYK3BLQHqroZpqylEhwh6xBE85nJU7dSl2KxO/1ImV/78JP+U lQkd3HaR83rDOwbLzpAIz3SwfKKglbdaIMHo6wqeJs572U0jJiMcmavHTbD4uWTydt34 0xED5ItcO2+yBJ3eLDURzVFJzzP+QeW5IqcHpcpAoJTgWZjUYCFwgLAmuwnU2YjxJkJ5 Pr//mEqIgPHNDtbBQScFvjRTDKi1imP4Ls8p9g0QnyhfLDllbSnNZBFMZngmeAAULxpN DlnQ== X-Gm-Message-State: AOJu0YzNhmsN9Tnr5+6qu7XE7BAHw0X+A+MZS1g+3i/GiIn/PfauHe6I 2fDZRk022KewXM1Bzrk5lTcitq97qISdjJHlki+UnEh3l7rZvt1mtZBMTrxm1ekrcikB0y2U7eH 3iYOoND9S483YSiMOAUL7lgXhmgkL+YpgyIILQvqHNXzU7e1sy5a2b92s8GYeg59h7o8yyh107/ cHj1y2nBhIjupcbnaLPOL2qgdUfGzcg+rRCgG3qCy5MIGZB2t1tCXlLJvGOJaM3pStyTlQ5y/Ay bm+ysHWWckB7ggyTvxX5GmgBHf3eH8ffEHwBy1WHgLio2U8ibeR18hmqbHwR5+FG1rpdg== X-Gm-Gg: ATEYQzxvNqWm1TfbrNm5x0nlR2XJQcUHpZcD0B+7rJbkpjnGyo5XbMEvhoGJBV7j3hl Fs4k9WdApafe5bQzRiniAJTVZn3pgjI04pj4qix7s1PzWUsdganS47oG6LzOcFx2VvWP7OnVFe5 ICxwJLgrjOizYChIuKG7Ex6JB2n3IqJ2xo1vjUwTdpMRW9GSfiSP8xxkHvQDqBaEzaz1p0jVbrj CbB7lxrtqOWEezJKdogyY0fCEQylhQD8wS6pZfbRFWW8lYkN+6xizJka9Hn4BK3yT1DrdvLLFgF CKj4o/EnrANNwn3pV8GX1SZQUnpDReGOleSGURdMMk4vvDPA7m1VPuQnLRYzSiqPNa8V X-Received: by 2002:a05:690c:67c1:b0:797:bc43:79ac with SMTP id 00721157ae682-7986fdfeea4mr22160227b3.32.1772061495465; Wed, 25 Feb 2026 15:18:15 -0800 (PST) MIME-Version: 1.0 References: <432626F9-65DF-4F0D-B345-26CFC3E2CFAC@yandex-team.ru> In-Reply-To: <432626F9-65DF-4F0D-B345-26CFC3E2CFAC@yandex-team.ru> From: Zsolt Parragi Date: Wed, 25 Feb 2026 23:18:04 +0000 X-Gm-Features: AaiRm51sxXnZscDZZv_Zs2HM7lKm2vxSbFM89SLxqAux_uMPcV6hAmErU0sj7lY Message-ID: Subject: Re: amcheck: add index-all-keys-match verification for B-Tree To: Andrey Borodin Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello + /* Only verify tuples pointing to visible heap rows */ + if (!heap_entry_is_visible(state, tid)) + return; ... + slot = table_slot_create(state->heaprel, NULL); + found = table_tuple_fetch_row_version(state->heaprel, tid, + state->snapshot, slot); + if (!found) + { This seems like a duplication, heap_entry_is_visible does the same thing and returns found. This also means that the if (!found) block should be unreachable? Wouldn't it be simpler to remove the is_visible check completely and use an if(found) later? + indexinfo = state->indexinfo; + estate = CreateExecutorState(); + GetPerTupleExprContext(estate)->ecxt_scantuple = slot; + FormIndexDatum(indexinfo, slot, estate, values, isnull); + FreeExecutorState(estate); This doesn't need the same cleanup code as heapam.c:1754 and :1997? Seems like state remains, so we have dangling pointers there and could crash later. /* These may have been pointing to the now-gone estate */ indexInfo->ii_ExpressionsState = NIL; indexInfo->ii_PredicateState = NULL;