ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1214

QuorumPeer should unregister only its previsously registered MBeans instead of use MBeanRegistry.unregisterAll() method.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: quorum
    • Labels:
      None

      Description

      When a QuorumPeer thread dies, it is unregistering all ZKMBeanInfo MBeans previously registered on its java process; including those that has not been registered by itself.

      It does not cause any side effect in production environment where each server is running on a separate java process; but fails when using "org.apache.zookeeper.test.QuorumUtil" to programmatically start up a zookeeper server ensemble and use its provided methods to force Disconnected, SyncConnected or SessionExpired events; in order to perform some basic/functional testing.

      Scenario:

      • QuorumUtil qU = new QuorumUtil(1); // It creates a 3 servers ensemble.
      • qU.startAll(); // Startup all servers: 1 Leader + 2 Followers
      • qU.shutdown(i); // i is a number from 1 to 3. It shutdown one server.

      The last method causes that a QuorumPeer will die, invoking the MBeanRegistry.unregisterAll() method.
      As a result, all ZKMBeanInfo MBeans are unregistered; including those belonging to the other QuorumPeer instances.

      When trying to restart previous server (qU.restart(i)) an AssertionError is thrown at MBeanRegistry.register(ZKMBeanInfo bean, ZKMBeanInfo parent) method, causing the QuorumPeer thread dead.

      To solve it:

      • MBeanRegistry.unregisterAll() method has been removed.
      • QuorumPeer only unregister its ZKMBeanInfo MBeans.
      1. ZOOKEEPER-1214.patch
        8 kB
        César Álvarez Núñez
      2. ZOOKEEPER-1214.patch
        8 kB
        César Álvarez Núñez
      3. ZOOKEEPER-1214.patch
        10 kB
        César Álvarez Núñez
      4. ZOOKEEPER-1214.3.patch
        11 kB
        Edward Ribeiro
      5. ZOOKEEPER-1214.2.patch
        11 kB
        Edward Ribeiro

        Activity

        César Álvarez Núñez created issue -
        César Álvarez Núñez made changes -
        Field Original Value New Value
        Attachment ZOOKEEPER-1214.patch [ 12497775 ]
        César Álvarez Núñez made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        César Álvarez Núñez made changes -
        Attachment ZOOKEEPER-1214.patch [ 12497782 ]
        Mahadev konar made changes -
        Fix Version/s 3.5.0 [ 12316644 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        César Álvarez Núñez made changes -
        Attachment ZOOKEEPER-1214.patch [ 12509566 ]
        César Álvarez Núñez made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Edward Ribeiro made changes -
        Attachment ZOOKEEPER-1214.2.patch [ 12568167 ]
        Edward Ribeiro made changes -
        Attachment ZOOKEEPER-1214.3.patch [ 12568375 ]

          People

          • Assignee:
            César Álvarez Núñez
            Reporter:
            César Álvarez Núñez
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development