Make omitted local server selection deliberate - #514
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ebf0cbb. Configure here.
| if !postgres_keys.contains(&name) { | ||
| clickhouse_names.insert(name); | ||
| } | ||
| } |
There was a problem hiding this comment.
Postgres leftovers miscounted as ClickHouse
High Severity
list_clickhouse_server_names treats any servers/*/data directory as ClickHouse unless that exact name already has Postgres metadata. A failed local postgres start removes the .json file but leaves the {name}-pg{major}/data directory, so that leftover is counted as ClickHouse. Omitted server stop then falsely reports multiple non-default servers (or “already stopped” for the Postgres dir) even when server list shows only the real ClickHouse instance.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ebf0cbb. Configure here.


Summary
--nameformsserver stopprefer an existingdefault, otherwise select the sole known ClickHouse server, succeed as a no-op with none, and require a name orstop-allwith multiple non-default serversserver removeconservative: remove only an existingdefault, never infer a custom server, and return safe available-state guidanceCloses #473
Tests
--namestatescargo fmt --all --checkcargo build -p clickhousectlcargo check -p clickhousectl --no-default-featurescargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warningsStack
issue-475-local-structured-errors)