ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1448

Node+Quota creation in transaction log can crash leader startup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3.5
    • Fix Version/s: 3.4.6, 3.5.0
    • Component/s: server
    • Labels:
      None

      Description

      Hi,

      I've found a bug in zookeeper related to quota creation which can shutdown zookeeper leader on startup.

      Steps to reproduce:
      1. create /quota_bug
      2. setquota -n 10000 /quota_bug
      3. stop the whole ensemble (the previous operations should be in the transaction log)
      4. start all the servers
      5. the elected leader will shutdown with an exception (Missing stat node for count /zookeeper/quota/quota_bug/zookeeper_
      stats)

      I've debugged a bit what happening and I found the following problem:
      On startup each server loads the last snapshot and replays the last transaction log. While doing this it fills up the pTrie variable of the DataTree with the path of the nodes which have quota.
      After the leader is elected the leader servers loads the snapshot and last transaction log but it doesn't clean up the pTrie variable. This means it still contains the "/quota_bug" path. Now when the "create /quota_bug" is processed from the transaction log the DataTree already thinks that the quota nodes ("/zookeeper/quota/quota_bug/zookeeper_limits" and "/zookeeper/quota/quota_bug/zookeeper_stats") are created but those node creation actually comes later in the transaction log. This leads to the missing stat node exception.

      I think clearing the pTrie should solve this problem.

      1. ZOOKEEPER-1448_branch3.3.patch
        5 kB
        Botond Hejj
      2. ZOOKEEPER-1448.patch
        3 kB
        Botond Hejj
      3. ZOOKEEPER-1448.patch
        5 kB
        Botond Hejj
      4. ZOOKEEPER-1448.patch
        4 kB
        Botond Hejj
      5. ZOOKEEPER-1448.patch
        4 kB
        Botond Hejj
      6. ZOOKEEPER-1448.patch
        1 kB
        Botond Hejj
      7. ZOOKEEPER-1448-trunk.patch
        3 kB
        Flavio Junqueira

        Activity

        Botond Hejj created issue -
        Botond Hejj made changes -
        Field Original Value New Value
        Attachment ZOOKEEPER-1448.patch [ 12523193 ]
        Camille Fournier made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Assignee Botond Hejj [ botond.hejj ]
        Patrick Hunt made changes -
        Fix Version/s 3.4.4 [ 12319841 ]
        Fix Version/s 3.5.0 [ 12316644 ]
        Botond Hejj made changes -
        Attachment ZOOKEEPER-1448.patch [ 12525994 ]
        Botond Hejj made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Botond Hejj made changes -
        Attachment ZOOKEEPER-1448.patch [ 12526341 ]
        Botond Hejj made changes -
        Attachment ZOOKEEPER-1448.patch [ 12526375 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Patrick Hunt made changes -
        Priority Major [ 3 ] Critical [ 2 ]
        Botond Hejj made changes -
        Attachment ZOOKEEPER-1448_branch3.3.patch [ 12535168 ]
        Patrick Hunt made changes -
        Fix Version/s 3.3.7 [ 12321882 ]
        Fix Version/s 3.3.6 [ 12320172 ]
        Mahadev konar made changes -
        Fix Version/s 3.4.5 [ 12321883 ]
        Fix Version/s 3.4.4 [ 12319841 ]
        Mahadev konar made changes -
        Fix Version/s 3.4.6 [ 12323310 ]
        Fix Version/s 3.5.0 [ 12316644 ]
        Fix Version/s 3.3.7 [ 12321882 ]
        Fix Version/s 3.4.5 [ 12321883 ]
        Flavio Junqueira made changes -
        Assignee Botond Hejj [ botond.hejj ] Flavio Junqueira [ fpj ]
        Botond Hejj made changes -
        Attachment ZOOKEEPER-1448.patch [ 12600750 ]
        Flavio Junqueira made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Flavio Junqueira made changes -
        Fix Version/s 3.5.0 [ 12316644 ]
        Flavio Junqueira made changes -
        Attachment ZOOKEEPER-1448-trunk.patch [ 12601682 ]
        Flavio Junqueira made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Flavio Junqueira made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Flavio Junqueira made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Flavio Junqueira made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Flavio Junqueira
            Reporter:
            Botond Hejj
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development