Lars Francke created ZOOKEEPER-4985:
---------------------------------------

             Summary: zkCleanup.sh fails for non-standard config directories
                 Key: ZOOKEEPER-4985
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4985
             Project: ZooKeeper
          Issue Type: Bug
    Affects Versions: 3.9.4
            Reporter: Lars Francke


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
 # Unlike other ZooKeeper scripts, it doesn't properly support the --config 
flag even though zkEnv.sh supports it
 # 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:

{code:java}
  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 {code}
 * Trying to use --config flag (which works for zkServer.sh) has no effect 
either

 

The reason, I believe, is that if the config can't be found empty strings will 
be passed to `PurgeTxnLogs` and that fails.

 

I'll raise a PR for this.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to