Subject: Re: Resetting snapshots during the first phase of [CREATE |RE]INDEX CONCURRENTLY

From: Mihail Nikalayeu <[email-masked]>
Date: Mon, 9 Mar 2026 01:03:00 +0100

Hello, everyone!

Rebased.

---

From: Mihail Nikalayeu <[email-masked]>
Date: Fri, 20 Mar 2026 02:15:00 +0100

Rebased.

---

From: Mihail Nikalayeu <[email-masked]>
Date: Sun, 22 Mar 2026 00:50:00 +0100

Hello, Álvaro!

Thanks for looking into it.

> Or should we just consider the test as not-for-commit, and only a
> development aid?

Initially I thought so, but looks like it is possible to make it committable.

> The test in 0001 is a bit on the slow side; should we make it
> optional with PG_TEST_EXTRA?

I made *parameters* to be depended  on PG_TEST_EXTRA ~= stress. It is
possible to apply the same pattern for other stress tests too.

> The last pgbench subtest mentions GIN in the test name but doesn't
> actually run it.  Do we care?  Would it be good to make the table be
> unlogged?

Fixed, it has its own pgbench because it has its own gin_index_check.

> Would it be good to make the table be unlogged?

Good idea, done.

> I think all-but-one backends will
>complete all the 999 transactions in the first 10ms sleep that the one
> backend running the CIC does.  Am I right about this?

It actually has enough time to do multiple CIC (I see it from the
log). I updated the test to random delay, for non-stress variants -
from 0 to 1, for stress - up to 10.

Also, fixed a few small styling issues + added additional fixes for
waiting for a snapshot to be restored by a parallel worker.

Best regards,
Mikhail.

---

From: Mihail Nikalayeu <[email-masked]>
Date: Mon, 6 Apr 2026 19:55:00 +0200

Hello!

0) Rebased
1) Added REPEATABLE READ isolation level
2) Some GUGs for developers
3) Some small refactorings

---

From: Mihail Nikalayeu <[email-masked]>
Date: Sat, 11 Apr 2026 19:48:00 +0200

Rebased +

1) extract duplicate key error reporting into _bt_report_duplicate()
2) limit heap fetches in the tuplesort fail-fast duplicate check to a
configurable percentage

Best regards,
Mikhail.

---

From: Mihail Nikalayeu <[email-masked]>
Date: Sat, 18 Apr 2026 15:33:00 +0200

Some small fixes around.