Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5Xk3-0002zT-1h for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2014 09:35:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W5Xk2-0007x8-Fb for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2014 09:35:30 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5Xk0-0007ux-7s for pgsql-hackers@postgresql.org; Tue, 21 Jan 2014 09:35:28 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5Xjt-0002ta-OV for pgsql-hackers@postgresql.org; Tue, 21 Jan 2014 09:35:27 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 82E1728B0C; Tue, 21 Jan 2014 01:35:20 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 7F0D4403A0; Tue, 21 Jan 2014 01:35:20 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id CC3F6C005E; Tue, 21 Jan 2014 01:35:57 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Tue, 21 Jan 2014 01:35:56 -0800 (PST) Message-ID: <52DE3F55.80103@vmware.com> Date: Tue, 21 Jan 2014 11:35:17 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Tomas Vondra CC: Alexander Korotkov , pgsql-hackers Subject: Re: GIN improvements part 1: additional information References: <52A62771.3070800@vmware.com> <52AEE445.1060206@vmware.com> <52AF837C.3040201@vmware.com> <52B2F5B0.1030809@vmware.com> <52B49C34.8060300@vmware.com> <52D0A947.6050706@fuzzy.cz> <52D478F2.6070005@fuzzy.cz> <52D5E1BC.3000208@fuzzy.cz> <52D9789E.3030202@vmware.com> <52DD6B4B.3050806@vmwar e.com> <52DDD51E.2080408@fuzzy.cz> In-Reply-To: <52DDD51E.2080408@fuzzy.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.5 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 01/21/2014 04:02 AM, Tomas Vondra wrote: > On 20.1.2014 19:30, Heikki Linnakangas wrote: >> >> Attached is a yet another version, with more bugs fixed and more >> comments added and updated. I would appreciate some heavy-testing of >> this patch now. If you could re-run the tests you've been using, >> that could be great. I've tested the WAL replay by replicating GIN >> operations over streaming replication. That doesn't guarantee it's >> correct, but it's a good smoke test. > > I gave it a try - the OOM error seems to be gone, but now get this > > PANIC: cannot insert duplicate items to GIN index page > > This only happens when building the index incrementally (i.e. using a > sequence of INSERT statements into a table with GIN index). When I > create a new index on a table (already containing the same dataset) it > works just fine. > > Also, I tried to reproduce the issue by running a simple plpgsql loop > (instead of a complex python script): > > DO LANGUAGE plpgsql $$ > DECLARE > r tsvector; > BEGIN > FOR r IN SELECT body_tsvector FROM data_table LOOP > INSERT INTO idx_table (body_tsvector) VALUES (r); > END LOOP; > END$$; > > where data_table is the table with imported data (the same data I > mentioned in the post about OOM errors), and index_table is an empty > table with a GIN index. And indeed it fails, but only if I run the block > in multiple sessions in parallel. Oh, I see what's going on. I had assumed that there cannot be duplicate insertions into the posting tree, but that's dead wrong. The fast insertion mechanism depends on a duplicate insertion to do nothing. Will fix, thanks for the testing! - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers