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

Send event zxid to watches

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Implemented
    • None
    • None
    • server
    • None

    Description

      The zxid that triggered a watch should be sent to the watch because it's useful for ordering events.

       

      Use case:

      I'm watching a znode and syncing its contents (and whether it has been deleted) to a third system. Without zxid attached to events it makes it very difficult to maintain the order of events as they happened in ZK.

       

      For example if I modify node `/a/b/c` and then delete it soon after, we have two watch events, but no reliable way to communicate to our third system that the modification happened before the deletion. If we are given the zxid we can use that to order events.

       

      Suggested implementation:

      Change `IWatchManager#triggerWatch` to take another parameter `Long zxid`. Callers pass the zxid of the event.

      Add member `Long zxid` to `WatchedEvent`

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              snelson21 Samuel Nelson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: