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

Cannot bind to client port when reconfig based on old static config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.3, 3.6.0
    • 3.6.0
    • server

    Description

      When started the ensemble with old static config that the server string doesn't have client port, dynamically remove and add the same server from the ensemble will cause that server cannot bind to client port, and the ZooKeeper server cannot serve client requests anymore.

      From the code, we'll set the clientAddr to null when start up with old static config, and dynamic config forces to have <client port> part, which will trigger the following rebind code in QuorumPeer#processReconfig, and cause the address already in used issue.

      public boolean processReconfig(QuorumVerifier qv, Long suggestedLeaderId, Long zxid, boolean restartLE) {
      ...
      if (myNewQS != null && myNewQS.clientAddr != null
      && !myNewQS.clientAddr.equals(oldClientAddr))

      { cnxnFactory.reconfigure(myNewQS.clientAddr); updateThreadName(); }

      ...
      }

      Attachments

        Activity

          People

            yisong-yue Yisong Yue
            lvfangmin Fangmin Lv
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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