Re: BUG #17485: Records missing from Primary Key index when doing REINDEX INDEX CONCURRENTLY

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Петър Славов <pet.slavov@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-05-23T10:49:02Z
Lists: pgsql-bugs

Attachments


> 23 мая 2022 г., в 10:40, Michael Paquier <michael@paquier.xyz> написал(а):
> 
> It took me some time to write a script to bisect that, but I have been
> able to establish a correlation with d9d0762 that causes VACUUM to
> ignore transactions doing some concurrent reindex operations.

I've transformed Peter's test into TAP test that runs ~20 seconds and reliably reproduces problem on my laptop.
And I observe that commenting out condition in following code fixes the test.
            //if (!(statusFlags & PROC_IN_SAFE_IC))
                h->data_oldest_nonremovable =
                    TransactionIdOlder(h->data_oldest_nonremovable, xmin);

Best regards, Andrey Borodin.

Commits

  1. Revert changes to CONCURRENTLY that "sped up" Xmin advance

  2. Fix possible HOT corruption when RECENTLY_DEAD changes to DEAD while pruning.