Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3573 Dealing with long TLS connection closing time without SO_LINGER option
  3. ZOOKEEPER-3774

Close quorum socket asynchronously on the leader to avoid ping being blocked by long socket closing time

    XMLWordPrintableJSON

    Details

      Description

      In ZOOKEEPER-3574 we close the quorum sockets on followers asynchronously when a leader is partitioned away so the shutdown process will not be stalled by long socket closing time and the followers can quickly establish a new quorum to serve client requests.

      We've found that the long socket closing time can cause trouble on the leader too when a follower is partitioned away if the partition is detected by PingLaggingDetector. When the ping thread detects partition, it tries to disconnect the follower. If the socket closing time is long, the ping thread will be blocked and no ping is sent to any follower-even the ones still connected to the leader-since the ping thread is responsible for sending pings to all followers. When followers don't receive pings, they don't send ping response. When the leader don't receive ping response, the sessions expire. 

      To prevent good sessions from expiring, we need to close the socket asynchronously on the leader too.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jiehuangjie Jie Huang
              • 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 - 2h 40m
                  2h 40m