mirror of https://github.com/citusdata/citus.git
Populate DATABASEOID cache before CREATE INDEX CONCURRENTLY
parent
fc493547cd
commit
affe38eac6
|
@ -910,6 +910,19 @@ ExecuteDistributedDDLJob(DDLJob *ddlJob)
|
|||
*/
|
||||
if (ddlJob->startNewTransaction)
|
||||
{
|
||||
/*
|
||||
* If cache is not populated, system catalog lookups will cause
|
||||
* the xmin of current backend to change. Then the last phase
|
||||
* of CREATE INDEX CONCURRENTLY, which is in a separate backend,
|
||||
* will hang waiting for our backend and result in a deadlock.
|
||||
*
|
||||
* We populate the cache before starting the next transaction to
|
||||
* avoid this. Most of the metadata has already been resolved in
|
||||
* planning phase, we only need to lookup metadata needed for
|
||||
* connection establishment.
|
||||
*/
|
||||
(void) CurrentDatabaseName();
|
||||
|
||||
CommitTransactionCommand();
|
||||
StartTransactionCommand();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue