mirror of https://github.com/citusdata/citus.git
Readability improvement - 4
parent
60bf5ce127
commit
d60c56335f
|
@ -1578,11 +1578,11 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool parallelExecutionNotPossible =
|
bool requiresParallelExecutionLocks =
|
||||||
list_length(taskList) == 1 || ShouldRunTasksSequentially(taskList);
|
!(list_length(taskList) == 1 || ShouldRunTasksSequentially(taskList));
|
||||||
|
|
||||||
bool anyAnchorTableIsReplicated = AnyAnchorTableIsReplicated(taskList);
|
bool anyAnchorTableIsReplicated = AnyAnchorTableIsReplicated(taskList);
|
||||||
if (!anyAnchorTableIsReplicated && parallelExecutionNotPossible)
|
if (!anyAnchorTableIsReplicated && !requiresParallelExecutionLocks)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* When a distributed query on tables with replication
|
* When a distributed query on tables with replication
|
||||||
|
@ -1603,7 +1603,7 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
||||||
*/
|
*/
|
||||||
int lockMode = ExclusiveLock;
|
int lockMode = ExclusiveLock;
|
||||||
|
|
||||||
if (!anyAnchorTableIsReplicated && !parallelExecutionNotPossible)
|
if (!anyAnchorTableIsReplicated && requiresParallelExecutionLocks)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* When there is no replication then we only need to prevent
|
* When there is no replication then we only need to prevent
|
||||||
|
@ -1642,7 +1642,7 @@ AcquireExecutorShardLocksForExecution(DistributedExecution *execution)
|
||||||
* INSERTs. In that case, we should allow concurrency among such backends,
|
* INSERTs. In that case, we should allow concurrency among such backends,
|
||||||
* hence lowering the lock level to RowExclusiveLock.
|
* hence lowering the lock level to RowExclusiveLock.
|
||||||
*/
|
*/
|
||||||
if (parallelExecutionNotPossible && modLevel < ROW_MODIFY_NONCOMMUTATIVE)
|
if (!requiresParallelExecutionLocks && modLevel < ROW_MODIFY_NONCOMMUTATIVE)
|
||||||
{
|
{
|
||||||
lockMode = RowExclusiveLock;
|
lockMode = RowExclusiveLock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue