Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Noah Misch <noah@leadboat.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Geoghegan <pg@bowt.ie>
Date: 2021-08-29T18:09:13Z
Lists: pgsql-bugs
Hi,

On 2021-08-29 12:27:31 +0500, Andrey Borodin wrote:
> > 15 авг. 2021 г., в 18:45, Andres Freund <andres@anarazel.de> написал(а):
> > On 2021-08-15 16:09:37 +0500, Andrey Borodin wrote:
> >> @@ -4573,7 +4649,7 @@ VirtualXactLock(VirtualTransactionId vxid, bool wait)
> >> 	 */
> >> 	proc = BackendIdGetProc(vxid.backendId);
> >> 	if (proc == NULL)
> >> -		return true;
> >> +		return WaitXact(vxid, InvalidTransactionId, wait);
> >> 
> >> 	/*
> >> 	 * We must acquire this lock before checking the backendId and lxid
> >> @@ -4587,9 +4663,12 @@ VirtualXactLock(VirtualTransactionId vxid, bool wait)
> >> 		|| proc->fpLocalTransactionId != vxid.localTransactionId)
> >> 	{
> >> 		LWLockRelease(&proc->fpInfoLock);
> >> -		return true;
> >> +		return WaitXact(vxid, InvalidTransactionId, wait);
> >> 	}
> > 
> > It seems like it's going to add a substantial amount of work even when
> > no 2PC xacts are involved?
> Only if 2PCs are enabled.

I don't think that's good enough. Plenty of systems have 2PC enabled but very
few if any transactions end up as 2PC ones.

Greetings,

Andres Freund



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.

  2. Fix minor memory leaks in pg_dump.

  3. Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY.

  4. Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions.

  5. Add -w back to the flags for pg_ctl (re)start in PostgresNode

  6. Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transactions.