Make local server metadata atomic and concurrency-safe - #516
Conversation
5fbaee3 to
c2c2303
Compare
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 55f64f3. Configure here.
| let _ = child.kill(); | ||
| let _ = child.wait(); | ||
| return Err(error); | ||
| } |
There was a problem hiding this comment.
Start kills server after metadata commit
High Severity
write_server_info can return ServerMetadataWrite after a successful rename when directory sync fails, while leaving the new metadata document in place. ClickHouse start treats any save_info error as an uncommitted write and kills the child, so a durability-only sync failure tears down a server whose metadata already records it as running.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 55f64f3. Configure here.


Summary
Closes #472
Tests
cargo fmt --all --checkcargo build -p clickhousectlcargo check -p clickhousectl --no-default-featurescargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warningsStack
issue-473-omitted-server-selection)