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

Remove the lock contention between snapshotting and the sync operation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.9.0, 3.9.1, 3.9.2
    • None
    • server

    Description

      Remove the synchronized keyword from Zookeeper.takeSnapshot() and ZookeeperServer.restoreFromSnapshot() API, as it causes lock contention on the ZookeeperServer object with the sync operation.

      In ZookeeperServer.java, we have the following

      
       public synchronized File takeSnapshot(boolean syncSnap, boolean isSevere, boolean fastForwardFromEdits) throws IOException {
      ....
      }
      

      In ObserverZookeeperServer.java and FollowerZookeeperServer.java, we have the following

      public synchronized void sync() {
           ...
          }
      
      

      Attachments

        Issue Links

          Activity

            People

              li4wang Li Wang
              li4wang Li Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m