From 3eaef027e2233d3728a0f57e7d63ba39f214e422 Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Fri, 15 Jul 2022 10:28:46 +0200 Subject: [PATCH] Remove unused code Probably left over from removing old repartitioning code --- src/backend/distributed/utils/resource_lock.c | 31 ------------------- src/include/distributed/resource_lock.h | 12 ------- 2 files changed, 43 deletions(-) diff --git a/src/backend/distributed/utils/resource_lock.c b/src/backend/distributed/utils/resource_lock.c index b5f294336..35991ade1 100644 --- a/src/backend/distributed/utils/resource_lock.c +++ b/src/backend/distributed/utils/resource_lock.c @@ -664,37 +664,6 @@ LockTransactionRecovery(LOCKMODE lockmode) } -/* - * LockJobResource acquires a lock for creating resources associated with the - * given jobId. This resource is typically a job schema (namespace), and less - * commonly a partition task directory. - */ -void -LockJobResource(uint64 jobId, LOCKMODE lockmode) -{ - LOCKTAG tag; - const bool sessionLock = false; - const bool dontWait = false; - - SET_LOCKTAG_JOB_RESOURCE(tag, MyDatabaseId, jobId); - - (void) LockAcquire(&tag, lockmode, sessionLock, dontWait); -} - - -/* Releases the lock for resources associated with the given job id. */ -void -UnlockJobResource(uint64 jobId, LOCKMODE lockmode) -{ - LOCKTAG tag; - const bool sessionLock = false; - - SET_LOCKTAG_JOB_RESOURCE(tag, MyDatabaseId, jobId); - - LockRelease(&tag, lockmode, sessionLock); -} - - /* * LockShardListMetadata takes shared locks on the metadata of all shards in * shardIntervalList to prevents concurrent placement changes. diff --git a/src/include/distributed/resource_lock.h b/src/include/distributed/resource_lock.h index 9af280b69..caaeea8a7 100644 --- a/src/include/distributed/resource_lock.h +++ b/src/include/distributed/resource_lock.h @@ -74,14 +74,6 @@ typedef enum CitusOperations (uint32) (shardid), \ ADV_LOCKTAG_CLASS_CITUS_SHARD) -/* reuse advisory lock, but with different, unused field 4 (6) */ -#define SET_LOCKTAG_JOB_RESOURCE(tag, db, jobid) \ - SET_LOCKTAG_ADVISORY(tag, \ - db, \ - (uint32) ((jobid) >> 32), \ - (uint32) (jobid), \ - ADV_LOCKTAG_CLASS_CITUS_JOB) - /* reuse advisory lock, but with different, unused field 4 (7) * Also it has the database hardcoded to MyDatabaseId, to ensure the locks * are local to each database */ @@ -157,10 +149,6 @@ extern void LockReferencedReferenceShardDistributionMetadata(uint64 shardId, /* Lock shard data, for DML commands or remote fetches */ extern void LockShardResource(uint64 shardId, LOCKMODE lockmode); -/* Lock a job schema or partition task directory */ -extern void LockJobResource(uint64 jobId, LOCKMODE lockmode); -extern void UnlockJobResource(uint64 jobId, LOCKMODE lockmode); - /* Lock a co-location group */ extern void LockColocationId(int colocationId, LOCKMODE lockMode); extern void UnlockColocationId(int colocationId, LOCKMODE lockMode);