mirror of https://github.com/citusdata/citus.git
Readability improvement
parent
7cdee3347d
commit
23f800ca3a
|
@ -1603,7 +1603,7 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
|||
*/
|
||||
int lockMode = ExclusiveLock;
|
||||
|
||||
if (!anyAnchorTableIsReplicated && IsCoordinator())
|
||||
if (!anyAnchorTableIsReplicated && !parallelExecutionNotPossible && IsCoordinator())
|
||||
{
|
||||
/*
|
||||
* When all writes are commutative then we only need to prevent multi-shard
|
||||
|
@ -1628,8 +1628,7 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
|||
EnableDeadlockPrevention ? ShareUpdateExclusiveLock : RowExclusiveLock;
|
||||
}
|
||||
|
||||
if (AllModificationsCommutative ||
|
||||
(parallelExecutionNotPossible && modLevel < ROW_MODIFY_NONCOMMUTATIVE))
|
||||
if (AllModificationsCommutative)
|
||||
{
|
||||
/*
|
||||
* If either the user allows via a GUC or the commands are
|
||||
|
@ -1639,6 +1638,10 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
|||
*/
|
||||
lockMode = RowExclusiveLock;
|
||||
}
|
||||
else if (parallelExecutionNotPossible && modLevel < ROW_MODIFY_NONCOMMUTATIVE)
|
||||
{
|
||||
lockMode = RowExclusiveLock;
|
||||
}
|
||||
|
||||
/* now, iterate on the tasks and acquire the executor locks on the shards */
|
||||
Task *task = NULL;
|
||||
|
|
Loading…
Reference in New Issue