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 1m3QqA-00012v-Du for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Jul 2021 22:25:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3Qq9-0002NZ-CF for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Jul 2021 22:25:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3Qq9-0002NR-2O for pgsql-bugs@lists.postgresql.org; Tue, 13 Jul 2021 22:25:21 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3Qq6-0006fB-Dg for pgsql-bugs@lists.postgresql.org; Tue, 13 Jul 2021 22:25:20 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54faa4-119.dhcp.inet.fi [84.250.164.119]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id B169A20099; Wed, 14 Jul 2021 01:25:13 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1626215113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z2TpJvII0r8CVwTfT4rb84Joh7yO2w/oqPPfwFXA430=; b=Bc+syiXrCC9rDyEkPfTEh3bWtjRdbPbMPV+dSbvuVoGElLepZRA+Og1ANjZz6V1GnSOkZo bb+HyGqfqm6jJurnPWcneD9R1qP08W3cmz1ZmaDKdmBSnt/np4r/u06DepIDf4FM0GJdas FLaLXkmo5NFUwwg82jwEUWqCOGlqV3c= Subject: Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows To: Pawel Kudzia Cc: Alexander Korotkov , pgsql-bugs@lists.postgresql.org, Tom Lane References: <16792-b1913b6b4e098331@postgresql.org> <970432.1623938874@sss.pgh.pa.us> <1039976.1623959387@sss.pgh.pa.us> <920041ab-e975-afe3-77d0-934a7c50965d@iki.fi> From: Heikki Linnakangas Message-ID: <06cedb17-6cbe-6586-caa6-2ff618a35517@iki.fi> Date: Wed, 14 Jul 2021 01:25:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1626215113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z2TpJvII0r8CVwTfT4rb84Joh7yO2w/oqPPfwFXA430=; b=IyISBfsAK6TS4Bqt6e832ZQRw8l1HwtYDezdMtNEyUBdck4ZMea0jk8uaz0kWktaevvMDN ttYK1mZ671hQYmypcVv/uuVcRw488r52mEkVDxw4HFXt/qqtC6dIzFipwYAetWJOfvYqDQ PCKy1AYi6vzPIRzysTwMIrpKkVxEzss= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1626215113; a=rsa-sha256; cv=none; b=paeRFXws3eNINUyOQnXwNA7uPK05APfsD+RJzUHP+iYYi9fy62KRneQ22B9+kq+DvvpLPp Hr6qTJb5VzP+2MXaUBgUz+n4JVp94/lrhNyn7CLJhr+glvkCV3ZH6jOmPURZr0AQrXneAT cNidTGZPY67RO/VSwzHGZOYodfFMyPU= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/07/2021 20:24, Pawel Kudzia wrote: > i've run these two commands: > > SET enable_seqscan=off; > SELECT entity_id FROM entity WHERE ( attribute_name_ids && '{1737}' ) > AND NOT ( (attribute_name_ids||0) && '{1737}') LIMIT 10; > > and got this in the output: > > 2021-07-12 07:41:05 UTC LOG: GINBUG: startScanKey called: excludeOnly > 0 nentries 1 > > 2021-07-12 07:41:05 UTC STATEMENT: SELECT entity_id FROM entity WHERE > ( attribute_name_ids && '{1737}' ) AND NOT ( (attribute_name_ids||0) > && '{1737}') LIMIT 10; > 2021-07-12 07:41:05 UTC LOG: GINBUG: called triConsistentFn(1): 1 0 > > > the "STATEMENT" line is repeated 79586 times, the "GINBUG: called > triConsistentFn" - 79585 times. > > there's nothing else in the log besides information about server startup. > > i'll be happy to help with the follow up checks. Ok, that confirms that it's taking the simple path through triConsistentFn(), with a single non-lossy key. Also, there don't seem to be any pending inserts. Now that we've ruled those out, I have no clue what the problem might be. Is the data sensitive, or you could you share it? I realize it's a pretty large database, but if I had a copy I could poke around to look at the index pages involved here, to see if they're corrupt and how. If that's possible, you can contact me directly, off-list, to figure the logistics to send over a copy of the data directory. - Heikki