1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Allow relation extension lock to conflict among parallel group members.

This is required as it is no safer for two related processes to extend the
same relation at a time than for unrelated processes to do the same.  We
don't acquire a heavyweight lock on any other object after relation
extension lock which means such a lock can never participate in the
deadlock cycle.  So, avoid checking wait edges from this lock.

This provides an infrastructure to allow parallel operations like insert,
copy, etc. which were earlier not possible as parallel group members won't
conflict for relation extension lock.

Author: Dilip Kumar, Amit Kapila
Reviewed-by: Amit Kapila, Kuntal Ghosh and Sawada Masahiko
Discussion: https://postgr.es/m/CAD21AoCmT3cFQUN4aVvzy5chw7DuzXrJCbrjTU05B+Ss=Gn1LA@mail.gmail.com
This commit is contained in:
Amit Kapila
2020-03-20 08:20:56 +05:30
parent b27e1b3418
commit 85f6b49c2c
4 changed files with 26 additions and 1 deletions

View File

@@ -1469,6 +1469,16 @@ LockCheckConflicts(LockMethod lockMethodTable,
return true;
}
/*
* The relation extension lock conflict even between the group members.
*/
if (LOCK_LOCKTAG(*lock) == LOCKTAG_RELATION_EXTEND)
{
PROCLOCK_PRINT("LockCheckConflicts: conflicting (group)",
proclock);
return true;
}
/*
* Locks held in conflicting modes by members of our own lock group are
* not real conflicts; we can subtract those out and see if we still have