Re: remove spurious CREATE INDEX CONCURRENTLY wait

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, James Coleman <jtc331(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: remove spurious CREATE INDEX CONCURRENTLY wait
Date: 2020-11-10 01:32:13
Message-ID: 2087667.1604971933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
>> + LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
>> + MyProc->vacuumFlags |= PROC_IN_SAFE_IC;
>> + ProcGlobal->vacuumFlags[MyProc->pgxactoff] = MyProc->vacuumFlags;
>> + LWLockRelease(ProcArrayLock);

> I can't help noticing that you are repeating the same code pattern
> eight times. I think that this should be in its own routine, and that
> we had better document that this should be called just after starting
> a transaction, with an assertion enforcing that.

Do we really need exclusive lock on the ProcArray to make this flag
change? That seems pretty bad from a concurrency standpoint.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-11-10 01:39:57 Re: remove spurious CREATE INDEX CONCURRENTLY wait
Previous Message Michael Paquier 2020-11-10 01:28:26 Re: remove spurious CREATE INDEX CONCURRENTLY wait