Skip to content

Commit

Permalink
Fix error in master_disable_node/citus_disable_node (#7492)
Browse files Browse the repository at this point in the history
This fixes #7454: master_disable_node() has only two arguments, but
calls citus_disable_node() that tries to read three arguments

Co-authored-by: Karina Litskevich <[email protected]>
  • Loading branch information
Green-Chan and Karina Litskevich authored Feb 21, 2024
1 parent 852bcc5 commit 683e10a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/backend/distributed/metadata/node_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,13 @@ citus_disable_node(PG_FUNCTION_ARGS)
{
text *nodeNameText = PG_GETARG_TEXT_P(0);
int32 nodePort = PG_GETARG_INT32(1);
bool synchronousDisableNode = PG_GETARG_BOOL(2);

bool synchronousDisableNode = 1;
Assert(PG_NARGS() == 2 || PG_NARGS() == 3);
if (PG_NARGS() == 3)
{
synchronousDisableNode = PG_GETARG_BOOL(2);
}

char *nodeName = text_to_cstring(nodeNameText);
WorkerNode *workerNode = ModifiableWorkerNode(nodeName, nodePort);
Expand Down

0 comments on commit 683e10a

Please sign in to comment.