Skip to content

Commit

Permalink
Add the locking mechanism before the check for whether the coordinato…
Browse files Browse the repository at this point in the history
…r already exists
  • Loading branch information
m7hm7t committed Sep 4, 2024
1 parent 68d28ec commit 3e5afb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions citus-tools
Submodule citus-tools added at 3376bd
3 changes: 3 additions & 0 deletions src/backend/distributed/metadata/node_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ citus_set_coordinator_host(PG_FUNCTION_ARGS)
EnsureTransactionalMetadataSyncMode();
}

/* prevent concurrent modification */
LockRelationOid(DistNodeRelationId(), RowExclusiveLock);

bool isCoordinatorInMetadata = false;
WorkerNode *coordinatorNode = PrimaryNodeForGroup(COORDINATOR_GROUP_ID,
&isCoordinatorInMetadata);
Expand Down

0 comments on commit 3e5afb2

Please sign in to comment.