Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in master_disable_node/citus_disable_node #7492

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
{
text *nodeNameText = PG_GETARG_TEXT_P(0);
int32 nodePort = PG_GETARG_INT32(1);
bool synchronousDisableNode = PG_GETARG_BOOL(2);

bool synchronousDisableNode = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how master_disable_node() should work (see also #2063 on this topic), but if synchronousDisableNode = 0 by default, some tests are failing. For example, isolation_add_remove_node with

 step s1-disable-node-1: 
  SELECT 1 FROM master_disable_node('localhost', 57637);
  SELECT public.wait_until_metadata_sync();
 
-?column?
----------------------------------------------------------------------
-       1
-(1 row)
-
-wait_until_metadata_sync
----------------------------------------------------------------------
-
-(1 row)
-
+ERROR:  disabling the first worker node in the metadata is not allowed
 step s2-disable-node-1: 
  SELECT 1 FROM master_disable_node('localhost', 57637);
  SELECT public.wait_until_metadata_sync();
- <waiting ...>
+
+ERROR:  disabling the first worker node in the metadata is not allowed

in diff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

master_disable_node is deprecated since Citus 10.0. So it's behaviour is normally not really intended to change. I think 549edca inadvertently did change the behaviour of this function. Since no-one complained since then, I agree that it makes sense to make continue passing this test.

Assert(PG_NARGS() == 2 || PG_NARGS() == 3);

Check warning on line 512 in src/backend/distributed/metadata/node_metadata.c

View check run for this annotation

Codecov / codecov/patch

src/backend/distributed/metadata/node_metadata.c#L511-L512

Added lines #L511 - L512 were not covered by tests
if (PG_NARGS() == 3)
{
synchronousDisableNode = PG_GETARG_BOOL(2);

Check warning on line 515 in src/backend/distributed/metadata/node_metadata.c

View check run for this annotation

Codecov / codecov/patch

src/backend/distributed/metadata/node_metadata.c#L515

Added line #L515 was not covered by tests
}

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