mirror of https://github.com/citusdata/citus.git
Remove LockRelationDistributionMetadata function
parent
ab509db0d8
commit
0f01dc3bb8
|
@ -113,8 +113,8 @@ CreateShardsWithRoundRobinPolicy(Oid distributedTableId, int32 shardCount,
|
||||||
*/
|
*/
|
||||||
EnsureTableOwner(distributedTableId);
|
EnsureTableOwner(distributedTableId);
|
||||||
|
|
||||||
/* we plan to add shards: get an exclusive metadata lock */
|
/* we plan to add shards: get an exclusive lock on relation oid */
|
||||||
LockRelationDistributionMetadata(distributedTableId, ExclusiveLock);
|
LockRelationOid(distributedTableId, ExclusiveLock);
|
||||||
|
|
||||||
relationOwner = TableOwner(distributedTableId);
|
relationOwner = TableOwner(distributedTableId);
|
||||||
|
|
||||||
|
@ -264,8 +264,8 @@ CreateColocatedShards(Oid targetRelationId, Oid sourceRelationId)
|
||||||
*/
|
*/
|
||||||
EnsureTableOwner(targetRelationId);
|
EnsureTableOwner(targetRelationId);
|
||||||
|
|
||||||
/* we plan to add shards: get an exclusive metadata lock on the target relation */
|
/* we plan to add shards: get an exclusive lock on target relation oid */
|
||||||
LockRelationDistributionMetadata(targetRelationId, ExclusiveLock);
|
LockRelationOid(targetRelationId, ExclusiveLock);
|
||||||
|
|
||||||
/* we don't want source table to get dropped before we colocate with it */
|
/* we don't want source table to get dropped before we colocate with it */
|
||||||
LockRelationOid(sourceRelationId, AccessShareLock);
|
LockRelationOid(sourceRelationId, AccessShareLock);
|
||||||
|
@ -369,8 +369,8 @@ CreateReferenceTableShard(Oid distributedTableId)
|
||||||
*/
|
*/
|
||||||
EnsureTableOwner(distributedTableId);
|
EnsureTableOwner(distributedTableId);
|
||||||
|
|
||||||
/* we plan to add shards: get an exclusive metadata lock */
|
/* we plan to add shards: get an exclusive lock on relation oid */
|
||||||
LockRelationDistributionMetadata(distributedTableId, ExclusiveLock);
|
LockRelationOid(distributedTableId, ExclusiveLock);
|
||||||
|
|
||||||
relationOwner = TableOwner(distributedTableId);
|
relationOwner = TableOwner(distributedTableId);
|
||||||
|
|
||||||
|
|
|
@ -184,21 +184,6 @@ TryLockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* LockRelationDistributionMetadata returns after getting a the lock used for a
|
|
||||||
* relation's distribution metadata, blocking if required. Only ExclusiveLock
|
|
||||||
* and ShareLock modes are supported. Any locks acquired using this method are
|
|
||||||
* released at transaction end.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
LockRelationDistributionMetadata(Oid relationId, LOCKMODE lockMode)
|
|
||||||
{
|
|
||||||
Assert(lockMode == ExclusiveLock || lockMode == ShareLock);
|
|
||||||
|
|
||||||
(void) LockRelationOid(relationId, lockMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LockShardResource acquires a lock needed to modify data on a remote shard.
|
* LockShardResource acquires a lock needed to modify data on a remote shard.
|
||||||
* This task may be assigned to multiple backends at the same time, so the lock
|
* This task may be assigned to multiple backends at the same time, so the lock
|
||||||
|
|
|
@ -66,7 +66,6 @@ typedef enum AdvisoryLocktagClass
|
||||||
/* Lock shard/relation metadata for safe modifications */
|
/* Lock shard/relation metadata for safe modifications */
|
||||||
extern void LockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode);
|
extern void LockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode);
|
||||||
extern bool TryLockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode);
|
extern bool TryLockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode);
|
||||||
extern void LockRelationDistributionMetadata(Oid relationId, LOCKMODE lockMode);
|
|
||||||
|
|
||||||
/* Lock shard data, for DML commands or remote fetches */
|
/* Lock shard data, for DML commands or remote fetches */
|
||||||
extern void LockShardResource(uint64 shardId, LOCKMODE lockmode);
|
extern void LockShardResource(uint64 shardId, LOCKMODE lockmode);
|
||||||
|
|
Loading…
Reference in New Issue