Re: Duplicate Item Pointers in Gin index

2018-06-13 Thread Masahiko Sawada
On Wed, Jun 13, 2018 at 10:22 PM, Alexander Korotkov wrote: > On Wed, Jun 13, 2018 at 11:40 AM Masahiko Sawada > wrote: >> >> On Wed, Jun 13, 2018 at 3:32 PM, Peter Geoghegan wrote: >> > On Tue, Jun 12, 2018 at 11:01 PM, Masahiko Sawada >> > wrote: >> >> FWIW, I've looked at this again. I thi

Re: Duplicate Item Pointers in Gin index

2018-06-13 Thread Alexander Korotkov
On Wed, Jun 13, 2018 at 11:40 AM Masahiko Sawada wrote: > > On Wed, Jun 13, 2018 at 3:32 PM, Peter Geoghegan wrote: > > On Tue, Jun 12, 2018 at 11:01 PM, Masahiko Sawada > > wrote: > >> FWIW, I've looked at this again. I think that the situation Siva > >> reported in the first mail can happen b

Re: Duplicate Item Pointers in Gin index

2018-06-13 Thread Masahiko Sawada
On Wed, Jun 13, 2018 at 3:32 PM, Peter Geoghegan wrote: > On Tue, Jun 12, 2018 at 11:01 PM, Masahiko Sawada > wrote: >> FWIW, I've looked at this again. I think that the situation Siva >> reported in the first mail can happen before we get commit 3b2787e. >> That is, gin indexes had had a data c

Re: Duplicate Item Pointers in Gin index

2018-06-12 Thread Peter Geoghegan
On Tue, Jun 12, 2018 at 11:01 PM, Masahiko Sawada wrote: > FWIW, I've looked at this again. I think that the situation Siva > reported in the first mail can happen before we get commit 3b2787e. > That is, gin indexes had had a data corruption bug. I've reproduced > the situation with PostgreSQL 10

Re: Duplicate Item Pointers in Gin index

2018-06-12 Thread Masahiko Sawada
On Thu, Feb 22, 2018 at 10:26 AM, Masahiko Sawada wrote: > On Thu, Feb 22, 2018 at 8:28 AM, Peter Geoghegan wrote: >> On Wed, Feb 21, 2018 at 3:02 PM, R, Siva wrote: >>> Did you mean pin on the metapage buffer during ginInsertCleanup and not lock >>> during addition of tuples to the accumulator?

Re: Duplicate Item Pointers in Gin index

2018-02-21 Thread Masahiko Sawada
On Thu, Feb 22, 2018 at 8:28 AM, Peter Geoghegan wrote: > On Wed, Feb 21, 2018 at 3:02 PM, R, Siva wrote: >> Did you mean pin on the metapage buffer during ginInsertCleanup and not lock >> during addition of tuples to the accumulator? The exclusive lock on metapage >> buffer is released after rea

Re: Duplicate Item Pointers in Gin index

2018-02-21 Thread Peter Geoghegan
On Wed, Feb 21, 2018 at 3:02 PM, R, Siva wrote: > Did you mean pin on the metapage buffer during ginInsertCleanup and not lock > during addition of tuples to the accumulator? The exclusive lock on metapage > buffer is released after reading/locking head of pending list and before we > process page

Re: Duplicate Item Pointers in Gin index

2018-02-20 Thread Masahiko Sawada
On Wed, Feb 21, 2018 at 12:31 PM, Peter Geoghegan wrote: > On Tue, Feb 20, 2018 at 7:19 PM, Masahiko Sawada > wrote: >> IIUC, ginInsertCleanup() holds ExclusiveLock on metapage during adding >> tuples in the pending list to the accumulator. And inserting entries >> to the pending list also requi

Re: Duplicate Item Pointers in Gin index

2018-02-20 Thread Peter Geoghegan
On Tue, Feb 20, 2018 at 7:19 PM, Masahiko Sawada wrote: > IIUC, ginInsertCleanup() holds ExclusiveLock on metapage during adding > tuples in the pending list to the accumulator. And inserting entries > to the pending list also requires ExclusiveLock on metapage. This > behavior is not relevant wit

Re: Duplicate Item Pointers in Gin index

2018-02-20 Thread Masahiko Sawada
On Wed, Feb 21, 2018 at 8:30 AM, R, Siva wrote: > User backend (let us call this backend 1) has released the lock on the > metapage and is processing the pending list pages, adding the items to the > build accumulator. Let us assume that there are currently 2 pages in the > pending list and metada

Re: Duplicate Item Pointers in Gin index

2018-02-20 Thread Peter Geoghegan
On Tue, Feb 20, 2018 at 3:30 PM, R, Siva wrote: > We are currently investigating an issue with a Gin index containing > duplicate item pointers for one of its keys. While we are trying to > reproduce this issue, we wanted to reach out to the community to validate > our current working theory. Ple