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

network is not good, the watcher in observer env will clear

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Invalid
    • Affects Version/s: 3.4.6
    • Fix Version/s: 3.5.0
    • Component/s: quorum
    • Labels:
    • Release Note:
      3.4.6

      Description

      When I set up a ZooKeeper ensemble that uses Observers, The network is not very good.
      I find all of the watcher disappear.

      I read the source code and find:
      When the observer connect to leader, will dump the DataTree from leader and rebuild in observer.
      But the datawachers and childWatches is cleared for this operation.

      after i change code like:
      WatchManager dataWatchers = zk.getZKDatabase().getDataTree()
      .getDataWatches();
      WatchManager childWatchers = zk.getZKDatabase().getDataTree()
      .getChildWatches();
      zk.getZKDatabase().clear();
      zk.getZKDatabase().deserializeSnapshot(leaderIs);
      zk.getZKDatabase().getDataTree().setDataWatches(dataWatchers);
      zk.getZKDatabase().getDataTree().setChildWatches(childWatchers);

      The watcher do not disappear

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              linking12 linking12
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: