From ee4edc498f16d519363692e4aec1a02191765661 Mon Sep 17 00:00:00 2001 From: Brian Cloutier Date: Thu, 6 Jul 2017 16:58:32 +0300 Subject: [PATCH] Don't release locks early in metadata functions --- .../distributed/master/master_metadata_utility.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/distributed/master/master_metadata_utility.c b/src/backend/distributed/master/master_metadata_utility.c index 5f7379415..f16f4730d 100644 --- a/src/backend/distributed/master/master_metadata_utility.c +++ b/src/backend/distributed/master/master_metadata_utility.c @@ -642,7 +642,7 @@ NodeHasShardPlacements(char *nodeName, int32 nodePort, bool onlyConsiderActivePl hasFinalizedPlacements = HeapTupleIsValid(heapTuple); systable_endscan(scanDescriptor); - heap_close(pgPlacement, AccessShareLock); + heap_close(pgPlacement, NoLock); return hasFinalizedPlacements; } @@ -746,7 +746,7 @@ BuildShardPlacementList(ShardInterval *shardInterval) } systable_endscan(scanDescriptor); - heap_close(pgPlacement, AccessShareLock); + heap_close(pgPlacement, NoLock); return shardPlacementList; } @@ -840,7 +840,7 @@ InsertShardRow(Oid relationId, uint64 shardId, char storageType, CitusInvalidateRelcacheByRelid(relationId); CommandCounterIncrement(); - heap_close(pgDistShard, RowExclusiveLock); + heap_close(pgDistShard, NoLock); } @@ -885,7 +885,7 @@ InsertShardPlacementRow(uint64 shardId, uint64 placementId, CitusInvalidateRelcacheByShardId(shardId); CommandCounterIncrement(); - heap_close(pgDistPlacement, RowExclusiveLock); + heap_close(pgDistPlacement, NoLock); } @@ -1026,7 +1026,7 @@ DeletePartitionRow(Oid distributedRelationId) /* increment the counter so that next command can see the row */ CommandCounterIncrement(); - heap_close(pgDistPartition, RowExclusiveLock); + heap_close(pgDistPartition, NoLock); } @@ -1073,7 +1073,7 @@ DeleteShardRow(uint64 shardId) CitusInvalidateRelcacheByRelid(distributedRelationId); CommandCounterIncrement(); - heap_close(pgDistShard, RowExclusiveLock); + heap_close(pgDistShard, NoLock); } @@ -1125,7 +1125,7 @@ DeleteShardPlacementRow(uint64 placementId) CitusInvalidateRelcacheByShardId(shardId); CommandCounterIncrement(); - heap_close(pgDistPlacement, RowExclusiveLock); + heap_close(pgDistPlacement, NoLock); }