Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6Mvc-0008Lv-Kk for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Jun 2023 03:00:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6MvZ-00023R-Ln for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Jun 2023 03:00:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6MvZ-00023I-DT for pgsql-bugs@lists.postgresql.org; Tue, 06 Jun 2023 03:00:09 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q6MvU-000Uqx-7F for pgsql-bugs@lists.postgresql.org; Tue, 06 Jun 2023 03:00:08 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f6283d0d84so2529383e87.1 for ; Mon, 05 Jun 2023 20:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686020403; x=1688612403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7hIISdfI82wNmXy44tGrJZjZtvR1fiTCqSpvQsptPx0=; b=DpXOI1QanzqOodMbgYvFaS1Mt4r2imYYiGzX0NRMjo0zxgEp0AB1OB8EtdB6YHTF5W xBOq7Jy3QFTWxdQvqpDv6dTCX9i8OuF6qCmg4zenS/cxfq2G7YCZWJgcmAQJzvNF1a1O nOwuHMJSr+G8EYS8+D8Yna0s4kEP4sD5oUAMp7RY4UmuMV1Uxkm+Eq8WfVK4GpvYv/MO TwFhkCEDsDHi5oiq/DafN78kjE6jVSOyCurIj8OoreQpDh6AJ/FEdLWt3nfMJ+tjI95U diulelGTPS+pXD6Yh+IuZl3D/e2Iojg1L3UH+QznissTFi4qhicrCc1LhyjlCfe5aI4p HiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686020403; x=1688612403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7hIISdfI82wNmXy44tGrJZjZtvR1fiTCqSpvQsptPx0=; b=SXi1iaaul+KrLy2Rxpa7pYC1UvSd9F0tpFweCP2DJpmabm1+cy+YJ7QsSP9LyeJh8+ E6iqYFTRpCvEDS1zUM4vbkbL3cG8rvfsZrybfb5tqyD0Mn2PqYOWSv5yxBaqs1tE4b/0 RcIUjy7g6DcMWd2GFUNqozf0/3EJPVZYv4DQAKdMNitFeTD62sdCiKrahSmb7EbzY/Ip g+fORNctks7xtws1sCRUdjqiF1WJMiSig7UIw8fyq6Mh8v+nsfMEyvuua6Rzdb1wneQv 931LyOm31TZtSMA2pc8nBrJ8KDN60cSRYofMz6C1jtLJVeIH34kerT+mpAjc59681IpR 2Nbg== X-Gm-Message-State: AC+VfDzxl+spivCqan116tVjmUynbHmh1nbhqgtY6+J7W4z2VyH1ejRX SCg/Ppi912OiTwDbtX+6HvY= X-Google-Smtp-Source: ACHHUZ7TY4xjXDktZe93AJNV88Tz4EZwHLzxgLz1B6135wW8DQTcwUYeQQSnQG3S1k0fABFJ2uo7YQ== X-Received: by 2002:a05:6512:246:b0:4f1:2986:3920 with SMTP id b6-20020a056512024600b004f129863920mr368822lfo.41.1686020402805; Mon, 05 Jun 2023 20:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.22.130]) by smtp.gmail.com with ESMTPSA id l8-20020a19c208000000b004f3b3f5751bsm1305167lfc.275.2023.06.05.20.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 20:00:02 -0700 (PDT) Message-ID: <71fbc31f-51c1-92cc-594e-834dd4c4fcd9@gmail.com> Date: Tue, 6 Jun 2023 06:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17959: amcheck fails to find a matching index tuple for an invisible heap tuple Content-Language: en-US To: Peter Geoghegan Cc: pgsql-bugs@lists.postgresql.org References: <17959-0d691c29037366ab@postgresql.org> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Peter, Thanks for looking into this! 05.06.2023 19:27, Peter Geoghegan wrote: > On Mon, Jun 5, 2023 at 2:00 AM Alexander Lakhin wrote: >> A complete TAP test to reproduce the issue is attached. >> I put it in src/bin/pg_amcheck/t/, run (on master, e6a254c0d) >> PROVE_TESTS=t/099_pdri_error.pl make -s check -C src/bin/pg_amcheck/ >> and get: >> >> # Failed test 'pg_amcheck after manipulations stdout /(?^:^$)/' >> # at t/099_pdri_error.pl line 60. >> # 'btree index "regress001.pg_catalog.pg_depend_reference_index": >> # ERROR: heap tuple (13,35) from table "pg_depend" lacks matching index tuple within index "pg_depend_reference_index" >> # ' >> # doesn't match '(?^:^$)' > I can easily reproduce this result using your test case. > > I notice that the test case will pass if I remove your use of the > "--rootdescend" option from your tap test script. This suggests that > the problem is somehow limited to heapallindexed verification when run > through the bt_index_parent_check() interface -- bt_index_check() > heapallindexed verification seems unaffected. The former works rather > like a CREATE INDEX internally (and so can just use SnapshotAny), > while the latter works more like CREATE INDEX CONCURRENTLY (and so > must use an MVCC snapshot). Yes, I can confirm that bt_index_parent_check() calls bt_check_every_level(... readonly = true ...) and in this case snapshot = SnapshotAny is used. SELECT * FROM bt_index_parent_check('pg_catalog.pg_depend_reference_index'::regclass, true, false) gives the same error (and it looks like the parameter rootdescend of bt_index_parent_check() doesn't affect this). BTW, with the DEBUG2 log level I get a message: verifying that tuples from index "pg_depend_reference_index" are present in "pg_depend" but doesn't the verification work the other way? Best regards, Alexander