Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1262

Documentation for Lock recipe has major flaw

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.3
    • 3.5.0
    • documentation
    • None
    • Reviewed
    • Updated recipes to document how to use a GUID to manage a recoverable create() error.

    Description

      The recipe for Locks documented here: http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Locks doesn't deal with the problem of create() succeeding but the server crashing before the result is returned. As written, if the server crashes before the result is returned the client can never know what sequential node was created for it. The way to deal with this is to embed the session ID in the node name. The Lock implementation in the ZK distro does this. But, the documentation will lead implementors to write bad code.

      Attachments

        1. patch.txt
          8 kB
          Jordan Zimmerman
        2. recipes.diff
          5 kB
          Jordan Zimmerman
        3. recipes.html
          33 kB
          Jordan Zimmerman

        Activity

          People

            randgalt Jordan Zimmerman
            randgalt Jordan Zimmerman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: