Fix error in master_disable_node/citus_disable_node (#7492)

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 <litskevichkarina@gmail.com>
(cherry picked from commit 683e10ab69)
pull/7588/head
Karina 2024-02-21 14:35:27 +03:00 committed by Jelte Fennema-Nio
parent 2ee43fd00c
commit 9b06d02c43
1 changed files with 7 additions and 1 deletions

View File

@ -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);