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

quorumVerifier is null when creating a QuorumPeerConfig from parsing a Properties object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.5.0
    • server
    • None

    Description

      This bug was found when using ZK 3.5.0 with curator-test 2.3.0.
      curator-test is building a QuorumPeerConfig from a Properties object and then when we try to run the quorum peer using that configuration, we get an NPE:

      2014-01-19 21:58:39,768 [myid:] - ERROR [Thread-3:TestingZooKeeperServer$1@138] - From testing server (random state: false)
      java.lang.NullPointerException
      	at org.apache.zookeeper.server.quorum.QuorumPeer.setQuorumVerifier(QuorumPeer.java:1320)
      	at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:156)
      	at org.apache.curator.test.TestingZooKeeperServer$1.run(TestingZooKeeperServer.java:134)
      	at java.lang.Thread.run(Thread.java:722)
      

      The reason that this happens is because QuorumPeerConfig:parseProperties only peforms a subset of what 'QuorumPeerConfig:parse(String path)' does. The exact additional task performed that we need in parseProperties is the dynamic config backwards compatibility check:

                  // backward compatibility - dynamic configuration in the same file as static configuration params
                  // see writeDynamicConfig() - we change the config file to new format if reconfig happens
                  if (dynamicConfigFileStr == null) {
                      configBackwardCompatibilityMode = true;
                      configFileStr = path;................
                      parseDynamicConfig(cfg, electionAlg, true);
                      checkValidity();................
                  }
      

      Attachments

        1. BackwardsCompatCheck.patch
          0.7 kB
          some one
        2. ZOOKEEPER-1864.patch
          2 kB
          Michi Mutsuzaki

        Activity

          People

            michim Michi Mutsuzaki
            something some one
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: