zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4985 Fix zkCleanup.sh script to not fail on non-standard config directories

Open lfrancke opened this issue 4 months ago • 3 comments

https://issues.apache.org/jira/browse/ZOOKEEPER-4985

The zkCleanup.sh script has several issues that make it difficult to use in containerized or non-standard deployments:

The script hardcodes the path to zoo.cfg and fails with confusing error messages when the config file is not in the default location. When the config file is missing, it passes empty strings to PurgeTxnLog, causing confusing error messages

Steps to Reproduce:

  • Run ZooKeeper with config in a non-standard location (e.g., /custom/path/zoo.cfg)
  • Try to run cleanup:
grep: /path/to/zookeeper/bin/../conf/zoo.cfg: No such file or directory
grep: /path/to/zookeeper/bin/../conf/zoo.cfg: No such file or directory
Path '/path/to/zookeeper/bin' does not exist.
Usage:
PurgeTxnLog dataLogDir [snapDir] -n count 

lfrancke avatar Oct 06 '25 14:10 lfrancke

The shellcheck failures were there before already.

lfrancke avatar Oct 06 '25 15:10 lfrancke

The shellcheck failures were there before already.

I don't think that's true. I think it is caused by removing the shellcheck file hints. I just ran the tools/ci/run-shellcheck.sh script on the current master branch, and it succeeds. So, I think the failure was added in this PR.

ctubbsii avatar Nov 18 '25 00:11 ctubbsii

Thank you for the review. I'd like to claim it was late and I was tired but looking at the timestamp that wasn't the case. Sorry for the extra work. I believe I addressed all of your comments.

lfrancke avatar Nov 19 '25 16:11 lfrancke