Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal
Дата
Msg-id CAH2-Wz=SPxQZCZpAHLvWdM63zZMQ0c+HnPTqFHQWZZp0kXapfA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Tue, Jul 28, 2020 at 1:26 PM Peter Geoghegan <pg@bowt.ie> wrote:
> On Tue, Jul 28, 2020 at 1:04 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > No, I don't think so.  It was designed for the case of unique key X
> > being inserted immediately after a deletion of the same key.  The
> > deleted tuple is presumably not yet vacuumed-away, so the new tuple
> > should have a different TID.  In no case should we have multiple index
> > tuples pointing at the same TID; that would imply that somebody failed
> > to vacuuum away an old index entry before freeing up the heap TID.
>
> It looks like one HOT chain.

The fact remains that this function (originally known as
IndexBuildHeapScan(), now heapam_index_build_range_scan()) did not
care about whether or not the index is unique for about 3 years
(excluding the tupleIsAlive stuff, which was always there, even before
HOT). The original HOT commit (commit 282d2a03dd3) said nothing about
unique indexes in the relevant path (the HEAPTUPLE_INSERT_IN_PROGRESS
+ !TransactionIdIsCurrentTransactionId() "concurrent system catalog
insert" path). The need to wait here really did seem to be all about
not getting duplicate TIDs (i.e. respecting the basic HOT invariant)
back in 2007.

-- 
Peter Geoghegan



В списке pgsql-hackers по дате отправления:

Предыдущее
От: MBeena Emerson
Дата:
Сообщение: Re: recovering from "found xmin ... from before relfrozenxid ..."
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal