ZooReaderWriter.putData may create data, timeout, then fail
ZooUtil.putData() accepts an option to fail on create if a node exists. I am not completely sure but I think the following can happen.
- Call to Zookeeper to create data timesout, but it was created by on the ZK server side AND it didn't exist
- Timeout exception causes a retry
- Retry fails because the node exists.
I noticed this while reviewing #1005
I will look into this on the test cluster we have set up here.
ZooUtil.putData was moved to ZooReaderWriter.putData.
I'm currently refactoring some of the ZooReader{Writer,} code to reduce redundancy and simplify things, and saw the problematic code in question. I can look into a fix.
I have completed my refactor in #1755. After that is merged, this should be much easier to investigate.
I can look at this as part of the configuration changes that I'm going to work on when my current task completes.