You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Knowledge Base

Implementing ZooKeeper recipes is non-trivial. There are many undocumented edge cases that must be correctly handled. This wiki will server as a knowledge-base of known edge cases and methods of working-around and/or handling them.

Table of Contents

Connection failures can make creating ephemeral-sequential nodes difficult

When creating an ephemeral-sequential, clients need to get the actual name of the node created (i.e. the requested ZNode name plus its sequence number). However, if there is an edge case whereby the server will successfully create the ephemeral-sequential node but the client will not get the result (due to partitioning, etc.). If the client reconnects before the session expires, the newly created ephemeral-sequential will still exist and wreak havoc with the recipe.

A good workaround for this issue is to include a GUID/UUID in the ZNode name. If there is a KeeperException during node creation, wait until successful re-connection, call getChildren and search for a ZNode the contains the GUID/UUID in its name. If found, you can be sure that this was the node you previously created.

  • No labels