New Upstream Release - zookeeper

Ready changes

Summary

Merged new upstream version: 3.8.1 (was: 3.8.0).

Diff

diff --git a/debian/changelog b/debian/changelog
index 50fc97f..1f23c12 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+zookeeper (3.8.1-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 29 May 2023 21:01:06 -0000
+
 zookeeper (3.8.0-11) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/03-disable-cygwin-detection.patch b/debian/patches/03-disable-cygwin-detection.patch
index 8950742..fa786f9 100644
--- a/debian/patches/03-disable-cygwin-detection.patch
+++ b/debian/patches/03-disable-cygwin-detection.patch
@@ -7,9 +7,11 @@ Description: Disable detection of cygwin under Debian installs
 Author: Akira Kitada <akitada@gmail.com>
 Forwarded: not-needed
 
---- a/bin/zkServer.sh
-+++ b/bin/zkServer.sh
-@@ -97,15 +97,6 @@
+Index: zookeeper.git/bin/zkServer.sh
+===================================================================
+--- zookeeper.git.orig/bin/zkServer.sh
++++ zookeeper.git/bin/zkServer.sh
+@@ -97,15 +97,6 @@ then
      ZOOCFG="$2"
  fi
  
@@ -25,7 +27,7 @@ Forwarded: not-needed
  echo "Using config: $ZOOCFG" >&2
  
  case "$OSTYPE" in
-@@ -216,7 +207,7 @@
+@@ -216,7 +207,7 @@ stop)
      then
        echo "no zookeeper to stop (could not find file $ZOOPIDFILE)"
      else
diff --git a/debian/patches/05-ZOOKEEPER-770.patch b/debian/patches/05-ZOOKEEPER-770.patch
index 99a62b8..3883122 100644
--- a/debian/patches/05-ZOOKEEPER-770.patch
+++ b/debian/patches/05-ZOOKEEPER-770.patch
@@ -1,9 +1,11 @@
 Description: Slow add_auth calls with multi-threaded client
 Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-770
 
---- a/zookeeper-client/zookeeper-client-c/tests/TestClient.cc
-+++ b/zookeeper-client/zookeeper-client-c/tests/TestClient.cc
-@@ -195,6 +195,20 @@
+Index: zookeeper.git/zookeeper-client/zookeeper-client-c/tests/TestClient.cc
+===================================================================
+--- zookeeper.git.orig/zookeeper-client/zookeeper-client-c/tests/TestClient.cc
++++ zookeeper.git/zookeeper-client/zookeeper-client-c/tests/TestClient.cc
+@@ -195,6 +195,20 @@ public:
  
  } watchctx_t;
  
@@ -24,7 +26,7 @@ Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-770
  class Zookeeper_simpleSystem : public CPPUNIT_NS::TestFixture
  {
      CPPUNIT_TEST_SUITE(Zookeeper_simpleSystem);
-@@ -584,6 +598,14 @@
+@@ -584,6 +598,14 @@ public:
          count++;
      }
  
@@ -39,7 +41,7 @@ Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-770
      static void verifyCreateFails(const char *path, zhandle_t *zk) {
        CPPUNIT_ASSERT_EQUAL((int)ZBADARGUMENTS, zoo_create(zk,
            path, "", 0, &ZOO_OPEN_ACL_UNSAFE, 0, 0, 0));
-@@ -671,6 +693,8 @@
+@@ -671,6 +693,8 @@ public:
          zhandle_t *zk = createClient(&ctx1);
          struct ACL_vector nodeAcl;
          struct ACL acl_val;
@@ -48,7 +50,7 @@ Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-770
          rc = zoo_add_auth(0, "", 0, 0, voidCompletion, (void*)-1);
          CPPUNIT_ASSERT_EQUAL((int) ZBADARGUMENTS, rc);
  
-@@ -704,11 +728,13 @@
+@@ -704,11 +728,13 @@ public:
          //create a new client
          zk = createClient(&ctx2);
  
@@ -63,9 +65,11 @@ Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-770
  
          char buf[1024];
          int blen = sizeof(buf);
---- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
-+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
-@@ -2103,7 +2103,7 @@
+Index: zookeeper.git/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+===================================================================
+--- zookeeper.git.orig/zookeeper-client/zookeeper-client-c/src/zookeeper.c
++++ zookeeper.git/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+@@ -2103,7 +2103,7 @@ static int send_info_packet(zhandle_t *z
      /* We queued the buffer, so don't free it */
      close_buffer_oarchive(&oa, 0);
  
diff --git a/debian/patches/06-ftbfs-gcc-4.7.patch b/debian/patches/06-ftbfs-gcc-4.7.patch
index cd64ca0..d87e423 100644
--- a/debian/patches/06-ftbfs-gcc-4.7.patch
+++ b/debian/patches/06-ftbfs-gcc-4.7.patch
@@ -1,10 +1,10 @@
 Description: Fix a build failure with GCC 4.7
 Author: Matthias Klose <doko@debian.org>
 Bug: https://issues.apache.org/jira/browse/ZOOKEEPER-2108
-Index: zookeeper-3.3.5+dfsg1/src/contrib/zktreeutil/src/ZkAdaptor.cc
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc
 ===================================================================
---- zookeeper-3.3.5+dfsg1.orig/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc	2012-03-15 20:09:29.000000000 +0000
-+++ zookeeper-3.3.5+dfsg1/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc	2012-05-10 16:00:13.741897761 +0000
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc
 @@ -18,6 +18,7 @@
  
  #include "ZkAdaptor.h"
diff --git a/debian/patches/07-remove-non-reproducible-manifest-entries.patch b/debian/patches/07-remove-non-reproducible-manifest-entries.patch
index 367d3d5..9874ad2 100644
--- a/debian/patches/07-remove-non-reproducible-manifest-entries.patch
+++ b/debian/patches/07-remove-non-reproducible-manifest-entries.patch
@@ -1,8 +1,10 @@
 Description: Remove the Built-At, Built-By and Built-On entries in the manifest of the jar files to improve the build reproducibility
 Author: Emmanuel Bourg <ebourg@apache.org>
 Forwarded: no
---- a/zookeeper-contrib/zookeeper-contrib-zooinspector/build.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/build.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-zooinspector/build.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-zooinspector/build.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-zooinspector/build.xml
 @@ -57,9 +57,6 @@
  		<jar jarfile="${jarname}">
  			<manifest>
diff --git a/debian/patches/10-cppunit-pkg-config.patch b/debian/patches/10-cppunit-pkg-config.patch
index e265517..dd59772 100644
--- a/debian/patches/10-cppunit-pkg-config.patch
+++ b/debian/patches/10-cppunit-pkg-config.patch
@@ -3,9 +3,11 @@ Author: Rene Engelhard <rene@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-27
 
---- a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/configure.ac
-+++ b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/configure.ac
-@@ -72,7 +72,7 @@
+Index: zookeeper.git/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/configure.ac
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/configure.ac
++++ zookeeper.git/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/configure.ac
+@@ -72,7 +72,7 @@ AC_C_VOLATILE
  AC_PROG_CC
  AC_PROG_LIBTOOL
  #check for cppunit 
@@ -14,9 +16,11 @@ Last-Update: 2022-06-27
  # Checks for library functions.
  AC_FUNC_UTIME_NULL
  AC_CHECK_FUNCS([gettimeofday memset mkdir rmdir strdup strerror strstr strtol strtoul strtoull utime])
---- a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/configure.ac
-+++ b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/configure.ac
-@@ -72,7 +72,7 @@
+Index: zookeeper.git/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/configure.ac
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/configure.ac
++++ zookeeper.git/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/configure.ac
+@@ -72,7 +72,7 @@ AC_C_VOLATILE
  AC_PROG_CC
  AC_PROG_LIBTOOL
  #check for cppunit 
diff --git a/debian/patches/11-disable-minikdc-tests.patch b/debian/patches/11-disable-minikdc-tests.patch
index 1c4e4c1..4d7f92b 100644
--- a/debian/patches/11-disable-minikdc-tests.patch
+++ b/debian/patches/11-disable-minikdc-tests.patch
@@ -3,9 +3,11 @@ Author: tony mancill <tmancill@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-27
 
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -223,6 +223,35 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -219,6 +219,35 @@
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
diff --git a/debian/patches/12-add-yetus-annotations.patch b/debian/patches/12-add-yetus-annotations.patch
index fdf3c46..98a3153 100644
--- a/debian/patches/12-add-yetus-annotations.patch
+++ b/debian/patches/12-add-yetus-annotations.patch
@@ -1,8 +1,10 @@
 Description: Adds the Yetus annotations (https://yetus.apache.org)
 Author: Emmanuel Bourg <ebourg@apache.org>
 Forwarded: not-needed
+Index: zookeeper.git/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceAudience.java
+===================================================================
 --- /dev/null
-+++ b/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceAudience.java
++++ zookeeper.git/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceAudience.java
 @@ -0,0 +1,74 @@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
@@ -78,8 +80,10 @@ Forwarded: not-needed
 +
 +  private InterfaceAudience() {} // Audience can't exist on its own
 +}
+Index: zookeeper.git/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceStability.java
+===================================================================
 --- /dev/null
-+++ b/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceStability.java
++++ zookeeper.git/zookeeper-jute/src/main/java/org/apache/yetus/audience/InterfaceStability.java
 @@ -0,0 +1,65 @@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
diff --git a/debian/patches/19-add_missing-plugins-versions.patch b/debian/patches/19-add_missing-plugins-versions.patch
index 86a770e..5f3fe26 100644
--- a/debian/patches/19-add_missing-plugins-versions.patch
+++ b/debian/patches/19-add_missing-plugins-versions.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-18
 
---- a/pom.xml
-+++ b/pom.xml
-@@ -692,6 +692,7 @@
+Index: zookeeper.git/pom.xml
+===================================================================
+--- zookeeper.git.orig/pom.xml
++++ zookeeper.git/pom.xml
+@@ -680,6 +680,7 @@
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
@@ -14,7 +16,7 @@ Last-Update: 2022-06-18
            <configuration>
               <showWarnings>true</showWarnings>
               <compilerArgs>
-@@ -708,6 +709,7 @@
+@@ -696,6 +697,7 @@
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
@@ -22,7 +24,7 @@ Last-Update: 2022-06-18
            <configuration>
              <archive>
                <manifestEntries>
-@@ -719,6 +721,7 @@
+@@ -707,6 +709,7 @@
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
@@ -30,7 +32,7 @@ Last-Update: 2022-06-18
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-@@ -746,6 +749,7 @@
+@@ -734,6 +737,7 @@
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
@@ -38,8 +40,10 @@ Last-Update: 2022-06-18
            <configuration>
                <trimStackTrace>false</trimStackTrace>
                <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
---- a/zookeeper-compatibility-tests/pom.xml
-+++ b/zookeeper-compatibility-tests/pom.xml
+Index: zookeeper.git/zookeeper-compatibility-tests/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-compatibility-tests/pom.xml
++++ zookeeper.git/zookeeper-compatibility-tests/pom.xml
 @@ -41,6 +41,7 @@
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
diff --git a/debian/patches/20-no-Timeout-in-tests.patch b/debian/patches/20-no-Timeout-in-tests.patch
index 55faeea..e84b106 100644
--- a/debian/patches/20-no-Timeout-in-tests.patch
+++ b/debian/patches/20-no-Timeout-in-tests.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-18
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/ClientRequestTimeoutTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/ClientRequestTimeoutTest.java
-@@ -30,7 +30,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/ClientRequestTimeoutTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/ClientRequestTimeoutTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/ClientRequestTimeoutTest.java
+@@ -30,7 +30,6 @@ import org.apache.zookeeper.server.quoru
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.Test;
@@ -14,7 +16,7 @@ Last-Update: 2022-06-18
  
  public class ClientRequestTimeoutTest extends QuorumPeerTestBase {
  
-@@ -39,7 +38,6 @@
+@@ -39,7 +38,6 @@ public class ClientRequestTimeoutTest ex
      private int dropPacketType = ZooDefs.OpCode.create;
  
      @Test
@@ -22,9 +24,11 @@ Last-Update: 2022-06-18
      public void testClientRequestTimeout() throws Exception {
          int requestTimeOut = 15000;
          System.setProperty("zookeeper.request.timeout", Integer.toString(requestTimeOut));
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesCmdTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesCmdTest.java
-@@ -32,7 +32,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesCmdTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesCmdTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesCmdTest.java
+@@ -32,7 +32,6 @@ import org.apache.zookeeper.test.ClientB
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -32,7 +36,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -68,7 +67,6 @@
+@@ -68,7 +67,6 @@ public class RemoveWatchesCmdTest extend
       * local=false
       */
      @Test
@@ -40,7 +44,7 @@ Last-Update: 2022-06-18
      public void testRemoveWatchesWithNoPassedOptions() throws Exception {
          List<EventType> expectedEvents = new ArrayList<>();
          expectedEvents.add(EventType.ChildWatchRemoved);
-@@ -102,7 +100,6 @@
+@@ -102,7 +100,6 @@ public class RemoveWatchesCmdTest extend
       * Test verifies deletion of NodeDataChanged watches
       */
      @Test
@@ -48,7 +52,7 @@ Last-Update: 2022-06-18
      public void testRemoveNodeDataChangedWatches() throws Exception {
          LOG.info("Adding data watcher using getData()");
          List<EventType> expectedEvents = new ArrayList<>();
-@@ -128,7 +125,6 @@
+@@ -128,7 +125,6 @@ public class RemoveWatchesCmdTest extend
       * Test verifies deletion of NodeCreated data watches
       */
      @Test
@@ -56,7 +60,7 @@ Last-Update: 2022-06-18
      public void testRemoveNodeCreatedWatches() throws Exception {
          List<EventType> expectedEvents = new ArrayList<>();
          expectedEvents.add(EventType.DataWatchRemoved);
-@@ -160,7 +156,6 @@
+@@ -160,7 +156,6 @@ public class RemoveWatchesCmdTest extend
       * Test verifies deletion of NodeChildrenChanged watches
       */
      @Test
@@ -64,7 +68,7 @@ Last-Update: 2022-06-18
      public void testRemoveNodeChildrenChangedWatches() throws Exception {
          List<EventType> expectedEvents = new ArrayList<>();
          expectedEvents.add(EventType.ChildWatchRemoved);
-@@ -182,7 +177,6 @@
+@@ -182,7 +177,6 @@ public class RemoveWatchesCmdTest extend
       * Test verifies deletion of NodeDeleted watches
       */
      @Test
@@ -72,7 +76,7 @@ Last-Update: 2022-06-18
      public void testRemoveNodeDeletedWatches() throws Exception {
          LOG.info("Adding NodeDeleted watcher");
          List<EventType> expectedEvents = new ArrayList<>();
-@@ -214,7 +208,6 @@
+@@ -214,7 +208,6 @@ public class RemoveWatchesCmdTest extend
       * Test verifies deletion of any watches
       */
      @Test
@@ -80,7 +84,7 @@ Last-Update: 2022-06-18
      public void testRemoveAnyWatches() throws Exception {
          verifyRemoveAnyWatches(false);
      }
-@@ -224,7 +217,6 @@
+@@ -224,7 +217,6 @@ public class RemoveWatchesCmdTest extend
       * connection
       */
      @Test
@@ -88,9 +92,11 @@ Last-Update: 2022-06-18
      public void testRemoveWatchesLocallyWhenNoServerConnection() throws Exception {
          verifyRemoveAnyWatches(true);
      }
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
-@@ -46,7 +46,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
+@@ -46,7 +46,6 @@ import org.apache.zookeeper.server.Serve
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
@@ -98,7 +104,7 @@ Last-Update: 2022-06-18
  import org.junit.jupiter.params.ParameterizedTest;
  import org.junit.jupiter.params.provider.ValueSource;
  import org.slf4j.Logger;
-@@ -129,7 +128,6 @@
+@@ -129,7 +128,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -106,7 +112,7 @@ Last-Update: 2022-06-18
      public void testRemoveSingleWatcher(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          zk1.create("/node2", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
-@@ -162,7 +160,6 @@
+@@ -162,7 +160,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -114,7 +120,7 @@ Last-Update: 2022-06-18
      public void testMultipleDataWatchers(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -193,7 +190,6 @@
+@@ -193,7 +190,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -122,7 +128,7 @@ Last-Update: 2022-06-18
      public void testMultipleChildWatchers(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -229,7 +225,6 @@
+@@ -229,7 +225,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -130,7 +136,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllWatchers(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
-@@ -255,7 +250,6 @@
+@@ -255,7 +250,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -138,7 +144,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllDataWatchers(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -298,7 +292,6 @@
+@@ -298,7 +292,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -146,7 +152,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllChildWatchers(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -340,7 +333,6 @@
+@@ -340,7 +333,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -154,7 +160,7 @@ Last-Update: 2022-06-18
      public void testNoWatcherException(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
-@@ -389,7 +381,6 @@
+@@ -389,7 +381,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -162,7 +168,7 @@ Last-Update: 2022-06-18
      public void testRemoveAnyDataWatcher(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -416,7 +407,6 @@
+@@ -416,7 +407,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -170,7 +176,7 @@ Last-Update: 2022-06-18
      public void testRemoveAnyChildWatcher(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
-@@ -442,7 +432,6 @@
+@@ -442,7 +432,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -178,7 +184,7 @@ Last-Update: 2022-06-18
      public void testRemoveWatcherWhenNoConnection(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
-@@ -478,7 +467,6 @@
+@@ -478,7 +467,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -186,7 +192,7 @@ Last-Update: 2022-06-18
      public void testManyPreNodeWatchers(boolean useAsync) throws Exception {
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
-@@ -507,7 +495,6 @@
+@@ -507,7 +495,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -194,7 +200,7 @@ Last-Update: 2022-06-18
      public void testManyChildWatchers(boolean useAsync) throws Exception {
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
-@@ -543,7 +530,6 @@
+@@ -543,7 +530,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -202,7 +208,7 @@ Last-Update: 2022-06-18
      public void testManyDataWatchers(boolean useAsync) throws Exception {
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
-@@ -575,7 +561,6 @@
+@@ -575,7 +561,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -210,7 +216,7 @@ Last-Update: 2022-06-18
      public void testManyWatchersWhenNoConnection(boolean useAsync) throws Exception {
          int count = 3;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
-@@ -622,7 +607,6 @@
+@@ -622,7 +607,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -218,7 +224,7 @@ Last-Update: 2022-06-18
      public void testChRootRemoveWatcher(boolean useAsync) throws Exception {
          // creating the subtree for chRoot clients.
          String chRoot = "/appsX";
-@@ -678,7 +662,6 @@
+@@ -678,7 +662,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -226,7 +232,7 @@ Last-Update: 2022-06-18
      public void testNoWatcherServerException(boolean useAsync) throws InterruptedException, IOException, TimeoutException {
          CountdownWatcher watcher = new CountdownWatcher();
          ZooKeeper zk = spy(new ZooKeeper(hostPort, CONNECTION_TIMEOUT, watcher));
-@@ -705,7 +688,6 @@
+@@ -705,7 +688,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -234,7 +240,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllNoWatcherException(boolean useAsync) throws IOException, InterruptedException, KeeperException {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          try {
-@@ -721,7 +703,6 @@
+@@ -721,7 +703,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -242,7 +248,7 @@ Last-Update: 2022-06-18
      public void testNullWatcherReference(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          try {
-@@ -742,7 +723,6 @@
+@@ -742,7 +723,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -250,7 +256,7 @@ Last-Update: 2022-06-18
      public void testRemoveWhenMultipleDataWatchesOnAPath(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch dataWatchCount = new CountDownLatch(1);
-@@ -777,7 +757,6 @@
+@@ -777,7 +757,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -258,7 +264,7 @@ Last-Update: 2022-06-18
      public void testRemoveWhenMultipleChildWatchesOnAPath(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch childWatchCount = new CountDownLatch(1);
-@@ -812,7 +791,6 @@
+@@ -812,7 +791,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -266,7 +272,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllDataWatchesOnAPath(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch dWatchCount = new CountDownLatch(2);
-@@ -860,7 +838,6 @@
+@@ -860,7 +838,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -274,7 +280,7 @@ Last-Update: 2022-06-18
      public void testRemoveAllChildWatchesOnAPath(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch cWatchCount = new CountDownLatch(2);
-@@ -908,7 +885,6 @@
+@@ -908,7 +885,6 @@ public class RemoveWatchesTest extends C
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -282,9 +288,11 @@ Last-Update: 2022-06-18
      public void testRemoveAllWatchesOnAPath(boolean useAsync) throws Exception {
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch watchCount = new CountDownLatch(2);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java
-@@ -40,7 +40,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java
+@@ -40,7 +40,6 @@ import org.apache.zookeeper.common.ZKCon
  import org.apache.zookeeper.server.quorum.QuorumPeerConfig.ConfigException;
  import org.junit.jupiter.api.BeforeAll;
  import org.junit.jupiter.api.Test;
@@ -292,7 +300,7 @@ Last-Update: 2022-06-18
  
  public class ZKClientConfigTest {
  
-@@ -54,7 +53,6 @@
+@@ -54,7 +53,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -300,7 +308,7 @@ Last-Update: 2022-06-18
      public void testDefaultConfiguration() {
          Map<String, String> properties = new HashMap<>();
          properties.put(ZK_SASL_CLIENT_USERNAME, "zookeeper1");
-@@ -93,7 +91,6 @@
+@@ -93,7 +91,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -308,7 +316,7 @@ Last-Update: 2022-06-18
      public void testSystemPropertyValue() {
          String clientName = "zookeeper1";
          System.setProperty(ZK_SASL_CLIENT_USERNAME, clientName);
-@@ -108,7 +105,6 @@
+@@ -108,7 +105,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -316,7 +324,7 @@ Last-Update: 2022-06-18
      public void testReadConfigurationFile() throws IOException, ConfigException {
          File file = File.createTempFile("clientConfig", ".conf", testData);
          file.deleteOnExit();
-@@ -139,7 +135,6 @@
+@@ -139,7 +135,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -324,7 +332,7 @@ Last-Update: 2022-06-18
      public void testSetConfiguration() {
          ZKClientConfig conf = new ZKClientConfig();
          String defaultValue = conf.getProperty(ZKClientConfig.ENABLE_CLIENT_SASL_KEY, ZKClientConfig.ENABLE_CLIENT_SASL_DEFAULT);
-@@ -152,7 +147,6 @@
+@@ -152,7 +147,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -332,7 +340,7 @@ Last-Update: 2022-06-18
      public void testIntegerRetrievalFromProperty() {
          ZKClientConfig conf = new ZKClientConfig();
          String prop = "UnSetProperty" + System.currentTimeMillis();
-@@ -186,7 +180,6 @@
+@@ -186,7 +180,6 @@ public class ZKClientConfigTest {
      }
  
      @Test
@@ -340,9 +348,11 @@ Last-Update: 2022-06-18
      public void testIntegerRetrievalFromHexadecimalProperty() {
          int hexaValue = 0x3000000;
          String wrongValue = "0xwel";
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
-@@ -52,7 +52,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
+@@ -52,7 +52,6 @@ import org.apache.zookeeper.PortAssignme
  import org.apache.zookeeper.client.ZKClientConfig;
  import org.apache.zookeeper.server.ServerCnxnFactory;
  import org.junit.jupiter.api.AfterEach;
@@ -350,7 +360,7 @@ Last-Update: 2022-06-18
  import org.junit.jupiter.params.ParameterizedTest;
  import org.junit.jupiter.params.provider.MethodSource;
  
-@@ -95,7 +94,6 @@
+@@ -95,7 +94,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -358,7 +368,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContextWithoutCustomProtocol(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -106,7 +104,6 @@
+@@ -106,7 +104,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -366,7 +376,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContextWithCustomProtocol(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -119,7 +116,6 @@
+@@ -119,7 +116,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -374,7 +384,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContextWithoutKeyStoreLocation(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -130,7 +126,6 @@
+@@ -130,7 +126,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -382,7 +392,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContextWithoutKeyStorePassword(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -146,7 +141,6 @@
+@@ -146,7 +141,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -390,7 +400,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContext_withKeyStorePasswordFromFile(final X509KeyType caKeyType,
                                                                   final X509KeyType certKeyType,
                                                                   final String keyPassword,
-@@ -161,7 +155,6 @@
+@@ -161,7 +155,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -398,7 +408,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContext_withTrustStorePasswordFromFile(final X509KeyType caKeyType,
                                                                     final X509KeyType certKeyType,
                                                                     final String keyPassword,
-@@ -175,7 +168,6 @@
+@@ -175,7 +168,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -406,7 +416,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContext_withWrongKeyStorePasswordFromFile(final X509KeyType caKeyType,
                                                                        final X509KeyType certKeyType,
                                                                        final String keyPassword,
-@@ -186,7 +178,6 @@
+@@ -186,7 +178,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -414,7 +424,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContext_withWrongTrustStorePasswordFromFile(final X509KeyType caKeyType,
                                                                           final X509KeyType certKeyType,
                                                                           final String keyPassword,
-@@ -197,7 +188,6 @@
+@@ -197,7 +188,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -422,7 +432,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLContextWithCustomCipherSuites(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -211,7 +201,6 @@
+@@ -211,7 +201,6 @@ public class X509UtilTest extends BaseX5
      // possible
      @ParameterizedTest
      @MethodSource("data")
@@ -430,7 +440,7 @@ Last-Update: 2022-06-18
      public void testCRLEnabled(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -225,7 +214,6 @@
+@@ -225,7 +214,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -438,7 +448,7 @@ Last-Update: 2022-06-18
      public void testCRLDisabled(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -238,7 +226,6 @@
+@@ -238,7 +226,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -446,7 +456,7 @@ Last-Update: 2022-06-18
      public void testOCSPEnabled(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -252,7 +239,6 @@
+@@ -252,7 +239,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -454,7 +464,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLSocket(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -264,7 +250,6 @@
+@@ -264,7 +250,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -462,7 +472,7 @@ Last-Update: 2022-06-18
      public void testCreateSSLServerSocketWithoutPort(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
-@@ -277,7 +262,6 @@
+@@ -277,7 +262,6 @@ public class X509UtilTest extends BaseX5
  
      @ParameterizedTest
      @MethodSource("data")
@@ -470,9 +480,11 @@ Last-Update: 2022-06-18
      public void testCreateSSLServerSocketWithPort(
              X509KeyType caKeyType, X509KeyType certKeyType, String keyPassword, Integer paramIndex)
              throws Exception {
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.java
-@@ -21,7 +21,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.java
+@@ -21,7 +21,6 @@ package org.apache.zookeeper.common;
  import static org.junit.jupiter.api.Assertions.assertEquals;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -480,7 +492,7 @@ Last-Update: 2022-06-18
  
  public class ZKConfigTest {
  
-@@ -34,7 +33,6 @@
+@@ -34,7 +33,6 @@ public class ZKConfigTest {
  
      // property is not set we should get the default value
      @Test
@@ -488,7 +500,7 @@ Last-Update: 2022-06-18
      public void testBooleanRetrievalFromPropertyDefault() {
          ZKConfig conf = new ZKConfig();
          String prop = "UnSetProperty" + System.currentTimeMillis();
-@@ -45,7 +43,6 @@
+@@ -45,7 +43,6 @@ public class ZKConfigTest {
  
      // property is set to an valid boolean, we should get the set value
      @Test
@@ -496,7 +508,7 @@ Last-Update: 2022-06-18
      public void testBooleanRetrievalFromProperty() {
          boolean value = true;
          boolean defaultValue = false;
-@@ -57,7 +54,6 @@
+@@ -57,7 +54,6 @@ public class ZKConfigTest {
  
      // property is set but with white spaces in the beginning
      @Test
@@ -504,7 +516,7 @@ Last-Update: 2022-06-18
      public void testBooleanRetrievalFromPropertyWithWhitespacesInBeginning() {
          boolean value = true;
          boolean defaultValue = false;
-@@ -69,7 +65,6 @@
+@@ -69,7 +65,6 @@ public class ZKConfigTest {
  
      // property is set but with white spaces at the end
      @Test
@@ -512,7 +524,7 @@ Last-Update: 2022-06-18
      public void testBooleanRetrievalFromPropertyWithWhitespacesAtEnd() {
          boolean value = true;
          boolean defaultValue = false;
-@@ -81,7 +76,6 @@
+@@ -81,7 +76,6 @@ public class ZKConfigTest {
  
      // property is set but with white spaces at the beginning and the end
      @Test
@@ -520,9 +532,11 @@ Last-Update: 2022-06-18
      public void testBooleanRetrievalFromPropertyWithWhitespacesAtBeginningAndEnd() {
          boolean value = true;
          boolean defaultValue = false;
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
-@@ -46,7 +46,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
+@@ -46,7 +46,6 @@ import org.apache.zookeeper.test.ClientB
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -530,7 +544,7 @@ Last-Update: 2022-06-18
  
  public class CreateContainerTest extends ClientBase {
  
-@@ -80,14 +79,12 @@
+@@ -80,14 +79,12 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -545,7 +559,7 @@ Last-Update: 2022-06-18
      public void testCreateWithStat() throws KeeperException, InterruptedException {
          Stat stat = createWithStatVerifyResult("/foo");
          Stat childStat = createWithStatVerifyResult("/foo/child");
-@@ -97,7 +94,6 @@
+@@ -97,7 +94,6 @@ public class CreateContainerTest extends
  
      @SuppressWarnings("ConstantConditions")
      @Test
@@ -553,7 +567,7 @@ Last-Update: 2022-06-18
      public void testCreateWithNullStat() throws KeeperException, InterruptedException {
          final String name = "/foo";
          assertNull(zk.exists(name, false));
-@@ -111,7 +107,6 @@
+@@ -111,7 +107,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -561,7 +575,7 @@ Last-Update: 2022-06-18
      public void testSimpleDeletion() throws KeeperException, InterruptedException {
          zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          zk.create("/foo/bar", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -125,7 +120,6 @@
+@@ -125,7 +120,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -569,7 +583,7 @@ Last-Update: 2022-06-18
      public void testMultiWithContainerSimple() throws KeeperException, InterruptedException {
          Op createContainer = Op.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          zk.multi(Collections.singletonList(createContainer));
-@@ -135,7 +129,6 @@
+@@ -135,7 +129,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -577,7 +591,7 @@ Last-Update: 2022-06-18
      public void testMultiWithContainer() throws KeeperException, InterruptedException {
          Op createContainer = Op.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          Op createChild = Op.create("/foo/bar", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -164,7 +157,6 @@
+@@ -164,7 +157,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -585,7 +599,7 @@ Last-Update: 2022-06-18
      public void testSimpleDeletionAsync() throws KeeperException, InterruptedException {
          final CountDownLatch latch = new CountDownLatch(1);
          AsyncCallback.Create2Callback cb = (rc, path, ctx, name, stat) -> {
-@@ -184,7 +176,6 @@
+@@ -184,7 +176,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -593,7 +607,7 @@ Last-Update: 2022-06-18
      public void testCascadingDeletion() throws KeeperException, InterruptedException {
          zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          zk.create("/foo/bar", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
-@@ -202,7 +193,6 @@
+@@ -202,7 +193,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -601,7 +615,7 @@ Last-Update: 2022-06-18
      public void testFalseEmpty() throws KeeperException, InterruptedException {
          zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          zk.create("/foo/bar", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -219,7 +209,6 @@
+@@ -219,7 +209,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -609,7 +623,7 @@ Last-Update: 2022-06-18
      public void testMaxPerMinute() throws InterruptedException {
          final BlockingQueue<String> queue = new LinkedBlockingQueue<String>();
          RequestProcessor processor = new RequestProcessor() {
-@@ -261,7 +250,6 @@
+@@ -261,7 +250,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -617,7 +631,7 @@ Last-Update: 2022-06-18
      public void testMaxNeverUsedInterval() throws KeeperException, InterruptedException {
          zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          AtomicLong elapsed = new AtomicLong(0);
-@@ -289,7 +277,6 @@
+@@ -289,7 +277,6 @@ public class CreateContainerTest extends
      }
  
      @Test
@@ -625,9 +639,11 @@ Last-Update: 2022-06-18
      public void testZeroMaxNeverUsedInterval() throws KeeperException, InterruptedException {
          zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
          AtomicInteger deletesQty = new AtomicInteger(0);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java
-@@ -52,7 +52,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java
+@@ -52,7 +52,6 @@ import org.apache.zookeeper.metrics.Metr
  import org.apache.zookeeper.txn.CreateTxn;
  import org.apache.zookeeper.txn.TxnHeader;
  import org.junit.jupiter.api.Test;
@@ -635,7 +651,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -65,7 +64,6 @@
+@@ -65,7 +64,6 @@ public class DataTreeTest extends ZKTest
       * removing the session related ephemerals from DataTree structure
       */
      @Test
@@ -643,7 +659,7 @@ Last-Update: 2022-06-18
      public void testDumpEphemerals() throws Exception {
          int count = 1000;
          long session = 1000;
-@@ -110,7 +108,6 @@
+@@ -110,7 +108,6 @@ public class DataTreeTest extends ZKTest
      }
  
      @Test
@@ -651,7 +667,7 @@ Last-Update: 2022-06-18
      public void testRootWatchTriggered() throws Exception {
          DataTree dt = new DataTree();
  
-@@ -132,7 +129,6 @@
+@@ -132,7 +129,6 @@ public class DataTreeTest extends ZKTest
       * For ZOOKEEPER-1046 test if cversion is getting incremented correctly.
       */
      @Test
@@ -659,7 +675,7 @@ Last-Update: 2022-06-18
      public void testIncrementCversion() throws Exception {
          try {
              // digestCalculator gets initialized for the new DataTree constructor based on the system property
-@@ -226,7 +222,6 @@
+@@ -226,7 +222,6 @@ public class DataTreeTest extends ZKTest
      }
  
      @Test
@@ -667,7 +683,7 @@ Last-Update: 2022-06-18
      public void testPathTrieClearOnDeserialize() throws Exception {
  
          //Create a DataTree with quota nodes so PathTrie get updated
-@@ -265,7 +260,6 @@
+@@ -265,7 +260,6 @@ public class DataTreeTest extends ZKTest
       * This test verifies the fix that we should not hold ACL cache during dumping aclcache to snapshots
      */
      @Test
@@ -675,7 +691,7 @@ Last-Update: 2022-06-18
      public void testSerializeDoesntLockACLCacheWhileWriting() throws Exception {
          DataTree tree = new DataTree();
          tree.createNode("/marker", new byte[] { 42 }, null, -1, 1, 1, 1);
-@@ -310,7 +304,6 @@
+@@ -310,7 +304,6 @@ public class DataTreeTest extends ZKTest
      /* ZOOKEEPER-3531 - similarly for aclCache.deserialize, we should not hold lock either
      */
      @Test
@@ -683,7 +699,7 @@ Last-Update: 2022-06-18
      public void testDeserializeDoesntLockACLCacheWhileReading() throws Exception {
          DataTree tree = new DataTree();
          tree.createNode("/marker", new byte[] { 42 }, null, -1, 1, 1, 1);
-@@ -368,7 +361,6 @@
+@@ -368,7 +361,6 @@ public class DataTreeTest extends ZKTest
       * the DataNode lock while calling OutputArchive.writeRecord.
       */
      @Test
@@ -691,7 +707,7 @@ Last-Update: 2022-06-18
      public void testSerializeDoesntLockDataNodeWhileWriting() throws Exception {
          DataTree tree = new DataTree();
          tree.createNode("/marker", new byte[] { 42 }, null, -1, 1, 1, 1);
-@@ -417,7 +409,6 @@
+@@ -417,7 +409,6 @@ public class DataTreeTest extends ZKTest
      }
  
      @Test
@@ -699,9 +715,11 @@ Last-Update: 2022-06-18
      public void testReconfigACLClearOnDeserialize() throws Exception {
          DataTree tree = new DataTree();
          // simulate the upgrading scenario, where the reconfig znode
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/NIOServerCnxnTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/NIOServerCnxnTest.java
-@@ -32,7 +32,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NIOServerCnxnTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/NIOServerCnxnTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NIOServerCnxnTest.java
+@@ -32,7 +32,6 @@ import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.server.quorum.BufferStats;
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.Test;
@@ -709,7 +727,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -44,7 +43,6 @@
+@@ -44,7 +43,6 @@ public class NIOServerCnxnTest extends C
       * Test operations on ServerCnxn after socket closure.
       */
      @Test
@@ -717,9 +735,11 @@ Last-Update: 2022-06-18
      public void testOperationsAfterCnxnClose() throws IOException, InterruptedException, KeeperException {
          final ZooKeeper zk = createClient();
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnTest.java
-@@ -61,7 +61,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnTest.java
+@@ -61,7 +61,6 @@ import org.apache.zookeeper.test.TestByt
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -727,7 +747,7 @@ Last-Update: 2022-06-18
  import org.mockito.Mockito;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -101,7 +100,6 @@
+@@ -101,7 +100,6 @@ public class NettyServerCnxnTest extends
       * @see <a href="https://issues.jboss.org/browse/NETTY-412">NETTY-412</a>
       */
      @Test
@@ -735,7 +755,7 @@ Last-Update: 2022-06-18
      public void testSendCloseSession() throws Exception {
          assertTrue(serverFactory instanceof NettyServerCnxnFactory, "Didn't instantiate ServerCnxnFactory with NettyServerCnxnFactory!");
  
-@@ -141,7 +139,6 @@
+@@ -141,7 +139,6 @@ public class NettyServerCnxnTest extends
       * connection fails.
       */
      @Test
@@ -743,9 +763,11 @@ Last-Update: 2022-06-18
      public void testMaxConnectionPerIpSurpased() {
          assertTrue(serverFactory instanceof NettyServerCnxnFactory, "Did not instantiate ServerCnxnFactory with NettyServerCnxnFactory!");
          assertThrows(ProtocolException.class, () -> {
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/SessionTrackerTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/SessionTrackerTest.java
-@@ -34,7 +34,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/SessionTrackerTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/SessionTrackerTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/SessionTrackerTest.java
+@@ -34,7 +34,6 @@ import org.apache.zookeeper.ZooDefs.OpCo
  import org.apache.zookeeper.server.SessionTrackerImpl.SessionImpl;
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.Test;
@@ -753,7 +775,7 @@ Last-Update: 2022-06-18
  
  /**
   * Testing zk client session logic in sessiontracker
-@@ -51,7 +50,6 @@
+@@ -51,7 +50,6 @@ public class SessionTrackerTest extends
       * the session expiration.
       */
      @Test
@@ -761,7 +783,7 @@ Last-Update: 2022-06-18
      public void testAddSessionAfterSessionExpiry() throws Exception {
          RequestThrottler.setMaxRequests(0);
          ZooKeeperServer zks = setupSessionTracker();
-@@ -89,7 +87,6 @@
+@@ -89,7 +87,6 @@ public class SessionTrackerTest extends
       * after session expiration by the session tracker
       */
      @Test
@@ -769,9 +791,11 @@ Last-Update: 2022-06-18
      public void testCloseSessionRequestAfterSessionExpiry() throws Exception {
          ZooKeeperServer zks = setupSessionTracker();
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
-@@ -49,7 +49,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java
+@@ -49,7 +49,6 @@ import org.apache.zookeeper.server.persi
  import org.apache.zookeeper.server.quorum.QuorumPeerConfig.ConfigException;
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.Test;
@@ -779,7 +803,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -178,7 +177,6 @@
+@@ -178,7 +177,6 @@ public class ZooKeeperServerMainTest ext
       * writing transaction log), ZooKeeper is still available.
       */
      @Test
@@ -787,7 +811,7 @@ Last-Update: 2022-06-18
      public void testNonRecoverableError() throws Exception {
          ClientBase.setupTestEnv();
  
-@@ -229,7 +227,6 @@
+@@ -229,7 +227,6 @@ public class ZooKeeperServerMainTest ext
       * This test will fail if it is executed as root user.
       */
      @Test
@@ -795,7 +819,7 @@ Last-Update: 2022-06-18
      public void testReadOnlySnapshotDir() throws Exception {
          ClientBase.setupTestEnv();
          final int CLIENT_PORT = PortAssignment.unique();
-@@ -268,7 +265,6 @@
+@@ -268,7 +265,6 @@ public class ZooKeeperServerMainTest ext
       * This test will fail if it is executed as root user.
       */
      @Test
@@ -803,9 +827,11 @@ Last-Update: 2022-06-18
      public void testReadOnlyTxnLogDir() throws Exception {
          ClientBase.setupTestEnv();
          final int CLIENT_PORT = PortAssignment.unique();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMaxCnxnsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMaxCnxnsTest.java
-@@ -33,7 +33,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMaxCnxnsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMaxCnxnsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMaxCnxnsTest.java
+@@ -33,7 +33,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -813,7 +839,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -52,14 +51,12 @@
+@@ -52,14 +51,12 @@ public class ZooKeeperServerMaxCnxnsTest
       */
  
      @Test
@@ -828,16 +854,18 @@ Last-Update: 2022-06-18
      public void testMaxZooKeeperClientsWithNettyServerCnxnFactory() throws Exception {
          String serverCnxnFactory = "org.apache.zookeeper.server.NettyServerCnxnFactory";
          testMaxZooKeeperClients(serverCnxnFactory);
-@@ -177,4 +174,4 @@
+@@ -177,4 +174,4 @@ public class ZooKeeperServerMaxCnxnsTest
              }
          }
      }
 -}
 \ No newline at end of file
 +}
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java
-@@ -35,7 +35,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java
+@@ -35,7 +35,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -845,7 +873,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -77,7 +76,6 @@
+@@ -77,7 +76,6 @@ public class ZooKeeperServerStartupTest
       * https://issues.apache.org/jira/browse/ZOOKEEPER-2383
       */
      @Test
@@ -853,7 +881,7 @@ Last-Update: 2022-06-18
      public void testClientConnectionRequestDuringStartupWithNIOServerCnxn() throws Exception {
          tmpDir = ClientBase.createTmpDir();
          ClientBase.setupTestEnv();
-@@ -108,7 +106,6 @@
+@@ -108,7 +106,6 @@ public class ZooKeeperServerStartupTest
       * https://issues.apache.org/jira/browse/ZOOKEEPER-2383
       */
      @Test
@@ -861,7 +889,7 @@ Last-Update: 2022-06-18
      public void testClientConnectionRequestDuringStartupWithNettyServerCnxn() throws Exception {
          tmpDir = ClientBase.createTmpDir();
          ClientBase.setupTestEnv();
-@@ -148,7 +145,6 @@
+@@ -148,7 +145,6 @@ public class ZooKeeperServerStartupTest
       * https://issues.apache.org/jira/browse/ZOOKEEPER-2383
       */
      @Test
@@ -869,9 +897,11 @@ Last-Update: 2022-06-18
      public void testFourLetterWords() throws Exception {
          startSimpleZKServer(startupDelayLatch);
          verify("conf", ZK_NOT_SERVING);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java
-@@ -23,7 +23,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java
+@@ -23,7 +23,6 @@ import java.util.concurrent.CountDownLat
  import java.util.concurrent.TimeUnit;
  import org.apache.zookeeper.ZKTestCase;
  import org.junit.jupiter.api.Test;
@@ -879,7 +909,7 @@ Last-Update: 2022-06-18
  
  public class ZooKeeperThreadTest extends ZKTestCase {
  
-@@ -73,7 +72,6 @@
+@@ -73,7 +72,6 @@ public class ZooKeeperThreadTest extends
       * Test verifies uncaught exception handling of ZooKeeperThread
       */
      @Test
@@ -887,9 +917,11 @@ Last-Update: 2022-06-18
      public void testUncaughtException() throws Exception {
          MyThread t1 = new MyThread("Test-Thread");
          t1.start();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
-@@ -48,7 +48,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
+@@ -48,7 +48,6 @@ import org.apache.zookeeper.server.ZooKe
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -897,7 +929,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -418,7 +417,6 @@
+@@ -418,7 +417,6 @@ public class CommitProcessorConcurrencyT
       * processed.
       */
      @Test
@@ -905,7 +937,7 @@ Last-Update: 2022-06-18
      public void noStarvationOfNonLocalCommittedRequestsTest() throws Exception {
          final String path = "/noStarvationOfCommittedRequests";
          processor.queuedRequests = new MockRequestsQueue();
-@@ -521,7 +519,6 @@
+@@ -521,7 +519,6 @@ public class CommitProcessorConcurrencyT
       * session queue but it sees a commit for a request that belongs to the previous connection.
       */
      @Test
@@ -913,7 +945,7 @@ Last-Update: 2022-06-18
      public void noCrashOnCommittedRequestsOfUnseenRequestTest() throws Exception {
          final String path = "/noCrash/OnCommittedRequests/OfUnseenRequestTest";
          final int numberofReads = 10;
-@@ -583,7 +580,6 @@
+@@ -583,7 +580,6 @@ public class CommitProcessorConcurrencyT
       * We should commit the requests according to the order we receive from the leader, i.e., wait for the relevant commit.
       */
      @Test
@@ -921,9 +953,11 @@ Last-Update: 2022-06-18
      public void noCrashOnOutofOrderCommittedRequestTest() throws Exception {
          final String path = "/noCrash/OnCommittedRequests/OfUnSeenRequestTest";
          final int sessionid = 0x123456;
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/DIFFSyncConsistencyTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/DIFFSyncConsistencyTest.java
-@@ -41,7 +41,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/DIFFSyncConsistencyTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/DIFFSyncConsistencyTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/DIFFSyncConsistencyTest.java
+@@ -41,7 +41,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -931,7 +965,7 @@ Last-Update: 2022-06-18
  
  public class DIFFSyncConsistencyTest extends QuorumPeerTestBase {
  
-@@ -49,7 +48,6 @@
+@@ -49,7 +48,6 @@ public class DIFFSyncConsistencyTest ext
      private MainThread[] mt = new MainThread[SERVER_COUNT];
  
      @Test
@@ -939,9 +973,11 @@ Last-Update: 2022-06-18
      public void testInconsistentDueToUncommittedLog() throws Exception {
          final int LEADER_TIMEOUT_MS = 10_000;
          final int[] clientPorts = new int[SERVER_COUNT];
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EphemeralNodeDeletionTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EphemeralNodeDeletionTest.java
-@@ -40,7 +40,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EphemeralNodeDeletionTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EphemeralNodeDeletionTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EphemeralNodeDeletionTest.java
+@@ -40,7 +40,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -949,7 +985,7 @@ Last-Update: 2022-06-18
  
  public class EphemeralNodeDeletionTest extends QuorumPeerTestBase {
  
-@@ -54,7 +53,6 @@
+@@ -54,7 +53,6 @@ public class EphemeralNodeDeletionTest e
       */
  
      @Test
@@ -957,9 +993,11 @@ Last-Update: 2022-06-18
      public void testEphemeralNodeDeletion() throws Exception {
          final int[] clientPorts = new int[SERVER_COUNT];
          StringBuilder sb = new StringBuilder();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EpochWriteFailureTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EpochWriteFailureTest.java
-@@ -32,7 +32,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EpochWriteFailureTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EpochWriteFailureTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EpochWriteFailureTest.java
+@@ -32,7 +32,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.Test;
@@ -967,7 +1005,7 @@ Last-Update: 2022-06-18
  
  public class EpochWriteFailureTest extends QuorumPeerTestBase {
      private static int SERVER_COUNT = 3;
-@@ -47,7 +46,6 @@
+@@ -47,7 +46,6 @@ public class EpochWriteFailureTest exten
       * run time values of acceptedEpoch,
       */
      @Test
@@ -975,9 +1013,11 @@ Last-Update: 2022-06-18
      public void testAcceptedEpochWriteFailure() throws Exception {
          StringBuilder sb = new StringBuilder();
          sb.append("admin.enableServer=false");
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
-@@ -117,7 +117,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
+@@ -117,7 +117,6 @@ import org.bouncycastle.util.io.pem.PemW
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -985,7 +1025,7 @@ Last-Update: 2022-06-18
  
  public class QuorumSSLTest extends QuorumPeerTestBase {
  
-@@ -479,7 +478,6 @@
+@@ -479,7 +478,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -993,7 +1033,7 @@ Last-Update: 2022-06-18
      public void testQuorumSSL() throws Exception {
          q1 = new MainThread(1, clientPortQp1, quorumConfiguration, SSL_QUORUM_ENABLED);
          q2 = new MainThread(2, clientPortQp2, quorumConfiguration, SSL_QUORUM_ENABLED);
-@@ -500,7 +498,6 @@
+@@ -500,7 +498,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1001,7 +1041,7 @@ Last-Update: 2022-06-18
      public void testQuorumSSL_withPasswordFromFile() throws Exception {
          final Path secretFile = SecretUtilsTest.createSecretFile(String.valueOf(PASSWORD));
  
-@@ -524,7 +521,6 @@
+@@ -524,7 +521,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1009,7 +1049,7 @@ Last-Update: 2022-06-18
      public void testQuorumSSLWithMultipleAddresses() throws Exception {
          System.setProperty(QuorumPeer.CONFIG_KEY_MULTI_ADDRESS_ENABLED, "true");
          quorumConfiguration = generateMultiAddressQuorumConfiguration();
-@@ -549,7 +545,6 @@
+@@ -549,7 +545,6 @@ public class QuorumSSLTest extends Quoru
  
  
      @Test
@@ -1017,7 +1057,7 @@ Last-Update: 2022-06-18
      public void testRollingUpgrade() throws Exception {
          // Form a quorum without ssl
          q1 = new MainThread(1, clientPortQp1, quorumConfiguration);
-@@ -597,7 +592,6 @@
+@@ -597,7 +592,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1025,7 +1065,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationWithInvalidHostname() throws Exception {
          String badhostnameKeystorePath = tmpDir + "/badhost.jks";
          X509Certificate badHostCert = buildEndEntityCert(
-@@ -614,7 +608,6 @@
+@@ -614,7 +608,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1033,7 +1073,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationWithInvalidIPAddress() throws Exception {
          String badhostnameKeystorePath = tmpDir + "/badhost.jks";
          X509Certificate badHostCert = buildEndEntityCert(
-@@ -631,7 +624,6 @@
+@@ -631,7 +624,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1041,7 +1081,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationWithInvalidIpAddressAndInvalidHostname() throws Exception {
          String badhostnameKeystorePath = tmpDir + "/badhost.jks";
          X509Certificate badHostCert = buildEndEntityCert(
-@@ -648,7 +640,6 @@
+@@ -648,7 +640,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1049,7 +1089,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationForInvalidMultiAddressServerConfig() throws Exception {
          System.setProperty(QuorumPeer.CONFIG_KEY_MULTI_ADDRESS_ENABLED, "true");
          quorumConfiguration = generateMultiAddressQuorumConfiguration();
-@@ -668,7 +659,6 @@
+@@ -668,7 +659,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1057,7 +1097,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationWithInvalidIpAddressAndValidHostname() throws Exception {
          String badhostnameKeystorePath = tmpDir + "/badhost.jks";
          X509Certificate badHostCert = buildEndEntityCert(
-@@ -685,7 +675,6 @@
+@@ -685,7 +675,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1065,7 +1105,7 @@ Last-Update: 2022-06-18
      public void testHostnameVerificationWithValidIpAddressAndInvalidHostname() throws Exception {
          String badhostnameKeystorePath = tmpDir + "/badhost.jks";
          X509Certificate badHostCert = buildEndEntityCert(
-@@ -752,73 +741,6 @@
+@@ -752,73 +741,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1139,7 +1179,7 @@ Last-Update: 2022-06-18
      public void testOCSP() throws Exception {
          Integer ocspPort = PortAssignment.unique();
  
-@@ -892,7 +814,6 @@
+@@ -892,7 +814,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1147,7 +1187,7 @@ Last-Update: 2022-06-18
      public void testCipherSuites() throws Exception {
          // Get default cipher suites from JDK
          SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
-@@ -933,7 +854,6 @@
+@@ -933,7 +854,6 @@ public class QuorumSSLTest extends Quoru
      }
  
      @Test
@@ -1155,9 +1195,11 @@ Last-Update: 2022-06-18
      public void testProtocolVersion() throws Exception {
          System.setProperty(quorumX509Util.getSslProtocolProperty(), "TLSv1.2");
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/RaceConditionTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/RaceConditionTest.java
-@@ -39,7 +39,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/RaceConditionTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/RaceConditionTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/RaceConditionTest.java
+@@ -39,7 +39,6 @@ import org.apache.zookeeper.server.quoru
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -1165,7 +1207,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -59,7 +58,6 @@
+@@ -59,7 +58,6 @@ public class RaceConditionTest extends Q
       */
  
      @Test
@@ -1173,9 +1215,11 @@ Last-Update: 2022-06-18
      public void testRaceConditionBetweenLeaderAndAckRequestProcessor() throws Exception {
          mt = startQuorum();
          // get leader
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigLegacyTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigLegacyTest.java
-@@ -36,7 +36,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigLegacyTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigLegacyTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigLegacyTest.java
+@@ -36,7 +36,6 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.ReconfigTest;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -1183,7 +1227,7 @@ Last-Update: 2022-06-18
  
  public class ReconfigLegacyTest extends QuorumPeerTestBase {
  
-@@ -246,7 +245,6 @@
+@@ -246,7 +245,6 @@ public class ReconfigLegacyTest extends
       * @throws Exception
       */
      @Test
@@ -1191,9 +1235,11 @@ Last-Update: 2022-06-18
      public void testRestartZooKeeperServer() throws Exception {
          final int[] clientPorts = new int[SERVER_COUNT];
          StringBuilder sb = new StringBuilder();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
-@@ -37,7 +37,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
+@@ -37,7 +37,6 @@ import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.ReconfigTest;
  import org.junit.jupiter.api.Test;
@@ -1201,7 +1247,7 @@ Last-Update: 2022-06-18
  
  /**
   * ReconfigRollingRestartCompatibilityTest - we want to make sure that users
-@@ -93,7 +92,6 @@
+@@ -93,7 +92,6 @@ public class ReconfigRollingRestartCompa
      // Verify no zoo.cfg.dynamic and zoo.cfg.bak files existing locally
      // when reconfig feature flag is off by default.
      @Test
@@ -1209,7 +1255,7 @@ Last-Update: 2022-06-18
      public void testNoLocalDynamicConfigAndBackupFiles() throws InterruptedException, IOException {
          int serverCount = 3;
          String config = generateNewQuorumConfig(serverCount);
-@@ -123,7 +121,6 @@
+@@ -123,7 +121,6 @@ public class ReconfigRollingRestartCompa
      // 2. After upgrade, start the node.
      // 3. Do this for every node, one at a time.
      @Test
@@ -1217,7 +1263,7 @@ Last-Update: 2022-06-18
      public void testRollingRestartWithoutMembershipChange() throws Exception {
          int serverCount = 3;
          String config = generateNewQuorumConfig(serverCount);
-@@ -156,7 +153,6 @@
+@@ -156,7 +153,6 @@ public class ReconfigRollingRestartCompa
      // during the process each node has the expected configuration setting pushed
      // via updating local zoo.cfg file.
      @Test
@@ -1225,9 +1271,11 @@ Last-Update: 2022-06-18
      public void testExtendingQuorumWithNewMembers() throws Exception {
          int serverCount = 3;
          String config = generateNewQuorumConfig(serverCount);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
-@@ -33,7 +33,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
+@@ -33,7 +33,6 @@ import org.apache.zookeeper.data.Stat;
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.ReconfigTest;
  import org.junit.jupiter.api.Test;
@@ -1235,7 +1283,7 @@ Last-Update: 2022-06-18
  
  public class StandaloneDisabledTest extends QuorumPeerTestBase {
  
-@@ -55,7 +54,6 @@
+@@ -55,7 +54,6 @@ public class StandaloneDisabledTest exte
       * with just a single server.
       */
      @Test
@@ -1243,18 +1291,20 @@ Last-Update: 2022-06-18
      public void startSingleServerTest() throws Exception {
          setUpData();
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
-@@ -36,7 +36,6 @@
- import org.apache.kerby.kerberos.kerb.keytab.Keytab;
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
+@@ -33,7 +33,6 @@ import org.apache.kerby.kerberos.kerb.ke
  import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+ import org.apache.zookeeper.server.quorum.auth.KerberosTestUtils.KerberosConfiguration;
  import org.junit.jupiter.api.Test;
 -import org.junit.jupiter.api.Timeout;
  
  /*
   * This code is originally from HDFS, see the file name TestMiniKdc there
-@@ -50,14 +49,12 @@
-     private static final boolean IBM_JAVA = System.getProperty("java.vendor").contains("IBM");
+@@ -46,14 +45,12 @@ public class MiniKdcTest extends Kerbero
+ 
  
      @Test
 -    @Timeout(value = 60)
@@ -1268,17 +1318,19 @@ Last-Update: 2022-06-18
      public void testKeytabGen() throws Exception {
          MiniKdc kdc = getKdc();
          File workDir = getWorkDir();
-@@ -129,7 +126,6 @@
-     }
+@@ -72,7 +69,6 @@ public class MiniKdcTest extends Kerbero
+ 
  
      @Test
 -    @Timeout(value = 60)
      public void testKerberosLogin() throws Exception {
          MiniKdc kdc = getKdc();
          File workDir = getWorkDir();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumAuthUpgradeTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumAuthUpgradeTest.java
-@@ -35,7 +35,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumAuthUpgradeTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumAuthUpgradeTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumAuthUpgradeTest.java
+@@ -35,7 +35,6 @@ import org.apache.zookeeper.test.ClientT
  import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -1286,7 +1338,7 @@ Last-Update: 2022-06-18
  
  /**
   * Rolling upgrade should do in three steps:
-@@ -85,7 +84,6 @@
+@@ -85,7 +84,6 @@ public class QuorumAuthUpgradeTest exten
       * peer1 -&gt; quorum.auth.enableSasl=false
       */
      @Test
@@ -1294,7 +1346,7 @@ Last-Update: 2022-06-18
      public void testNullAuthLearnerServer() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "false");
-@@ -104,7 +102,6 @@
+@@ -104,7 +102,6 @@ public class QuorumAuthUpgradeTest exten
       * peer1 -&gt; quorum.auth.enableSasl=false, quorum.auth.learnerRequireSasl=false, quorum.auth.serverRequireSasl=false
       */
      @Test
@@ -1302,7 +1354,7 @@ Last-Update: 2022-06-18
      public void testAuthLearnerAgainstNullAuthServer() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true");
-@@ -123,7 +120,6 @@
+@@ -123,7 +120,6 @@ public class QuorumAuthUpgradeTest exten
       * peer1 -&gt; quorum.auth.enableSasl=true, quorum.auth.learnerRequireSasl=false, quorum.auth.serverRequireSasl=false
       */
      @Test
@@ -1310,7 +1362,7 @@ Last-Update: 2022-06-18
      public void testAuthLearnerAgainstNoAuthRequiredServer() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true");
-@@ -142,7 +138,6 @@
+@@ -142,7 +138,6 @@ public class QuorumAuthUpgradeTest exten
       * peer1 -&gt; quorum.auth.enableSasl=true, quorum.auth.learnerRequireSasl=true, quorum.auth.serverRequireSasl=true
       */
      @Test
@@ -1318,7 +1370,7 @@ Last-Update: 2022-06-18
      public void testAuthLearnerServer() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true");
-@@ -173,7 +168,6 @@
+@@ -173,7 +168,6 @@ public class QuorumAuthUpgradeTest exten
       * Now, all the servers are fully upgraded and running in secured mode.
       */
      @Test
@@ -1326,9 +1378,11 @@ Last-Update: 2022-06-18
      public void testRollingUpgrade() throws Exception {
          // Start peer0,1,2 servers with quorum.auth.enableSasl=false and
          // quorum.auth.learnerRequireSasl=false, quorum.auth.serverRequireSasl=false
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumDigestAuthTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumDigestAuthTest.java
-@@ -37,7 +37,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumDigestAuthTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumDigestAuthTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumDigestAuthTest.java
+@@ -37,7 +37,6 @@ import org.apache.zookeeper.test.ClientB
  import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -1336,7 +1390,7 @@ Last-Update: 2022-06-18
  
  public class QuorumDigestAuthTest extends QuorumAuthTestBase {
  
-@@ -79,7 +78,6 @@
+@@ -79,7 +78,6 @@ public class QuorumDigestAuthTest extend
       * Test to verify that server is able to start with valid credentials
       */
      @Test
@@ -1344,7 +1398,7 @@ Last-Update: 2022-06-18
      public void testValidCredentials() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true");
-@@ -101,7 +99,6 @@
+@@ -101,7 +99,6 @@ public class QuorumDigestAuthTest extend
       * when using multiple Quorum / Election addresses
       */
      @Test
@@ -1352,7 +1406,7 @@ Last-Update: 2022-06-18
      public void testValidCredentialsWithMultiAddresses() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true");
-@@ -124,7 +121,6 @@
+@@ -124,7 +121,6 @@ public class QuorumDigestAuthTest extend
       * Quorum will talk each other even if the authentication is not succeeded
       */
      @Test
@@ -1360,7 +1414,7 @@ Last-Update: 2022-06-18
      public void testSaslNotRequiredWithInvalidCredentials() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_LEARNER_SASL_LOGIN_CONTEXT, "QuorumLearnerInvalid");
-@@ -146,7 +142,6 @@
+@@ -146,7 +142,6 @@ public class QuorumDigestAuthTest extend
       * quorum.auth.learnerRequireSasl=true
       */
      @Test
@@ -1368,7 +1422,7 @@ Last-Update: 2022-06-18
      public void testSaslRequiredInvalidCredentials() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_LEARNER_SASL_LOGIN_CONTEXT, "QuorumLearnerInvalid");
-@@ -167,7 +162,6 @@
+@@ -167,7 +162,6 @@ public class QuorumDigestAuthTest extend
       * enabled while enabling quorum server require sasl.
       */
      @Test
@@ -1376,7 +1430,7 @@ Last-Update: 2022-06-18
      public void testEnableQuorumServerRequireSaslWithoutQuorumLearnerRequireSasl() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_LEARNER_SASL_LOGIN_CONTEXT, "QuorumLearner");
-@@ -196,7 +190,6 @@
+@@ -196,7 +190,6 @@ public class QuorumDigestAuthTest extend
       * enabled while enabling quorum server require sasl.
       */
      @Test
@@ -1384,9 +1438,11 @@ Last-Update: 2022-06-18
      public void testEnableQuorumAuthenticationConfigurations() throws Exception {
          Map<String, String> authConfigs = new HashMap<String, String>();
          authConfigs.put(QuorumAuth.QUORUM_LEARNER_SASL_LOGIN_CONTEXT, "QuorumLearner");
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosAuthTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosAuthTest.java
-@@ -33,7 +33,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosAuthTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosAuthTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosAuthTest.java
+@@ -33,7 +33,6 @@ import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeAll;
  import org.junit.jupiter.api.Test;
@@ -1394,7 +1450,7 @@ Last-Update: 2022-06-18
  
  public class QuorumKerberosAuthTest extends KerberosSecurityTestcase {
  
-@@ -110,7 +109,6 @@
+@@ -110,7 +109,6 @@ public class QuorumKerberosAuthTest exte
       * Test to verify that server is able to start with valid credentials
       */
      @Test
@@ -1402,7 +1458,7 @@ Last-Update: 2022-06-18
      public void testValidCredentials() throws Exception {
          String serverPrincipal = KerberosTestUtils.getServerPrincipal();
          serverPrincipal = serverPrincipal.substring(0, serverPrincipal.lastIndexOf("@"));
-@@ -134,7 +132,6 @@
+@@ -134,7 +132,6 @@ public class QuorumKerberosAuthTest exte
       * when using multiple Quorum / Election addresses
       */
      @Test
@@ -1410,9 +1466,11 @@ Last-Update: 2022-06-18
      public void testValidCredentialsWithMultiAddresses() throws Exception {
          String serverPrincipal = KerberosTestUtils.getServerPrincipal();
          serverPrincipal = serverPrincipal.substring(0, serverPrincipal.lastIndexOf("@"));
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java
-@@ -36,7 +36,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java
+@@ -36,7 +36,6 @@ import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeAll;
  import org.junit.jupiter.api.Test;
@@ -1420,7 +1478,7 @@ Last-Update: 2022-06-18
  
  public class QuorumKerberosHostBasedAuthTest extends KerberosSecurityTestcase {
  
-@@ -135,7 +134,6 @@
+@@ -135,7 +134,6 @@ public class QuorumKerberosHostBasedAuth
       * Test to verify that server is able to start with valid credentials
       */
      @Test
@@ -1428,7 +1486,7 @@ Last-Update: 2022-06-18
      public void testValidCredentials() throws Exception {
          String serverPrincipal = hostServerPrincipal.substring(0, hostServerPrincipal.lastIndexOf("@"));
          Map<String, String> authConfigs = new HashMap<String, String>();
-@@ -158,7 +156,6 @@
+@@ -158,7 +156,6 @@ public class QuorumKerberosHostBasedAuth
       * when using multiple Quorum / Election addresses
       */
      @Test
@@ -1436,7 +1494,7 @@ Last-Update: 2022-06-18
      public void testValidCredentialsWithMultiAddresses() throws Exception {
          String serverPrincipal = hostServerPrincipal.substring(0, hostServerPrincipal.lastIndexOf("@"));
          Map<String, String> authConfigs = new HashMap<String, String>();
-@@ -180,7 +177,6 @@
+@@ -180,7 +177,6 @@ public class QuorumKerberosHostBasedAuth
       * Test to verify that the bad server connection to the quorum should be rejected.
       */
      @Test
@@ -1444,9 +1502,11 @@ Last-Update: 2022-06-18
      public void testConnectBadServer() throws Exception {
          String serverPrincipal = hostServerPrincipal.substring(0, hostServerPrincipal.lastIndexOf("@"));
          Map<String, String> authConfigs = new HashMap<String, String>();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/JvmPauseMonitorTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/JvmPauseMonitorTest.java
-@@ -24,7 +24,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/JvmPauseMonitorTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/JvmPauseMonitorTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/JvmPauseMonitorTest.java
+@@ -24,7 +24,6 @@ import static org.mockito.Mockito.when;
  import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.Test;
@@ -1454,7 +1514,7 @@ Last-Update: 2022-06-18
  
  public class JvmPauseMonitorTest {
  
-@@ -34,7 +33,6 @@
+@@ -34,7 +33,6 @@ public class JvmPauseMonitorTest {
      private JvmPauseMonitor pauseMonitor;
  
      @Test
@@ -1462,7 +1522,7 @@ Last-Update: 2022-06-18
      public void testJvmPauseMonitorExceedInfoThreshold() throws InterruptedException {
          QuorumPeerConfig qpConfig = mock(QuorumPeerConfig.class);
          when(qpConfig.getJvmPauseSleepTimeMs()).thenReturn(sleepTime);
-@@ -52,7 +50,6 @@
+@@ -52,7 +50,6 @@ public class JvmPauseMonitorTest {
      }
  
      @Test
@@ -1470,9 +1530,11 @@ Last-Update: 2022-06-18
      public void testJvmPauseMonitorExceedWarnThreshold() throws InterruptedException {
          QuorumPeerConfig qpConfig = mock(QuorumPeerConfig.class);
          when(qpConfig.getJvmPauseSleepTimeMs()).thenReturn(sleepTime);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatchManagerTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatchManagerTest.java
-@@ -38,7 +38,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatchManagerTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatchManagerTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatchManagerTest.java
+@@ -38,7 +38,6 @@ import org.apache.zookeeper.server.DumbW
  import org.apache.zookeeper.server.ServerCnxn;
  import org.apache.zookeeper.server.ServerMetrics;
  import org.junit.jupiter.api.BeforeEach;
@@ -1480,7 +1542,7 @@ Last-Update: 2022-06-18
  import org.junit.jupiter.params.ParameterizedTest;
  import org.junit.jupiter.params.provider.Arguments;
  import org.junit.jupiter.params.provider.MethodSource;
-@@ -227,7 +226,6 @@
+@@ -227,7 +226,6 @@ public class WatchManagerTest extends ZK
       */
      @ParameterizedTest
      @MethodSource("data")
@@ -1488,7 +1550,7 @@ Last-Update: 2022-06-18
      public void testAddAndTriggerWatcher(String className) throws IOException {
          IWatchManager manager = getWatchManager(className);
          int paths = 1;
-@@ -288,7 +286,6 @@
+@@ -288,7 +286,6 @@ public class WatchManagerTest extends ZK
       */
      @ParameterizedTest
      @MethodSource("data")
@@ -1496,7 +1558,7 @@ Last-Update: 2022-06-18
      public void testRemoveWatcherOnPath(String className) throws IOException {
          IWatchManager manager = getWatchManager(className);
          int paths = 10;
-@@ -348,7 +345,6 @@
+@@ -348,7 +345,6 @@ public class WatchManagerTest extends ZK
       */
      @ParameterizedTest
      @MethodSource("data")
@@ -1504,9 +1566,11 @@ Last-Update: 2022-06-18
      public void testDeadWatchers(String className) throws IOException {
          System.setProperty("zookeeper.watcherCleanThreshold", "10");
          System.setProperty("zookeeper.watcherCleanIntervalInSeconds", "1");
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/DisconnectedWatcherTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/DisconnectedWatcherTest.java
-@@ -32,7 +32,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/DisconnectedWatcherTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/DisconnectedWatcherTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/DisconnectedWatcherTest.java
+@@ -32,7 +32,6 @@ import org.apache.zookeeper.ZooKeeper;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -1514,7 +1578,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -188,7 +187,6 @@
+@@ -188,7 +187,6 @@ public class DisconnectedWatcherTest ext
      // @see jira issue ZOOKEEPER-706. Test auto reset of a large number of
      // watches which require multiple SetWatches calls.
      @Test
@@ -1522,9 +1586,11 @@ Last-Update: 2022-06-18
      public void testManyChildWatchersAutoReset() throws Exception {
          zk2 = createClient(watcher2);
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
-@@ -33,7 +33,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
+@@ -33,7 +33,6 @@ import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.common.IOUtils;
  import org.apache.zookeeper.common.X509Exception.SSLContextException;
  import org.junit.jupiter.api.Test;
@@ -1532,7 +1598,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -43,7 +42,6 @@
+@@ -43,7 +42,6 @@ public class FourLetterWordsTest extends
  
      /** Test the various four letter words */
      @Test
@@ -1540,7 +1606,7 @@ Last-Update: 2022-06-18
      public void testFourLetterWords() throws Exception {
          verify("ruok", "imok");
          verify("envi", "java.version");
-@@ -127,7 +125,6 @@
+@@ -127,7 +125,6 @@ public class FourLetterWordsTest extends
      }
  
      @Test
@@ -1548,7 +1614,7 @@ Last-Update: 2022-06-18
      public void testValidateStatOutput() throws Exception {
          ZooKeeper zk1 = createClient();
          ZooKeeper zk2 = createClient();
-@@ -171,7 +168,6 @@
+@@ -171,7 +168,6 @@ public class FourLetterWordsTest extends
      }
  
      @Test
@@ -1556,7 +1622,7 @@ Last-Update: 2022-06-18
      public void testValidateConsOutput() throws Exception {
          ZooKeeper zk1 = createClient();
          ZooKeeper zk2 = createClient();
-@@ -193,7 +189,6 @@
+@@ -193,7 +189,6 @@ public class FourLetterWordsTest extends
      }
  
      @Test
@@ -1564,7 +1630,7 @@ Last-Update: 2022-06-18
      public void testValidateSocketTimeout() throws Exception {
          /**
           * testing positive scenario that even with timeout parameter the
-@@ -204,7 +199,6 @@
+@@ -204,7 +199,6 @@ public class FourLetterWordsTest extends
      }
  
      @Test
@@ -1572,9 +1638,11 @@ Last-Update: 2022-06-18
      public void testSetTraceMask() throws Exception {
          String gtmkResp = sendRequest("gtmk");
          assertNotNull(gtmkResp);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsWhiteListTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsWhiteListTest.java
-@@ -25,7 +25,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsWhiteListTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsWhiteListTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsWhiteListTest.java
+@@ -25,7 +25,6 @@ import org.apache.zookeeper.TestableZooK
  import org.apache.zookeeper.common.X509Exception.SSLContextException;
  import org.apache.zookeeper.server.command.FourLetterCommands;
  import org.junit.jupiter.api.Test;
@@ -1582,7 +1650,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -40,7 +39,6 @@
+@@ -40,7 +39,6 @@ public class FourLetterWordsWhiteListTes
       * which other tests depend on.).
       */
      @Test
@@ -1590,7 +1658,7 @@ Last-Update: 2022-06-18
      public void testFourLetterWordsAllDisabledByDefault() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
-@@ -65,7 +63,6 @@
+@@ -65,7 +63,6 @@ public class FourLetterWordsWhiteListTes
      }
  
      @Test
@@ -1598,7 +1666,7 @@ Last-Update: 2022-06-18
      public void testFourLetterWordsEnableSomeCommands() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
-@@ -93,7 +90,6 @@
+@@ -93,7 +90,6 @@ public class FourLetterWordsWhiteListTes
      }
  
      @Test
@@ -1606,7 +1674,7 @@ Last-Update: 2022-06-18
      public void testISROEnabledWhenReadOnlyModeEnabled() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
-@@ -105,7 +101,6 @@
+@@ -105,7 +101,6 @@ public class FourLetterWordsWhiteListTes
      }
  
      @Test
@@ -1614,7 +1682,7 @@ Last-Update: 2022-06-18
      public void testFourLetterWordsInvalidConfiguration() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
-@@ -121,7 +116,6 @@
+@@ -121,7 +116,6 @@ public class FourLetterWordsWhiteListTes
      }
  
      @Test
@@ -1622,7 +1690,7 @@ Last-Update: 2022-06-18
      public void testFourLetterWordsEnableAllCommandsThroughAsterisk() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
-@@ -131,7 +125,6 @@
+@@ -131,7 +125,6 @@ public class FourLetterWordsWhiteListTes
      }
  
      @Test
@@ -1630,9 +1698,11 @@ Last-Update: 2022-06-18
      public void testFourLetterWordsEnableAllCommandsThroughExplicitList() throws Exception {
          stopServer();
          FourLetterCommands.resetWhiteList();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
-@@ -59,7 +59,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
+@@ -59,7 +59,6 @@ import org.apache.zookeeper.data.Id;
  import org.apache.zookeeper.data.Stat;
  import org.apache.zookeeper.server.SyncRequestProcessor;
  import org.junit.jupiter.api.BeforeEach;
@@ -1640,7 +1710,7 @@ Last-Update: 2022-06-18
  import org.junit.jupiter.params.ParameterizedTest;
  import org.junit.jupiter.params.provider.ValueSource;
  import org.slf4j.Logger;
-@@ -190,7 +189,6 @@
+@@ -190,7 +189,6 @@ public class MultiOperationTest extends
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -1648,7 +1718,7 @@ Last-Update: 2022-06-18
      public void testInvalidPath(boolean useAsync) throws Exception {
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
-@@ -293,7 +291,6 @@
+@@ -293,7 +291,6 @@ public class MultiOperationTest extends
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -1656,7 +1726,7 @@ Last-Update: 2022-06-18
      public void testBlankPath(boolean useAsync) throws Exception {
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
-@@ -316,7 +313,6 @@
+@@ -316,7 +313,6 @@ public class MultiOperationTest extends
       */
      @ParameterizedTest
      @ValueSource(booleans = {true, false})
@@ -1664,9 +1734,11 @@ Last-Update: 2022-06-18
      public void testInvalidCreateModeFlag(boolean useAsync) throws Exception {
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/NonRecoverableErrorTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/NonRecoverableErrorTest.java
-@@ -37,7 +37,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/NonRecoverableErrorTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/NonRecoverableErrorTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/NonRecoverableErrorTest.java
+@@ -37,7 +37,6 @@ import org.apache.zookeeper.server.quoru
  import org.apache.zookeeper.server.quorum.QuorumPeerTestBase;
  import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
  import org.junit.jupiter.api.Test;
@@ -1674,7 +1746,7 @@ Last-Update: 2022-06-18
  
  /**
   * This class tests the non-recoverable error behavior of quorum server.
-@@ -52,7 +51,6 @@
+@@ -52,7 +51,6 @@ public class NonRecoverableErrorTest ext
       * writing transaction log), ZooKeeper is still available.
       */
      @Test
@@ -1682,9 +1754,11 @@ Last-Update: 2022-06-18
      public void testZooKeeperServiceAvailableOnLeader() throws Exception {
          int SERVER_COUNT = 3;
          final int[] clientPorts = new int[SERVER_COUNT];
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReadOnlyModeTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReadOnlyModeTest.java
-@@ -43,7 +43,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReadOnlyModeTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReadOnlyModeTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReadOnlyModeTest.java
+@@ -43,7 +43,6 @@ import org.apache.zookeeper.test.ClientB
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -1692,7 +1766,7 @@ Last-Update: 2022-06-18
  import org.slf4j.LoggerFactory;
  
  public class ReadOnlyModeTest extends ZKTestCase {
-@@ -67,7 +66,6 @@
+@@ -67,7 +66,6 @@ public class ReadOnlyModeTest extends ZK
       * Test write operations using multi request.
       */
      @Test
@@ -1700,7 +1774,7 @@ Last-Update: 2022-06-18
      public void testMultiTransaction() throws Exception {
          qu.enableLocalSession(true);
          qu.startQuorum();
-@@ -111,7 +109,6 @@
+@@ -111,7 +109,6 @@ public class ReadOnlyModeTest extends ZK
       * during read-only mode, then regains a quorum and tries to write again.
       */
      @Test
@@ -1708,7 +1782,7 @@ Last-Update: 2022-06-18
      public void testReadOnlyClient() throws Exception {
          qu.enableLocalSession(true);
          qu.startQuorum();
-@@ -165,7 +162,6 @@
+@@ -165,7 +162,6 @@ public class ReadOnlyModeTest extends ZK
       * ConnectedReadOnly state notification.
       */
      @Test
@@ -1716,7 +1790,7 @@ Last-Update: 2022-06-18
      public void testConnectionEvents() throws Exception {
          qu.enableLocalSession(true);
          qu.startQuorum();
-@@ -209,7 +205,6 @@
+@@ -209,7 +205,6 @@ public class ReadOnlyModeTest extends ZK
       * the user.
       */
      @Test
@@ -1724,7 +1798,7 @@ Last-Update: 2022-06-18
      public void testSessionEstablishment() throws Exception {
          qu.enableLocalSession(true);
          qu.startQuorum();
-@@ -243,7 +238,6 @@
+@@ -243,7 +238,6 @@ public class ReadOnlyModeTest extends ZK
      }
  
      @Test
@@ -1732,7 +1806,7 @@ Last-Update: 2022-06-18
      public void testGlobalSessionInRO() throws Exception {
          qu.startQuorum();
  
-@@ -286,7 +280,6 @@
+@@ -286,7 +280,6 @@ public class ReadOnlyModeTest extends ZK
       */
      @SuppressWarnings("deprecation")
      @Test
@@ -1740,9 +1814,11 @@ Last-Update: 2022-06-18
      public void testSeekForRwServer() throws Exception {
          qu.enableLocalSession(true);
          qu.startQuorum();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigExceptionTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigExceptionTest.java
-@@ -37,7 +37,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigExceptionTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigExceptionTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigExceptionTest.java
+@@ -37,7 +37,6 @@ import org.apache.zookeeper.server.quoru
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -1750,7 +1826,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -89,7 +88,6 @@
+@@ -89,7 +88,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1758,7 +1834,7 @@ Last-Update: 2022-06-18
      public void testReconfigDisabled() throws InterruptedException {
          QuorumPeerConfig.setReconfigEnabled(false);
  
-@@ -111,7 +109,6 @@
+@@ -111,7 +109,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1766,7 +1842,7 @@ Last-Update: 2022-06-18
      public void testReconfigFailWithoutAuth() throws InterruptedException {
          try {
              reconfigPort();
-@@ -123,7 +120,6 @@
+@@ -123,7 +120,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1774,7 +1850,7 @@ Last-Update: 2022-06-18
      public void testReconfigEnabledWithSuperUser() throws InterruptedException {
          try {
              zkAdmin.addAuthInfo("digest", "super:test".getBytes());
-@@ -134,7 +130,6 @@
+@@ -134,7 +130,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1782,7 +1858,7 @@ Last-Update: 2022-06-18
      public void testReconfigFailWithAuthWithNoACL() throws InterruptedException {
          resetZKAdmin();
  
-@@ -149,7 +144,6 @@
+@@ -149,7 +144,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1790,7 +1866,7 @@ Last-Update: 2022-06-18
      public void testReconfigEnabledWithAuthAndWrongACL() throws InterruptedException {
          resetZKAdmin();
  
-@@ -168,7 +162,6 @@
+@@ -168,7 +162,6 @@ public class ReconfigExceptionTest exten
      }
  
      @Test
@@ -1798,9 +1874,11 @@ Last-Update: 2022-06-18
      public void testReconfigEnabledWithAuthAndACL() throws InterruptedException {
          resetZKAdmin();
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigMisconfigTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigMisconfigTest.java
-@@ -33,7 +33,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigMisconfigTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigMisconfigTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigMisconfigTest.java
+@@ -33,7 +33,6 @@ import org.apache.zookeeper.server.quoru
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
@@ -1808,7 +1886,7 @@ Last-Update: 2022-06-18
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
-@@ -75,7 +74,6 @@
+@@ -75,7 +74,6 @@ public class ReconfigMisconfigTest exten
      }
  
      @Test
@@ -1816,9 +1894,11 @@ Last-Update: 2022-06-18
      public void testReconfigFailWithoutSuperuserPasswordConfiguredOnServer() throws InterruptedException {
          // This tests the case where ZK ensemble does not have the super user's password configured.
          // Reconfig should fail as the super user has to be explicitly configured via
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/util/TestCircularBlockingQueue.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/util/TestCircularBlockingQueue.java
-@@ -24,7 +24,6 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/util/TestCircularBlockingQueue.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/util/TestCircularBlockingQueue.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/util/TestCircularBlockingQueue.java
+@@ -24,7 +24,6 @@ import java.util.concurrent.ExecutorServ
  import java.util.concurrent.Executors;
  import java.util.concurrent.Future;
  import org.junit.jupiter.api.Test;
@@ -1826,7 +1906,7 @@ Last-Update: 2022-06-18
  
  public class TestCircularBlockingQueue {
  
-@@ -48,7 +47,6 @@
+@@ -48,7 +47,6 @@ public class TestCircularBlockingQueue {
    }
  
    @Test
diff --git a/debian/patches/21-use-ValueSource-with-ints.patch b/debian/patches/21-use-ValueSource-with-ints.patch
index 0901516..6b01e9a 100644
--- a/debian/patches/21-use-ValueSource-with-ints.patch
+++ b/debian/patches/21-use-ValueSource-with-ints.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-16
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
-@@ -77,8 +77,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
+@@ -77,8 +77,9 @@ public class ObserverMasterTest extends
       * be elected if and only if an Observer voted.
       */
      @ParameterizedTest
@@ -18,7 +20,7 @@ Last-Update: 2022-06-16
          // We expect two notifications before we want to continue
          latch = new CountDownLatch(2);
          setUp(-1, testObserverMaster);
-@@ -176,8 +177,9 @@
+@@ -176,8 +177,9 @@ public class ObserverMasterTest extends
      }
  
      @ParameterizedTest
@@ -30,7 +32,7 @@ Last-Update: 2022-06-16
          setUp(-1, testObserverMaster);
          q3.start();
          assertTrue(ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT_OBS, CONNECTION_TIMEOUT),
-@@ -209,8 +211,9 @@
+@@ -209,8 +211,9 @@ public class ObserverMasterTest extends
      }
  
      @ParameterizedTest
@@ -42,7 +44,7 @@ Last-Update: 2022-06-16
          setUp(-1, testObserverMaster);
  
          zk = new ZooKeeper("127.0.0.1:" + CLIENT_PORT_QP1, ClientBase.CONNECTION_TIMEOUT, null);
-@@ -273,8 +276,9 @@
+@@ -273,8 +276,9 @@ public class ObserverMasterTest extends
      }
  
      @ParameterizedTest
@@ -54,7 +56,7 @@ Last-Update: 2022-06-16
          // flush all beans, then start
          for (ZKMBeanInfo beanInfo : MBeanRegistry.getInstance().getRegisteredBeans()) {
              MBeanRegistry.getInstance().unregister(beanInfo);
-@@ -395,9 +399,10 @@
+@@ -395,9 +399,10 @@ public class ObserverMasterTest extends
      // This test is known to be flaky and fail due to "reconfig already in progress".
      // TODO: Investigate intermittent testDynamicReconfig failures.
      @ParameterizedTest
@@ -67,9 +69,11 @@ Last-Update: 2022-06-16
          if (!testObserverMaster) {
              return;
          }
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
-@@ -127,8 +127,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/RemoveWatchesTest.java
+@@ -127,8 +127,9 @@ public class RemoveWatchesTest extends C
       * Test verifies removal of single watcher when there is server connection
       */
      @ParameterizedTest
@@ -81,7 +85,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          zk1.create("/node2", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          MyWatcher w1 = new MyWatcher("/node1", 1);
-@@ -159,8 +160,9 @@
+@@ -159,8 +160,9 @@ public class RemoveWatchesTest extends C
       * connection
       */
      @ParameterizedTest
@@ -93,7 +97,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          MyWatcher w1 = new MyWatcher("/node1", 1);
          LOG.info("Adding data watcher {} on path {}", w1, "/node1");
-@@ -189,8 +191,9 @@
+@@ -189,8 +191,9 @@ public class RemoveWatchesTest extends C
       * connection
       */
      @ParameterizedTest
@@ -105,7 +109,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
          LOG.info("Adding child watcher {} on path {}", w1, "/node1");
-@@ -224,8 +227,9 @@
+@@ -224,8 +227,9 @@ public class RemoveWatchesTest extends C
       * data, child, exists
       */
      @ParameterizedTest
@@ -117,7 +121,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
          MyWatcher w2 = new MyWatcher("/node1", 2);
-@@ -249,8 +253,9 @@
+@@ -249,8 +253,9 @@ public class RemoveWatchesTest extends C
       * watchers. Child watchers shouldn't be removed
       */
      @ParameterizedTest
@@ -129,7 +133,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
          MyWatcher w2 = new MyWatcher("/node1", 1);
-@@ -291,8 +296,9 @@
+@@ -291,8 +296,9 @@ public class RemoveWatchesTest extends C
       * watchers. Data watchers shouldn't be removed
       */
      @ParameterizedTest
@@ -141,7 +145,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
          MyWatcher w2 = new MyWatcher("/node1", 1);
-@@ -332,8 +338,9 @@
+@@ -332,8 +338,9 @@ public class RemoveWatchesTest extends C
       * Test verifies given watcher doesn't exists!
       */
      @ParameterizedTest
@@ -153,7 +157,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
          MyWatcher w2 = new MyWatcher("/node1", 2);
-@@ -380,8 +387,9 @@
+@@ -380,8 +387,9 @@ public class RemoveWatchesTest extends C
       * function
       */
      @ParameterizedTest
@@ -165,7 +169,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 1);
          MyWatcher w2 = new MyWatcher("/node1", 2);
-@@ -406,8 +414,9 @@
+@@ -406,8 +414,9 @@ public class RemoveWatchesTest extends C
       * function
       */
      @ParameterizedTest
@@ -177,7 +181,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
          MyWatcher w2 = new MyWatcher("/node1", 1);
-@@ -431,8 +440,9 @@
+@@ -431,8 +440,9 @@ public class RemoveWatchesTest extends C
       * local=true, otw should retain it
       */
      @ParameterizedTest
@@ -189,7 +193,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          MyWatcher w1 = new MyWatcher("/node1", 2);
          MyWatcher w2 = new MyWatcher("/node1", 1);
-@@ -466,8 +476,9 @@
+@@ -466,8 +476,9 @@ public class RemoveWatchesTest extends C
       * datastructure 'watchManager.existWatches'
       */
      @ParameterizedTest
@@ -201,7 +205,7 @@ Last-Update: 2022-06-16
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
          MyWatcher w;
-@@ -494,8 +505,9 @@
+@@ -494,8 +505,9 @@ public class RemoveWatchesTest extends C
       * 'watchManager.childWatches'
       */
      @ParameterizedTest
@@ -213,7 +217,7 @@ Last-Update: 2022-06-16
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
          MyWatcher w;
-@@ -529,8 +541,9 @@
+@@ -529,8 +541,9 @@ public class RemoveWatchesTest extends C
       * 'watchManager.dataWatches'
       */
      @ParameterizedTest
@@ -225,7 +229,7 @@ Last-Update: 2022-06-16
          int count = 50;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
          MyWatcher w;
-@@ -560,8 +573,9 @@
+@@ -560,8 +573,9 @@ public class RemoveWatchesTest extends C
       * WatcherType#Any. Also, verifies internal watchManager datastructures
       */
      @ParameterizedTest
@@ -237,7 +241,7 @@ Last-Update: 2022-06-16
          int count = 3;
          List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
          MyWatcher w;
-@@ -606,8 +620,9 @@
+@@ -606,8 +620,9 @@ public class RemoveWatchesTest extends C
       * Test verifies removing watcher having namespace
       */
      @ParameterizedTest
@@ -249,7 +253,7 @@ Last-Update: 2022-06-16
          // creating the subtree for chRoot clients.
          String chRoot = "/appsX";
          zk1.create("/appsX", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -661,8 +676,9 @@
+@@ -661,8 +676,9 @@ public class RemoveWatchesTest extends C
       *
       */
      @ParameterizedTest
@@ -261,7 +265,7 @@ Last-Update: 2022-06-16
          CountdownWatcher watcher = new CountdownWatcher();
          ZooKeeper zk = spy(new ZooKeeper(hostPort, CONNECTION_TIMEOUT, watcher));
          MyWatchManager watchManager = new MyWatchManager(false, watcher);
-@@ -687,8 +703,9 @@
+@@ -687,8 +703,9 @@ public class RemoveWatchesTest extends C
       * Test verifies given watcher doesn't exists!
       */
      @ParameterizedTest
@@ -273,7 +277,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          try {
              removeAllWatches(zk2, "/node1", WatcherType.Any, false, Code.NOWATCHER, useAsync);
-@@ -702,8 +719,9 @@
+@@ -702,8 +719,9 @@ public class RemoveWatchesTest extends C
       * Test verifies null watcher
       */
      @ParameterizedTest
@@ -285,7 +289,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          try {
              if (useAsync) {
-@@ -722,8 +740,9 @@
+@@ -722,8 +740,9 @@ public class RemoveWatchesTest extends C
       * function
       */
      @ParameterizedTest
@@ -297,7 +301,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch dataWatchCount = new CountDownLatch(1);
          final CountDownLatch rmWatchCount = new CountDownLatch(1);
-@@ -756,8 +775,9 @@
+@@ -756,8 +775,9 @@ public class RemoveWatchesTest extends C
       * watcher function
       */
      @ParameterizedTest
@@ -309,7 +313,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch childWatchCount = new CountDownLatch(1);
          final CountDownLatch rmWatchCount = new CountDownLatch(1);
-@@ -790,8 +810,9 @@
+@@ -790,8 +810,9 @@ public class RemoveWatchesTest extends C
       * function
       */
      @ParameterizedTest
@@ -321,7 +325,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch dWatchCount = new CountDownLatch(2);
          final CountDownLatch rmWatchCount = new CountDownLatch(2);
-@@ -837,8 +858,9 @@
+@@ -837,8 +858,9 @@ public class RemoveWatchesTest extends C
       * watcher function
       */
      @ParameterizedTest
@@ -333,7 +337,7 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch cWatchCount = new CountDownLatch(2);
          final CountDownLatch rmWatchCount = new CountDownLatch(2);
-@@ -884,8 +906,9 @@
+@@ -884,8 +906,9 @@ public class RemoveWatchesTest extends C
       * watcher functions
       */
      @ParameterizedTest
@@ -345,9 +349,11 @@ Last-Update: 2022-06-16
          zk1.create("/node1", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          final CountDownLatch watchCount = new CountDownLatch(2);
          final CountDownLatch rmWatchCount = new CountDownLatch(4);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
-@@ -55,8 +55,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
+@@ -55,8 +55,9 @@ public class LearnerMetricsTest extends
      }
  
      @ParameterizedTest
@@ -359,9 +365,11 @@ Last-Update: 2022-06-16
          Learner.setAsyncSending(asyncSending);
          ServerMetrics.getMetrics().resetAll();
          ClientBase.setupTestEnv();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigDuringLeaderSyncTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigDuringLeaderSyncTest.java
-@@ -81,8 +81,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigDuringLeaderSyncTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigDuringLeaderSyncTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigDuringLeaderSyncTest.java
+@@ -81,8 +81,9 @@ public class ReconfigDuringLeaderSyncTes
       */
  
      @ParameterizedTest
@@ -373,9 +381,11 @@ Last-Update: 2022-06-16
          setup(asyncSending);
          final int[] clientPorts = new int[SERVER_COUNT + 1];
          StringBuilder sb = new StringBuilder();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
-@@ -154,80 +154,90 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
+@@ -154,80 +154,90 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -486,7 +496,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          boolean tcpNoDelay = serverSideSocket.getTcpNoDelay();
          tcpNoDelay = !tcpNoDelay;
-@@ -237,16 +247,18 @@
+@@ -237,16 +247,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -509,7 +519,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          int soLinger = serverSideSocket.getSoLinger();
          if (soLinger == -1) {
-@@ -263,16 +275,18 @@
+@@ -263,16 +275,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -532,7 +542,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          int timeout = serverSideSocket.getSoTimeout();
          timeout = timeout + 10;
-@@ -282,16 +296,18 @@
+@@ -282,16 +296,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -555,7 +565,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          serverSideSocket.setSendBufferSize(serverSideSocket.getSendBufferSize() + 1024);
          assertFalse(serverSideSocket.isModeKnown());
-@@ -302,16 +318,18 @@
+@@ -302,16 +318,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -578,7 +588,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          serverSideSocket.setReceiveBufferSize(serverSideSocket.getReceiveBufferSize() + 1024);
          assertFalse(serverSideSocket.isModeKnown());
-@@ -322,16 +340,18 @@
+@@ -322,16 +340,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -601,7 +611,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          boolean keepAlive = serverSideSocket.getKeepAlive();
          keepAlive = !keepAlive;
-@@ -341,16 +361,18 @@
+@@ -341,16 +361,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -624,7 +634,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          serverSideSocket.setTrafficClass(SocketOptions.IP_TOS);
          assertFalse(serverSideSocket.isModeKnown());
-@@ -360,16 +382,18 @@
+@@ -360,16 +382,18 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -647,7 +657,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          boolean reuseAddress = serverSideSocket.getReuseAddress();
          reuseAddress = !reuseAddress;
-@@ -379,56 +403,63 @@
+@@ -379,56 +403,63 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -725,7 +735,7 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          serverSideSocket.isInputShutdown();
          assertFalse(serverSideSocket.isModeKnown());
-@@ -437,8 +468,9 @@
+@@ -437,8 +468,9 @@ public class UnifiedServerSocketModeDete
      }
  
      @ParameterizedTest
@@ -737,9 +747,11 @@ Last-Update: 2022-06-16
          init(useSecureClient);
          serverSideSocket.isOutputShutdown();
          assertFalse(serverSideSocket.isModeKnown());
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/WatchLeakTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/WatchLeakTest.java
-@@ -81,8 +81,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/WatchLeakTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/WatchLeakTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/WatchLeakTest.java
+@@ -81,8 +81,9 @@ public class WatchLeakTest {
       */
  
      @ParameterizedTest
@@ -751,9 +763,11 @@ Last-Update: 2022-06-16
  
          NIOServerCnxnFactory serverCnxnFactory = mock(NIOServerCnxnFactory.class);
          final SelectionKey sk = new FakeSK();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
-@@ -188,8 +188,9 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java
+@@ -188,8 +188,9 @@ public class MultiOperationTest extends
       * Test verifies the multi calls with invalid znode path
       */
      @ParameterizedTest
@@ -765,7 +779,7 @@ Last-Update: 2022-06-16
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
          expectedResultCodes.add(KeeperException.Code.BADARGUMENTS.intValue());
-@@ -245,8 +246,9 @@
+@@ -245,8 +246,9 @@ public class MultiOperationTest extends
       * 3. multi delete should succeed.
       */
      @ParameterizedTest
@@ -777,7 +791,7 @@ Last-Update: 2022-06-16
          zk.create("/foo", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
  
          ZooKeeper epheZk = createClient();
-@@ -290,8 +292,9 @@
+@@ -290,8 +292,9 @@ public class MultiOperationTest extends
       * Test verifies the multi calls with blank znode path
       */
      @ParameterizedTest
@@ -789,7 +803,7 @@ Last-Update: 2022-06-16
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
          expectedResultCodes.add(KeeperException.Code.BADARGUMENTS.intValue());
-@@ -312,8 +315,9 @@
+@@ -312,8 +315,9 @@ public class MultiOperationTest extends
       * Test verifies the multi.create with invalid createModeFlag
       */
      @ParameterizedTest
@@ -801,7 +815,7 @@ Last-Update: 2022-06-16
          List<Integer> expectedResultCodes = new ArrayList<Integer>();
          expectedResultCodes.add(KeeperException.Code.RUNTIMEINCONSISTENCY.intValue());
          expectedResultCodes.add(KeeperException.Code.BADARGUMENTS.intValue());
-@@ -329,8 +333,9 @@
+@@ -329,8 +333,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -813,7 +827,7 @@ Last-Update: 2022-06-16
          // creating the subtree for chRoot clients.
          String chRoot = createNameSpace(useAsync);
          // Creating child using chRoot client.
-@@ -350,8 +355,9 @@
+@@ -350,8 +355,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -825,7 +839,7 @@ Last-Update: 2022-06-16
          // creating the subtree for chRoot clients.
          String chRoot = createNameSpace(useAsync);
          // setData using chRoot client.
-@@ -372,8 +378,9 @@
+@@ -372,8 +378,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -837,7 +851,7 @@ Last-Update: 2022-06-16
          // creating the subtree for chRoot clients.
          String chRoot = createNameSpace(useAsync);
          // checking the child version using chRoot client.
-@@ -391,8 +398,9 @@
+@@ -391,8 +398,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -849,7 +863,7 @@ Last-Update: 2022-06-16
          // creating the subtree for chRoot clients.
          String chRoot = createNameSpace(useAsync);
          // checking the child version using chRoot client.
-@@ -427,8 +435,9 @@
+@@ -427,8 +435,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -861,7 +875,7 @@ Last-Update: 2022-06-16
          multi(zk, Arrays.asList(
                  Op.create("/multi0", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT),
                  Op.create("/multi1", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT),
-@@ -440,14 +449,16 @@
+@@ -440,14 +449,16 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -882,7 +896,7 @@ Last-Update: 2022-06-16
          multi(zk, Arrays.asList(
                  Op.create("/multi", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT),
                  Op.delete("/multi", 0)),
-@@ -458,8 +469,9 @@
+@@ -458,8 +469,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -894,7 +908,7 @@ Last-Update: 2022-06-16
  
          try {
              multi(zk, Arrays.asList(
-@@ -473,8 +485,9 @@
+@@ -473,8 +485,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -906,7 +920,7 @@ Last-Update: 2022-06-16
  
          multi(zk, Arrays.asList(
                  /* Create */
-@@ -491,8 +504,9 @@
+@@ -491,8 +504,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -918,7 +932,7 @@ Last-Update: 2022-06-16
  
          String[] names = {"/multi0", "/multi1", "/multi2"};
          List<Op> ops = new ArrayList<Op>();
-@@ -510,8 +524,9 @@
+@@ -510,8 +524,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -930,7 +944,7 @@ Last-Update: 2022-06-16
  
          assertNull(zk.exists("/multi", null));
  
-@@ -540,8 +555,9 @@
+@@ -540,8 +555,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -942,7 +956,7 @@ Last-Update: 2022-06-16
  
          /* Delete of a node folowed by an update of the (now) deleted node */
          try {
-@@ -560,8 +576,9 @@
+@@ -560,8 +576,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -954,7 +968,7 @@ Last-Update: 2022-06-16
          /* Delete of a node folowed by an update of the (now) deleted node */
          Iterable<Op> ops = Arrays.asList(
                  Op.create("/multi", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT),
-@@ -616,8 +633,9 @@
+@@ -616,8 +633,9 @@ public class MultiOperationTest extends
       * Exercise the equals methods of OpResult classes.
       */
      @ParameterizedTest
@@ -966,7 +980,7 @@ Last-Update: 2022-06-16
          opEquals(new CreateResult("/foo"), new CreateResult("/foo"), new CreateResult("nope"));
  
          opEquals(new CreateResult("/foo"), new CreateResult("/foo"), new CreateResult("/foo", new Stat(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)));
-@@ -646,8 +664,9 @@
+@@ -646,8 +664,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -978,7 +992,7 @@ Last-Update: 2022-06-16
          HasTriggeredWatcher watcher = new HasTriggeredWatcher();
          zk.getChildren("/", watcher);
          multi(zk, Arrays.asList(
-@@ -658,8 +677,9 @@
+@@ -658,8 +677,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -990,7 +1004,7 @@ Last-Update: 2022-06-16
          HasTriggeredWatcher watcher = new HasTriggeredWatcher();
          zk.getChildren("/", watcher);
          try {
-@@ -680,8 +700,9 @@
+@@ -680,8 +700,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1002,7 +1016,7 @@ Last-Update: 2022-06-16
          List<OpResult> results = commit(
                  zk.transaction()
                          .create("/t1", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
-@@ -739,8 +760,9 @@
+@@ -739,8 +760,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1014,7 +1028,7 @@ Last-Update: 2022-06-16
          List<String> topLevelNodes = new ArrayList<String>();
          Map<String, List<String>> childrenNodes = new HashMap<String, List<String>>();
          // Creating a database where '/fooX' nodes has 'barXY' named children.
-@@ -771,8 +793,9 @@
+@@ -771,8 +793,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1026,7 +1040,7 @@ Last-Update: 2022-06-16
          List<String> childrenNodes = new ArrayList<String>();
          // Creating a database where '/foo' node has 'barX' named children.
          String topLevelNode = "/foo";
-@@ -800,8 +823,9 @@
+@@ -800,8 +823,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1038,7 +1052,7 @@ Last-Update: 2022-06-16
          List<ACL> writeOnly = Collections.singletonList(new ACL(ZooDefs.Perms.WRITE, new Id("world", "anyone")));
          zk.create("/foo_auth", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          zk.create("/foo_auth/bar", null, Ids.READ_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -826,8 +850,9 @@
+@@ -826,8 +850,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1050,7 +1064,7 @@ Last-Update: 2022-06-16
          List<ACL> writeOnly = Collections.singletonList(new ACL(ZooDefs.Perms.WRITE, new Id("world", "anyone")));
          zk.create("/foo_auth", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          zk.create("/foo_auth/bar", null, Ids.READ_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -849,8 +874,9 @@
+@@ -849,8 +874,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1062,7 +1076,7 @@ Last-Update: 2022-06-16
          List<ACL> writeOnly = Collections.singletonList(new ACL(ZooDefs.Perms.WRITE, new Id("world", "anyone")));
          zk.create("/foo_auth", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          zk.create("/foo_auth/bar", null, Ids.READ_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -873,8 +899,9 @@
+@@ -873,8 +899,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1074,7 +1088,7 @@ Last-Update: 2022-06-16
          zk.create("/node1", "data1".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          zk.create("/node2", "data2".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
  
-@@ -885,8 +912,9 @@
+@@ -885,8 +912,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
@@ -1086,7 +1100,7 @@ Last-Update: 2022-06-16
          zk.create("/node1", "data1".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          zk.create("/node2", "data2".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
          zk.create("/node1/node1", "data11".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-@@ -933,8 +961,9 @@
+@@ -933,8 +961,9 @@ public class MultiOperationTest extends
      }
  
      @ParameterizedTest
diff --git a/debian/patches/22-test-without_TempDir.patch b/debian/patches/22-test-without_TempDir.patch
index e272033..d6ee94c 100644
--- a/debian/patches/22-test-without_TempDir.patch
+++ b/debian/patches/22-test-without_TempDir.patch
@@ -6,9 +6,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-21
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
-@@ -33,12 +33,11 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
+@@ -33,12 +33,11 @@ import org.apache.zookeeper.ZKTestCase;
  import org.apache.zookeeper.common.AtomicFileWritingIdiom.OutputStreamStatement;
  import org.apache.zookeeper.common.AtomicFileWritingIdiom.WriterStatement;
  import org.junit.jupiter.api.Test;
@@ -22,7 +24,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -56,7 +55,7 @@
+@@ -56,7 +55,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -31,7 +33,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -74,7 +73,7 @@
+@@ -74,7 +73,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -40,7 +42,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -100,7 +99,7 @@
+@@ -100,7 +99,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -49,7 +51,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -126,7 +125,7 @@
+@@ -126,7 +125,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -58,7 +60,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -152,7 +151,7 @@
+@@ -152,7 +151,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -67,7 +69,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -178,7 +177,7 @@
+@@ -178,7 +177,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -76,7 +78,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -204,7 +203,7 @@
+@@ -204,7 +203,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -85,7 +87,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          createFile(target, "before");
-@@ -232,7 +231,7 @@
+@@ -232,7 +231,7 @@ public class AtomicFileWritingIdiomTest
      // ************** target file does not exist
  
      @Test
@@ -94,7 +96,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          target.delete();
-@@ -249,7 +248,7 @@
+@@ -249,7 +248,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -103,7 +105,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          target.delete();
-@@ -267,7 +266,7 @@
+@@ -267,7 +266,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -112,7 +114,7 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          target.delete();
-@@ -293,7 +292,7 @@
+@@ -293,7 +292,7 @@ public class AtomicFileWritingIdiomTest
      }
  
      @Test
@@ -121,9 +123,11 @@ Last-Update: 2022-06-21
          File target = new File(tmpdir, "target.txt");
          final File tmp = new File(tmpdir, "target.txt.tmp");
          target.delete();
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -242,6 +242,11 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -238,6 +238,11 @@
                  <exclude>**/ThrottledOpObserverTest.java</exclude><!-- Needs ThrottledOpHelper -->
                  <exclude>**/ThrottledOpQuorumTest.java</exclude><!-- Needs ThrottledOpHelper -->
                  <exclude>**/ThrottledOpStandaloneTest.java</exclude><!-- Needs ThrottledOpHelper -->
diff --git a/debian/patches/23-mispell-in-bouncycastle.patch b/debian/patches/23-mispell-in-bouncycastle.patch
index b524ab7..c2bc3fa 100644
--- a/debian/patches/23-mispell-in-bouncycastle.patch
+++ b/debian/patches/23-mispell-in-bouncycastle.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-18
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509TestHelpers.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509TestHelpers.java
-@@ -270,7 +270,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509TestHelpers.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509TestHelpers.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509TestHelpers.java
+@@ -270,7 +270,7 @@ public class X509TestHelpers {
          JcaPEMWriter pemWriter = new JcaPEMWriter(stringWriter);
          OutputEncryptor encryptor = null;
          if (password != null && password.length() > 0) {
diff --git a/debian/patches/24-tests-classifier.patch b/debian/patches/24-tests-classifier.patch
index 4158e56..7a5c47e 100644
--- a/debian/patches/24-tests-classifier.patch
+++ b/debian/patches/24-tests-classifier.patch
@@ -6,8 +6,10 @@ Origin: https://sources.debian.org/src/libapfloat-java/1.10.1-1/debian/patches/m
 Forwarded: not-needed
 Last-Update: 2022-06-16
 
---- a/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
 @@ -51,7 +51,7 @@
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
@@ -17,8 +19,10 @@ Last-Update: 2022-06-16
      </dependency>
      <dependency>
        <groupId>org.apache.zookeeper</groupId>
---- a/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
 @@ -61,7 +61,7 @@
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
@@ -35,8 +39,10 @@ Last-Update: 2022-06-16
 -</project>
 \ No newline at end of file
 +</project>
---- a/zookeeper-it/pom.xml
-+++ b/zookeeper-it/pom.xml
+Index: zookeeper.git/zookeeper-it/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-it/pom.xml
++++ zookeeper.git/zookeeper-it/pom.xml
 @@ -50,7 +50,6 @@
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
@@ -45,8 +51,10 @@ Last-Update: 2022-06-16
        <version>${project.version}</version>
      </dependency>
      <dependency>
---- a/zookeeper-recipes/pom.xml
-+++ b/zookeeper-recipes/pom.xml
+Index: zookeeper.git/zookeeper-recipes/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/pom.xml
++++ zookeeper.git/zookeeper-recipes/pom.xml
 @@ -71,7 +71,7 @@
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
diff --git a/debian/patches/25-no-prometheus.patch b/debian/patches/25-no-prometheus.patch
index 9cf52eb..28867b5 100644
--- a/debian/patches/25-no-prometheus.patch
+++ b/debian/patches/25-no-prometheus.patch
@@ -4,8 +4,10 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-18
 
---- a/zookeeper-assembly/pom.xml
-+++ b/zookeeper-assembly/pom.xml
+Index: zookeeper.git/zookeeper-assembly/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-assembly/pom.xml
++++ zookeeper.git/zookeeper-assembly/pom.xml
 @@ -72,11 +72,6 @@
      </dependency>
      <dependency>
diff --git a/debian/patches/26-missing-contrib-rest-dependencies.patch b/debian/patches/26-missing-contrib-rest-dependencies.patch
index c14b916..74985d5 100644
--- a/debian/patches/26-missing-contrib-rest-dependencies.patch
+++ b/debian/patches/26-missing-contrib-rest-dependencies.patch
@@ -3,8 +3,10 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-18
 
---- a/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
 @@ -90,15 +90,35 @@
      </dependency>
      <dependency>
diff --git a/debian/patches/27-exclude-classes-due-to-missing-jmh.patch b/debian/patches/27-exclude-classes-due-to-missing-jmh.patch
index 2b13e56..b04bb66 100644
--- a/debian/patches/27-exclude-classes-due-to-missing-jmh.patch
+++ b/debian/patches/27-exclude-classes-due-to-missing-jmh.patch
@@ -3,8 +3,10 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-18
 
---- a/zookeeper-it/pom.xml
-+++ b/zookeeper-it/pom.xml
+Index: zookeeper.git/zookeeper-it/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-it/pom.xml
++++ zookeeper.git/zookeeper-it/pom.xml
 @@ -73,6 +73,16 @@
        <plugins>
          <plugin>
diff --git a/debian/patches/28-no-openssl-for-python-build.patch b/debian/patches/28-no-openssl-for-python-build.patch
index 4eb2a7c..1cdf5e1 100644
--- a/debian/patches/28-no-openssl-for-python-build.patch
+++ b/debian/patches/28-no-openssl-for-python-build.patch
@@ -6,9 +6,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-18
 
---- a/zookeeper-contrib/zookeeper-contrib-zkpython/src/python/setup.py
-+++ b/zookeeper-contrib/zookeeper-contrib-zkpython/src/python/setup.py
-@@ -21,11 +21,6 @@
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-zkpython/src/python/setup.py
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-zkpython/src/python/setup.py
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-zkpython/src/python/setup.py
+@@ -21,11 +21,6 @@ zookeeper_basedir = "../../"
  
  zookeeper_macros = [("THREADED", None)]
  
diff --git a/debian/patches/29-no-javaagent.patch b/debian/patches/29-no-javaagent.patch
index ef27542..5b56b92 100644
--- a/debian/patches/29-no-javaagent.patch
+++ b/debian/patches/29-no-javaagent.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-19
 
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -306,7 +306,7 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -302,7 +302,7 @@
            </includes>
            <forkCount>${surefire-forkcount}</forkCount>
            <reuseForks>false</reuseForks>
diff --git a/debian/patches/30-skip-tests-network.patch b/debian/patches/30-skip-tests-network.patch
index 8e51caa..2153ab4 100644
--- a/debian/patches/30-skip-tests-network.patch
+++ b/debian/patches/30-skip-tests-network.patch
@@ -3,9 +3,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-25
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java
-@@ -38,6 +38,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java
+@@ -38,6 +38,7 @@ import org.apache.zookeeper.server.Serve
  import org.apache.zookeeper.server.SyncRequestProcessor;
  import org.apache.zookeeper.server.ZooKeeperServer;
  import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
@@ -13,7 +15,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -145,6 +146,7 @@
+@@ -145,6 +146,7 @@ public class EmptiedSnapshotRecoveryTest
          runTest(false, true);
      }
  
@@ -21,9 +23,11 @@ Last-Update: 2022-06-25
      @Test
      public void testRestoreWithTrustedEmptySnapFilesWhenFollowing() throws Exception {
          QuorumUtil qu = new QuorumUtil(1);
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
-@@ -275,6 +275,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
+@@ -275,6 +275,7 @@ public class ObserverMasterTest extends
          shutdown();
      }
  
@@ -31,9 +35,11 @@ Last-Update: 2022-06-25
      @ParameterizedTest
      @ValueSource(ints = {1, 0})
      public void testAdminCommands(int arg) throws IOException, MBeanException, InstanceNotFoundException, ReflectionException, InterruptedException, MalformedObjectNameException, AttributeNotFoundException, InvalidAttributeValueException, KeeperException {
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java
-@@ -60,6 +60,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java
+@@ -60,6 +60,7 @@ import org.apache.zookeeper.server.quoru
  import org.apache.zookeeper.server.quorum.flexible.QuorumVerifier;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
@@ -41,7 +47,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -280,6 +281,7 @@
+@@ -280,6 +281,7 @@ public class ReconfigTest extends ZKTest
          }
      }
  
@@ -49,7 +55,7 @@ Last-Update: 2022-06-25
      @Test
      public void testRemoveAddOne() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -358,6 +360,7 @@
+@@ -358,6 +360,7 @@ public class ReconfigTest extends ZKTest
       * 3. tests that a server that's not up during reconfig learns the new config when it comes up
       * @throws Exception
       */
@@ -57,7 +63,7 @@ Last-Update: 2022-06-25
      @Test
      public void testRemoveAddTwo() throws Exception {
          qu = new QuorumUtil(2); // create 5 servers
-@@ -463,6 +466,7 @@
+@@ -463,6 +466,7 @@ public class ReconfigTest extends ZKTest
          testServerHasConfig(zkArr[leavingIndex2], joiningServers, null);
      }
  
@@ -65,7 +71,7 @@ Last-Update: 2022-06-25
      @Test
      public void testBulkReconfig() throws Exception {
          qu = new QuorumUtil(3); // create 7 servers
-@@ -499,6 +503,7 @@
+@@ -499,6 +503,7 @@ public class ReconfigTest extends ZKTest
          testNormalOperation(zkArr[1], zkArr[2]);
      }
  
@@ -73,7 +79,7 @@ Last-Update: 2022-06-25
      @Test
      public void testRemoveOneAsynchronous() throws Exception {
          qu = new QuorumUtil(2);
-@@ -537,6 +542,7 @@
+@@ -537,6 +542,7 @@ public class ReconfigTest extends ZKTest
          }
      }
  
@@ -81,7 +87,7 @@ Last-Update: 2022-06-25
      @Test
      public void testRoleChange() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -614,6 +620,7 @@
+@@ -614,6 +620,7 @@ public class ReconfigTest extends ZKTest
          }
      }
  
@@ -89,7 +95,7 @@ Last-Update: 2022-06-25
      @Test
      public void testPortChange() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -745,10 +752,12 @@
+@@ -745,10 +752,12 @@ public class ReconfigTest extends ZKTest
          testServerHasConfig(zkArr[follower2], joiningServers, null);
      }
  
@@ -102,7 +108,7 @@ Last-Update: 2022-06-25
      @Test
      public void testPortChangeToBlockedPortLeader() throws Exception {
          testPortChangeToBlockedPort(true);
-@@ -843,6 +852,7 @@
+@@ -843,6 +852,7 @@ public class ReconfigTest extends ZKTest
          assertEquals(qs.clientAddr.getPort(), ports[2]);
      }
  
@@ -110,7 +116,7 @@ Last-Update: 2022-06-25
      @Test
      public void testQuorumSystemChange() throws Exception {
          qu = new QuorumUtil(3); // create 7 servers
-@@ -923,6 +933,7 @@
+@@ -923,6 +933,7 @@ public class ReconfigTest extends ZKTest
          }
      }
  
@@ -118,7 +124,7 @@ Last-Update: 2022-06-25
      @Test
      public void testInitialConfigHasPositiveVersion() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -942,6 +953,7 @@
+@@ -942,6 +953,7 @@ public class ReconfigTest extends ZKTest
       * Tests verifies the jmx attributes of local and remote peer bean - remove
       * one quorum peer and again adding it back
       */
@@ -126,7 +132,7 @@ Last-Update: 2022-06-25
      @Test
      public void testJMXBeanAfterRemoveAddOne() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -1025,6 +1037,7 @@
+@@ -1025,6 +1037,7 @@ public class ReconfigTest extends ZKTest
       * Tests verifies the jmx attributes of local and remote peer bean - change
       * participant to observer role
       */
@@ -134,7 +140,7 @@ Last-Update: 2022-06-25
      @Test
      public void testJMXBeanAfterRoleChange() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -1103,6 +1116,7 @@
+@@ -1103,6 +1116,7 @@ public class ReconfigTest extends ZKTest
      }
  
  
@@ -142,9 +148,11 @@ Last-Update: 2022-06-25
      @Test
      public void testReconfigEnablemntWithRollingRestart() throws Exception {
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnFactoryTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnFactoryTest.java
-@@ -36,6 +36,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnFactoryTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnFactoryTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/NettyServerCnxnFactoryTest.java
+@@ -36,6 +36,7 @@ import org.apache.zookeeper.server.metri
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.SSLAuthTest;
  import org.hamcrest.Matchers;
@@ -152,7 +160,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -113,6 +114,7 @@
+@@ -113,6 +114,7 @@ public class NettyServerCnxnFactoryTest
       * as there is a maximum number of parallel SSL handshake the server is willing to do
       * for security reasons.
       */
@@ -160,9 +168,11 @@ Last-Update: 2022-06-25
      @Test
      public void testOutstandingHandshakeLimit() throws Exception {
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
-@@ -41,6 +41,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
+@@ -41,6 +41,7 @@ import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.metrics.MetricsUtils;
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.QuorumUtil;
@@ -170,7 +180,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -49,6 +50,7 @@
+@@ -49,6 +50,7 @@ public class ConnectionMetricsTest exten
  
      protected static final Logger LOG = LoggerFactory.getLogger(ConnectionMetricsTest.class);
  
@@ -178,9 +188,11 @@ Last-Update: 2022-06-25
      @Test
      public void testRevalidateCount() throws Exception {
          ServerMetrics.getMetrics().resetAll();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorMetricsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorMetricsTest.java
-@@ -53,6 +53,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorMetricsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorMetricsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorMetricsTest.java
+@@ -53,6 +53,7 @@ import org.apache.zookeeper.test.ClientB
  import org.apache.zookeeper.test.QuorumUtil;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
@@ -188,7 +200,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -179,6 +180,7 @@
+@@ -179,6 +180,7 @@ public class PrepRequestProcessorMetrics
  
      }
  
@@ -196,9 +208,11 @@ Last-Update: 2022-06-25
      @Test
      public void testOutstandingChangesRemoved() throws Exception {
          // this metric is currently recorded in FinalRequestProcessor but it is tightly related to the Prep metrics
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigFailureCasesTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigFailureCasesTest.java
-@@ -36,6 +36,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigFailureCasesTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigFailureCasesTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigFailureCasesTest.java
+@@ -36,6 +36,7 @@ import org.apache.zookeeper.test.QuorumU
  import org.apache.zookeeper.test.ReconfigTest;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
@@ -206,7 +220,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  
  public class ReconfigFailureCasesTest extends QuorumPeerTestBase {
-@@ -58,6 +59,7 @@
+@@ -58,6 +59,7 @@ public class ReconfigFailureCasesTest ex
      /*
       * Tests that an incremental reconfig fails if the current config is hiearchical.
       */
@@ -214,7 +228,7 @@ Last-Update: 2022-06-25
      @Test
      public void testIncrementalReconfigInvokedOnHiearchicalQS() throws Exception {
          qu = new QuorumUtil(2); // create 5 servers
-@@ -109,6 +111,7 @@
+@@ -109,6 +111,7 @@ public class ReconfigFailureCasesTest ex
       * StandaloneEnabled = false its legal to remove all but one remaining
       * server.
       */
@@ -222,7 +236,7 @@ Last-Update: 2022-06-25
      @Test
      public void testTooFewRemainingPariticipants() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
-@@ -136,6 +139,7 @@
+@@ -136,6 +139,7 @@ public class ReconfigFailureCasesTest ex
       * Tests that a conditional reconfig fails if the specified version doesn't correspond
       * to the version of the current config.
       */
@@ -230,9 +244,11 @@ Last-Update: 2022-06-25
      @Test
      public void testReconfigVersionConditionFails() throws Exception {
          qu = new QuorumUtil(1); // create 3 servers
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -304,6 +304,120 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -300,6 +300,120 @@
            <includes>
              <include>**/*Test.java</include>
            </includes>
@@ -353,8 +369,10 @@ Last-Update: 2022-06-25
            <forkCount>${surefire-forkcount}</forkCount>
            <reuseForks>false</reuseForks>
            <argLine>-Xmx512m -Dtest.junit.threads=${surefire-forkcount} -Dzookeeper.junit.threadid=${surefire.forkNumber}</argLine>
---- a/zookeeper-recipes/zookeeper-recipes-election/pom.xml
-+++ b/zookeeper-recipes/zookeeper-recipes-election/pom.xml
+Index: zookeeper.git/zookeeper-recipes/zookeeper-recipes-election/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/zookeeper-recipes-election/pom.xml
++++ zookeeper.git/zookeeper-recipes/zookeeper-recipes-election/pom.xml
 @@ -47,9 +47,13 @@
            <systemPropertyVariables>
              <build.test.dir>${project.build.directory}/surefire</build.test.dir>
@@ -371,9 +389,11 @@ Last-Update: 2022-06-25
 -</project>
 \ No newline at end of file
 +</project>
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
-@@ -63,6 +63,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
+@@ -63,6 +63,7 @@ import org.apache.zookeeper.server.persi
  import org.apache.zookeeper.server.quorum.Leader.Proposal;
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.LoggerTestTool;
@@ -381,7 +401,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  
  /**
-@@ -706,6 +707,7 @@
+@@ -706,6 +707,7 @@ public class QuorumPeerMainTest extends
          assertEquals(maxSessionTimeOut, quorumPeer.getMaxSessionTimeout(), "maximumSessionTimeOut is wrong");
      }
  
@@ -389,7 +409,7 @@ Last-Update: 2022-06-25
      @Test
      public void testFailedTxnAsPartOfQuorumLoss() throws Exception {
          final int LEADER_TIMEOUT_MS = 10_000;
-@@ -1012,6 +1014,7 @@
+@@ -1012,6 +1014,7 @@ public class QuorumPeerMainTest extends
       * This test case is going to cover and simulate this scenario
       * and make sure there is no data inconsistency issue after fix.
       */
@@ -397,8 +417,10 @@ Last-Update: 2022-06-25
      @Test
      public void testInconsistentDueToNewLeaderOrder() throws Exception {
  
---- a/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
-+++ b/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
+Index: zookeeper.git/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
++++ zookeeper.git/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
 @@ -47,6 +47,10 @@
            <systemPropertyVariables>
              <build.test.dir>${project.build.directory}/surefire</build.test.dir>
@@ -410,8 +432,10 @@ Last-Update: 2022-06-25
          </configuration>
        </plugin>
      </plugins>
---- a/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
-+++ b/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
+Index: zookeeper.git/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
++++ zookeeper.git/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
 @@ -52,9 +52,13 @@
            <systemPropertyVariables>
              <build.test.dir>${project.build.directory}/surefire</build.test.dir>
@@ -428,9 +452,11 @@ Last-Update: 2022-06-25
 -</project>
 \ No newline at end of file
 +</project>
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
-@@ -36,6 +36,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigRollingRestartCompatibilityTest.java
+@@ -36,6 +36,7 @@ import org.apache.zookeeper.PortAssignme
  import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.ReconfigTest;
@@ -438,7 +464,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  
  /**
-@@ -210,6 +211,7 @@
+@@ -210,6 +211,7 @@ public class ReconfigRollingRestartCompa
          }
      }
  
@@ -446,9 +472,11 @@ Last-Update: 2022-06-25
      @Test
      public void testRollingRestartWithExtendedMembershipConfig() throws Exception {
          // in this test we are performing rolling restart with extended quorum config, see ZOOKEEPER-3829
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java
-@@ -40,6 +40,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java
+@@ -40,6 +40,7 @@ import org.apache.zookeeper.common.Strin
  import org.apache.zookeeper.test.ClientBase;
  import org.apache.zookeeper.test.ReconfigTest;
  import org.junit.jupiter.api.BeforeEach;
@@ -456,7 +484,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  
  public class ReconfigBackupTest extends QuorumPeerTestBase {
-@@ -229,6 +230,7 @@
+@@ -229,6 +230,7 @@ public class ReconfigBackupTest extends
       * four others have newer version of 5 servers. Finally, the lag-off one
       * should have server config of 5 servers.
       */
@@ -464,9 +492,11 @@ Last-Update: 2022-06-25
      @Test
      public void testVersionOfDynamicFilename() throws Exception {
          final int SERVER_COUNT = 5;
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
-@@ -37,6 +37,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
+@@ -37,6 +37,7 @@ import java.util.stream.Collectors;
  import java.util.stream.IntStream;
  import org.apache.commons.collections4.CollectionUtils;
  import org.apache.zookeeper.PortAssignment;
@@ -474,7 +504,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  
  public class MultipleAddressesTest {
-@@ -135,6 +136,7 @@
+@@ -135,6 +136,7 @@ public class MultipleAddressesTest {
          assertEquals(unreachableAddress, actualReturnedAddress);
      }
  
@@ -482,9 +512,11 @@ Last-Update: 2022-06-25
      @Test
      public void testRecreateSocketAddresses() throws UnknownHostException {
          List<InetSocketAddress> searchedAddresses = Arrays.stream(InetAddress.getAllByName("google.com"))
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
-@@ -32,6 +32,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/FourLetterWordsTest.java
+@@ -32,6 +32,7 @@ import org.apache.zookeeper.TestableZooK
  import org.apache.zookeeper.ZooKeeper;
  import org.apache.zookeeper.common.IOUtils;
  import org.apache.zookeeper.common.X509Exception.SSLContextException;
@@ -492,7 +524,7 @@ Last-Update: 2022-06-25
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -41,6 +42,7 @@
+@@ -41,6 +42,7 @@ public class FourLetterWordsTest extends
      protected static final Logger LOG = LoggerFactory.getLogger(FourLetterWordsTest.class);
  
      /** Test the various four letter words */
diff --git a/debian/patches/31-enlarge-time-limit-in-test.patch b/debian/patches/31-enlarge-time-limit-in-test.patch
index 3b100c2..5e2b4a9 100644
--- a/debian/patches/31-enlarge-time-limit-in-test.patch
+++ b/debian/patches/31-enlarge-time-limit-in-test.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-06-29
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java
-@@ -440,12 +440,12 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java
+@@ -440,12 +440,12 @@ public class RequestPathMetricsCollector
                  () -> requestPathMetricsCollector.registerRequest(getChildren, "/path1/path2/path" + rand.nextInt(10)));
          }
          executor.shutdown();
@@ -23,9 +25,11 @@ Last-Update: 2022-06-29
      }
  
  }
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
-@@ -149,7 +149,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketModeDetectionTest.java
+@@ -149,7 +149,7 @@ public class UnifiedServerSocketModeDete
          forceClose(serverSideSocket);
          forceClose(clientSocket);
          workerPool.shutdown();
@@ -34,9 +38,11 @@ Last-Update: 2022-06-29
          x509Util.close();
      }
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketTest.java
-@@ -190,7 +190,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/UnifiedServerSocketTest.java
+@@ -190,7 +190,7 @@ public class UnifiedServerSocketTest ext
  
          public void shutdown(long millis) throws InterruptedException {
              forceClose(serverSocket); // this should break the run() loop
@@ -45,9 +51,11 @@ Last-Update: 2022-06-29
              this.join(millis);
          }
  
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientSSLTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientSSLTest.java
-@@ -156,7 +156,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientSSLTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientSSLTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientSSLTest.java
+@@ -156,7 +156,7 @@ public class ClientSSLTest extends Quoru
  
          // Servers have been set up. Now go test if secure connection is successful.
          for (int i = 0; i < SERVER_COUNT; i++) {
diff --git a/debian/patches/32-scope-of-logback-dependency.patch b/debian/patches/32-scope-of-logback-dependency.patch
index 1785cf9..7ec1057 100644
--- a/debian/patches/32-scope-of-logback-dependency.patch
+++ b/debian/patches/32-scope-of-logback-dependency.patch
@@ -4,8 +4,10 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-26
 
---- a/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
 @@ -90,10 +90,6 @@
        <groupId>org.xerial.snappy</groupId>
        <artifactId>snappy-java</artifactId>
@@ -17,8 +19,10 @@ Last-Update: 2022-06-26
    </dependencies>
  
    <build>
---- a/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
 @@ -53,16 +53,6 @@
        <artifactId>slf4j-api</artifactId>
      </dependency>
@@ -43,8 +47,10 @@ Last-Update: 2022-06-26
 -</project>
 \ No newline at end of file
 +</project>
---- a/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
 @@ -69,16 +69,6 @@
        <artifactId>slf4j-api</artifactId>
      </dependency>
@@ -62,8 +68,10 @@ Last-Update: 2022-06-26
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>${asm.version}</version>
---- a/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
-+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
+Index: zookeeper.git/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
++++ zookeeper.git/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
 @@ -90,16 +90,6 @@
        <artifactId>slf4j-api</artifactId>
      </dependency>
@@ -81,16 +89,18 @@ Last-Update: 2022-06-26
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <scope>test</scope>
-@@ -115,4 +105,4 @@
-       <version>${rat.version}</version>
+@@ -121,4 +111,4 @@
+       <scope>test</scope>
      </dependency>
    </dependencies>
 -</project>
 \ No newline at end of file
 +</project>
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -81,10 +81,12 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -77,10 +77,12 @@
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
diff --git a/debian/patches/33-spelling.patch b/debian/patches/33-spelling.patch
index a697093..3639842 100644
--- a/debian/patches/33-spelling.patch
+++ b/debian/patches/33-spelling.patch
@@ -3,9 +3,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-06-26
 
---- a/zookeeper-client/zookeeper-client-c/include/zookeeper.h
-+++ b/zookeeper-client/zookeeper-client-c/include/zookeeper.h
-@@ -108,7 +108,7 @@
+Index: zookeeper.git/zookeeper-client/zookeeper-client-c/include/zookeeper.h
+===================================================================
+--- zookeeper.git.orig/zookeeper-client/zookeeper-client-c/include/zookeeper.h
++++ zookeeper.git/zookeeper-client/zookeeper-client-c/include/zookeeper.h
+@@ -108,7 +108,7 @@ enum ZOO_ERRORS {
    ZBADARGUMENTS = -8, /*!< Invalid arguments */
    ZINVALIDSTATE = -9, /*!< Invliad zhandle state */
    ZNEWCONFIGNOQUORUM = -13, /*!< No quorum of new config is connected and
@@ -14,9 +16,11 @@ Last-Update: 2022-06-26
                                   config - try invoking reconfiguration after new
                                   servers are connected and synced */
    ZRECONFIGINPROGRESS = -14, /*!< Reconfiguration requested while another
---- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
-+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
-@@ -5013,7 +5013,7 @@
+Index: zookeeper.git/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+===================================================================
+--- zookeeper.git.orig/zookeeper-client/zookeeper-client-c/src/zookeeper.c
++++ zookeeper.git/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+@@ -5008,7 +5008,7 @@ const char* zerror(int c)
      case ZINVALIDSTATE:
        return "invalid zhandle state";
      case ZNEWCONFIGNOQUORUM:
@@ -25,9 +29,11 @@ Last-Update: 2022-06-26
      case ZRECONFIGINPROGRESS:
        return "Another reconfiguration is in progress -- concurrent reconfigs not supported (yet)";
      case ZAPIERROR:
---- a/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java
-+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java
-@@ -356,7 +356,7 @@
+Index: zookeeper.git/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java
++++ zookeeper.git/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java
+@@ -356,7 +356,7 @@ public abstract class KeeperException ex
          OPERATIONTIMEOUT(OperationTimeout),
          /** Invalid arguments */
          BADARGUMENTS(BadArguments),
@@ -36,9 +42,11 @@ Last-Update: 2022-06-26
           *  invoking reconfiguration after new servers are connected and synced */
          NEWCONFIGNOQUORUM(NewConfigNoQuorum),
          /** Another reconfiguration is in progress -- concurrent reconfigs not supported (yet) */
---- a/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java
-+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java
-@@ -52,7 +52,7 @@
+Index: zookeeper.git/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java
++++ zookeeper.git/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java
+@@ -52,7 +52,7 @@ public class CliWrapperException extends
                  return "Another reconfiguration is in progress -- concurrent " + "reconfigs not supported (yet)";
              } else if (keeperException instanceof KeeperException.NewConfigNoQuorum) {
                  return "No quorum of new config is connected and "
@@ -47,9 +55,11 @@ Last-Update: 2022-06-26
                         + "new servers are connected and synced";
              } else if (keeperException instanceof KeeperException.QuotaExceededException) {
                  return "Quota has exceeded : " + keeperException.getPath();
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java
-@@ -71,7 +71,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java
+@@ -71,7 +71,7 @@ public class LocalSessionRequestTest ext
      }
  
      /**
diff --git a/debian/patches/34-no-rpath-with-libtool.patch b/debian/patches/34-no-rpath-with-libtool.patch
index 424adbd..9fdb666 100644
--- a/debian/patches/34-no-rpath-with-libtool.patch
+++ b/debian/patches/34-no-rpath-with-libtool.patch
@@ -5,9 +5,11 @@ Origin: other, https://wiki.debian.org/RpathIssue
 Forwarded: not-needed
 Last-Update: 2022-06-27
 
---- a/zookeeper-client/zookeeper-client-c/configure.ac
-+++ b/zookeeper-client/zookeeper-client-c/configure.ac
-@@ -273,3 +273,11 @@
+Index: zookeeper.git/zookeeper-client/zookeeper-client-c/configure.ac
+===================================================================
+--- zookeeper.git.orig/zookeeper-client/zookeeper-client-c/configure.ac
++++ zookeeper.git/zookeeper-client/zookeeper-client-c/configure.ac
+@@ -273,3 +273,11 @@ AM_CONDITIONAL([SOLARIS],[
      ;;
    esac ])
  AC_OUTPUT
diff --git a/debian/patches/35-flaky-test.patch b/debian/patches/35-flaky-test.patch
index 04498db..7aabb67 100644
--- a/debian/patches/35-flaky-test.patch
+++ b/debian/patches/35-flaky-test.patch
@@ -3,9 +3,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: not-needed
 Last-Update: 2022-07-23
 
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
-@@ -37,6 +37,7 @@
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
+@@ -37,6 +37,7 @@ import org.apache.zookeeper.metrics.Metr
  import org.apache.zookeeper.test.ClientBase;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
@@ -13,7 +15,7 @@ Last-Update: 2022-07-23
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
-@@ -255,6 +256,7 @@
+@@ -301,6 +302,7 @@ public class RequestThrottlerTest extend
          assertEquals(1, (long) metrics.get("stale_requests_dropped"));
      }
  
diff --git a/debian/patches/36-JUnitPlatform-deprecation.patch b/debian/patches/36-JUnitPlatform-deprecation.patch
index 4e787da..2ca493d 100644
--- a/debian/patches/36-JUnitPlatform-deprecation.patch
+++ b/debian/patches/36-JUnitPlatform-deprecation.patch
@@ -4,9 +4,11 @@ Author: Pierre Gruet <pgt@debian.org>
 Forwarded: no
 Last-Update: 2022-10-31
 
---- a/pom.xml
-+++ b/pom.xml
-@@ -588,6 +588,11 @@
+Index: zookeeper.git/pom.xml
+===================================================================
+--- zookeeper.git.orig/pom.xml
++++ zookeeper.git/pom.xml
+@@ -587,6 +587,11 @@
          <version>${junit.version}</version>
        </dependency>
        <dependency>
@@ -18,9 +20,11 @@ Last-Update: 2022-10-31
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-params</artifactId>
          <version>${junit.version}</version>
---- a/zookeeper-server/pom.xml
-+++ b/zookeeper-server/pom.xml
-@@ -164,6 +164,11 @@
+Index: zookeeper.git/zookeeper-server/pom.xml
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/pom.xml
++++ zookeeper.git/zookeeper-server/pom.xml
+@@ -160,6 +160,11 @@
        <scope>test</scope>
      </dependency>
      <dependency>
@@ -32,8 +36,10 @@ Last-Update: 2022-10-31
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <scope>test</scope>
---- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/NettyNettySuiteTest.java
-+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/NettyNettySuiteTest.java
+Index: zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/NettyNettySuiteTest.java
+===================================================================
+--- zookeeper.git.orig/zookeeper-server/src/test/java/org/apache/zookeeper/test/NettyNettySuiteTest.java
++++ zookeeper.git/zookeeper-server/src/test/java/org/apache/zookeeper/test/NettyNettySuiteTest.java
 @@ -18,14 +18,13 @@
  
  package org.apache.zookeeper.test;
diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile
index bd2977f..a1b3356 100644
--- a/dev/docker/Dockerfile
+++ b/dev/docker/Dockerfile
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-FROM maven:3.6.3-jdk-8
+FROM maven:3.8.4-jdk-8
 
 RUN apt-get update
 RUN apt-get install -y \
diff --git a/owaspSuppressions.xml b/owaspSuppressions.xml
index 1325af9..7020321 100644
--- a/owaspSuppressions.xml
+++ b/owaspSuppressions.xml
@@ -22,6 +22,10 @@
       <!-- ZOOKEEPER-3217 -->
       <cve>CVE-2018-8088</cve>
    </suppress>
+   <suppress>
+      <!-- ZOOKEEPER-4660 -->
+      <cve>CVE-2021-37533</cve>
+   </suppress>
    <suppress>
       <!-- ZOOKEEPER-3262 -->
       <cve>CVE-2018-8012</cve>
@@ -34,18 +38,6 @@
       <!-- https://github.com/jeremylong/DependencyCheck/issues/1653
            False positive on Netty 4.x-->
       <cve>CVE-2018-12056</cve>
-      <!-- other false positives related to Netty TCNative 4.x -->
-      <cve>CVE-2021-43797</cve>
-      <cve>CVE-2019-16869</cve>
-      <cve>CVE-2015-2156</cve>
-      <cve>CVE-2021-37136</cve>
-      <cve>CVE-2014-3488</cve>
-      <cve>CVE-2021-37137</cve>
-      <cve>CVE-2019-20445</cve>
-      <cve>CVE-2019-20444</cve>
-      <cve>CVE-2021-21295</cve>
-      <cve>CVE-2021-21409</cve>
-      <cve>CVE-2021-21290</cve>
    </suppress>
    <suppress>
       <!-- Seems like false positive - we are not using Prometheus
diff --git a/pom.xml b/pom.xml
old mode 100755
new mode 100644
index c8c8401..6ca0179
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
   <artifactId>parent</artifactId>
   <packaging>pom</packaging>
   <!-- to change version: mvn -B release:update-versions -DdevelopmentVersion=3.6.0-SNAPSHOT -->
-  <version>3.8.0</version>
+  <version>3.8.1</version>
   <name>Apache ZooKeeper</name>
   <description>
     ZooKeeper is a centralized service for maintaining configuration information, naming,
@@ -71,7 +71,7 @@
     <connection>scm:git:https://gitbox.apache.org/repos/asf/zookeeper.git</connection>
     <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/zookeeper.git</developerConnection>
     <url>https://gitbox.apache.org/repos/asf/zookeeper.git</url>
-    <tag>release-3.8.0-1</tag>
+    <tag>release-3.8.1-1</tag>
   </scm>
   <issueManagement>
     <system>JIRA</system>
@@ -466,11 +466,10 @@
     <junit-platform.version>1.6.2</junit-platform.version>
     <mockito.version>3.6.28</mockito.version>
     <hamcrest.version>2.2</hamcrest.version>
-    <commons-cli.version>1.4</commons-cli.version>
-    <netty.version>4.1.73.Final</netty.version>
-    <netty.tcnative.version>2.0.48.Final</netty.tcnative.version>
-    <jetty.version>9.4.43.v20210629</jetty.version>
-    <jackson.version>2.13.1</jackson.version>
+    <commons-cli.version>1.5.0</commons-cli.version>
+    <netty.version>4.1.86.Final</netty.version>
+    <jetty.version>9.4.49.v20220914</jetty.version>
+    <jackson.version>2.13.4.2</jackson.version>
     <jline.version>2.14.6</jline.version>
     <snappy.version>1.1.7.7</snappy.version>
     <kerby.version>2.0.0</kerby.version>
@@ -613,23 +612,12 @@
         <groupId>io.netty</groupId>
         <artifactId>netty-handler</artifactId>
         <version>${netty.version}</version>
-        <exclusions>
-          <exclusion>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-tcnative-classes</artifactId>
-          </exclusion>
-        </exclusions>
       </dependency>
       <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-transport-native-epoll</artifactId>
         <version>${netty.version}</version>
       </dependency>
-      <dependency>
-        <groupId>io.netty</groupId>
-        <artifactId>netty-tcnative</artifactId>
-        <version>${netty.tcnative.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-server</artifactId>
@@ -798,7 +786,7 @@
         <plugin>
           <groupId>org.owasp</groupId>
           <artifactId>dependency-check-maven</artifactId>
-          <version>6.5.3</version>
+          <version>7.1.0</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -837,6 +825,11 @@
           <artifactId>maven-bundle-plugin</artifactId>
           <version>5.1.1</version>
         </plugin>
+        <plugin>
+          <groupId>org.cyclonedx</groupId>
+          <artifactId>cyclonedx-maven-plugin</artifactId>
+          <version>2.7.3</version>
+       </plugin>
       </plugins>
     </pluginManagement>
 
@@ -1130,6 +1123,18 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.cyclonedx</groupId>
+        <artifactId>cyclonedx-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>makeBom</goal>
+            </goals>
+            <phase>package</phase>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <resources>
       <resource>
diff --git a/zookeeper-assembly/pom.xml b/zookeeper-assembly/pom.xml
index 8320dad..ee44818 100755
--- a/zookeeper-assembly/pom.xml
+++ b/zookeeper-assembly/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-assembly</artifactId>
diff --git a/zookeeper-client/pom.xml b/zookeeper-client/pom.xml
index 5df60fe..bb368a8 100755
--- a/zookeeper-client/pom.xml
+++ b/zookeeper-client/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-client</artifactId>
diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
index ccfd757..5d0175e 100644
--- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt
+++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
@@ -16,7 +16,7 @@
 
 cmake_minimum_required(VERSION 3.5)
 
-project(zookeeper VERSION 3.8.0)
+project(zookeeper VERSION 3.8.1)
 set(email user@zookeeper.apache.org)
 set(description "zookeeper C client")
 
diff --git a/zookeeper-client/zookeeper-client-c/configure.ac b/zookeeper-client/zookeeper-client-c/configure.ac
index fe10af9..a41aa62 100644
--- a/zookeeper-client/zookeeper-client-c/configure.ac
+++ b/zookeeper-client/zookeeper-client-c/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ(2.59)
 
-AC_INIT([zookeeper C client],3.8.0,[user@zookeeper.apache.org],[zookeeper])
+AC_INIT([zookeeper C client],3.8.1,[user@zookeeper.apache.org],[zookeeper])
 AC_CONFIG_SRCDIR([src/zookeeper.c])
 
 # Save initial CFLAGS and CXXFLAGS values before AC_PROG_CC and AC_PROG_CXX
diff --git a/zookeeper-client/zookeeper-client-c/pom.xml b/zookeeper-client/zookeeper-client-c/pom.xml
index 2c67da7..ec499c3 100755
--- a/zookeeper-client/zookeeper-client-c/pom.xml
+++ b/zookeeper-client/zookeeper-client-c/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-client</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-client-c</artifactId>
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index 0dac4c3..74b0471 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -2751,11 +2751,6 @@ static int init_ssl_for_socket(zsock_t *fd, zhandle_t *zh, int fail_on_error) {
         OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
         method = TLS_client_method();
 #endif
-        if (FIPS_mode() == 0) {
-            LOG_INFO(LOGCALLBACK(zh), "FIPS mode is OFF ");
-        } else {
-            LOG_INFO(LOGCALLBACK(zh), "FIPS mode is ON ");
-        }
         fd->ssl_ctx = SSL_CTX_new(method);
         ctx = &fd->ssl_ctx;
 
diff --git a/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc b/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc
index ddb9533..a36af84 100644
--- a/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc
+++ b/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc
@@ -130,7 +130,7 @@ public:
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         
         int fd=0;
         int interest=0;
@@ -173,7 +173,7 @@ public:
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         
         int fd=0;
         int interest=0;
@@ -216,7 +216,7 @@ public:
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         
         int fd=0;
         int interest=0;
@@ -267,7 +267,7 @@ public:
         zh=zookeeper_init("localhost:1234",watcher,TIMEOUT*1000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         
         int fd=0;
         int interest=0;
@@ -344,7 +344,7 @@ public:
         zh=zookeeper_init("localhost:1234",watcher,TIMEOUT*1000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
 
         int fd=0;
         int interest=0;
@@ -379,7 +379,7 @@ public:
         zh=zookeeper_init("localhost:1234",watcher,TIMEOUT*1000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         
         int fd=0;
         int interest=0;
@@ -426,7 +426,7 @@ public:
         zh=zookeeper_init("localhost:1234",watcher,TIMEOUT*1000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
         // simulate connected state
-        forceConnected(zh);
+        forceConnected(zh, &now.tv);
         
         // queue up a request; keep it pending (as if the server is busy or has died)
         AsyncGetOperationCompletion res1;
@@ -481,7 +481,7 @@ public:
 
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         zhandle_t* savezh=zh;
 
         // issue a request
@@ -520,7 +520,7 @@ public:
 
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         zhandle_t* savezh=zh;
 
         // will handle completion on request #1 and issue request #2 from it
@@ -594,7 +594,7 @@ public:
 
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         zhandle_t* savezh=zh;
 
         // issue a multi request
@@ -639,7 +639,7 @@ public:
 
         zh=zookeeper_init("localhost:2121",watcher,10000,TEST_CLIENT_ID,0,0);
         CPPUNIT_ASSERT(zh!=0);
-        forceConnected(zh);
+        forceConnected(zh, &timeMock.tv);
         zhandle_t* savezh=zh;
 
         // these shall persist during the test
diff --git a/zookeeper-client/zookeeper-client-c/tests/Util.cc b/zookeeper-client/zookeeper-client-c/tests/Util.cc
index 2b9da84..7b49eca 100644
--- a/zookeeper-client/zookeeper-client-c/tests/Util.cc
+++ b/zookeeper-client/zookeeper-client-c/tests/Util.cc
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+#include <time.h>
+
 #include "Util.h"
 #include "string.h"
 
diff --git a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.cc b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.cc
index 54c0819..674945e 100644
--- a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.cc
+++ b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.cc
@@ -525,7 +525,7 @@ void ZookeeperServer::notifyBufferSent(const std::string& buffer){
     addRecvResponse(e);
 }
 
-void forceConnected(zhandle_t* zh){
+void forceConnected(zhandle_t* zh, const struct timeval *last_recv_send){
     // simulate connected state
     zh->state=ZOO_CONNECTED_STATE;
 
@@ -536,8 +536,13 @@ void forceConnected(zhandle_t* zh){
     zh->addrs.next++;
 
     zh->input_buffer=0;
-    gettimeofday(&zh->last_recv,0);
-    gettimeofday(&zh->last_send,0);
+    if (last_recv_send) {
+        zh->last_recv = *last_recv_send;
+        zh->last_send = *last_recv_send;
+    } else {
+        gettimeofday(&zh->last_recv,0);
+        gettimeofday(&zh->last_send,0);
+    }
 }
 
 void terminateZookeeperThreads(zhandle_t* zh){
diff --git a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h
index 48eddab..a091f2f 100644
--- a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h
+++ b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h
@@ -30,7 +30,7 @@
 // sets internal zhandle_t members to certain values to simulate the client 
 // connected state. This function should only be used with the single-threaded
 // Async API tests!
-void forceConnected(zhandle_t* zh); 
+void forceConnected(zhandle_t* zh, const struct timeval *last_recv_send = NULL);
 
 /**
  * Gracefully terminates zookeeper I/O and completion threads. 
diff --git a/zookeeper-compatibility-tests/pom.xml b/zookeeper-compatibility-tests/pom.xml
index 2faa87e..45881bc 100644
--- a/zookeeper-compatibility-tests/pom.xml
+++ b/zookeeper-compatibility-tests/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.zookeeper</groupId>
         <artifactId>parent</artifactId>
-        <version>3.8.0</version>
+        <version>3.8.1</version>
     </parent>
     <packaging>pom</packaging>
     <modelVersion>4.0.0</modelVersion>
diff --git a/zookeeper-compatibility-tests/zookeeper-compatibility-tests-curator/pom.xml b/zookeeper-compatibility-tests/zookeeper-compatibility-tests-curator/pom.xml
index c940c26..97cbc71 100644
--- a/zookeeper-compatibility-tests/zookeeper-compatibility-tests-curator/pom.xml
+++ b/zookeeper-compatibility-tests/zookeeper-compatibility-tests-curator/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.zookeeper</groupId>
         <artifactId>zookeeper-compatibility-tests</artifactId>
-        <version>3.8.0</version>
+        <version>3.8.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/zookeeper-contrib/pom.xml b/zookeeper-contrib/pom.xml
index 333d5f1..87a90fc 100755
--- a/zookeeper-contrib/pom.xml
+++ b/zookeeper-contrib/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-contrib</artifactId>
diff --git a/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml b/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
index 14940b0..bcf2fd8 100755
--- a/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
+++ b/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-contrib</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <groupId>org.apache.zookeeper</groupId>
diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml b/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
index fac095c..a3c5c48 100755
--- a/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
+++ b/zookeeper-contrib/zookeeper-contrib-loggraph/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-contrib</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-contrib-loggraph</artifactId>
diff --git a/zookeeper-contrib/zookeeper-contrib-rest/pom.xml b/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
index 504b282..4ee7356 100755
--- a/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
+++ b/zookeeper-contrib/zookeeper-contrib-rest/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-contrib</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-contrib-rest</artifactId>
diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml b/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
index 4a86d74..3ea0626 100755
--- a/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-contrib</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-contrib-zooinspector</artifactId>
@@ -114,5 +114,11 @@
       <artifactId>apache-rat-tasks</artifactId>
       <version>${rat.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
\ No newline at end of file
diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/ZooInspectorTreeView.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/ZooInspectorTreeView.java
index 6bff1ca..86422a3 100644
--- a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/ZooInspectorTreeView.java
+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/ZooInspectorTreeView.java
@@ -19,6 +19,7 @@ package org.apache.zookeeper.inspector.gui;
 
 import com.nitido.utils.toaster.Toaster;
 import org.apache.zookeeper.inspector.gui.nodeviewer.NodeSelectionListener;
+import org.apache.zookeeper.inspector.logger.LoggerFactory;
 import org.apache.zookeeper.inspector.manager.NodeListener;
 import org.apache.zookeeper.inspector.manager.Pair;
 import org.apache.zookeeper.inspector.manager.ZooInspectorManager;
@@ -355,6 +356,12 @@ public class ZooInspectorTreeView extends JPanel {
         return selected != null ? ((ZooInspectorTreeNode) selected.getLastPathComponent()) : null;
     }
 
+    private void showWarnDialog(String message){
+        JOptionPane.showMessageDialog(this,
+                message, "Error",
+                JOptionPane.ERROR_MESSAGE);
+    }
+
     ///////////////////////////////// BACKING DATA MODEL /////////////////////////////////
 
     /**
@@ -386,17 +393,30 @@ public class ZooInspectorTreeView extends JPanel {
                 @Override
                 protected void done() {
                     //runs on the UI event thread
+                    boolean success;
+                    try {
+                        success = get();
+                    } catch (Exception e) {
+                        success = false;
+                        LoggerFactory.getLogger().error("create fail for {} {}", parentNode, newNodeName, e);
+                        showWarnDialog("create " + newNodeName + " in " + parentNode + " fail, exception is " + e.getMessage());
+                    }
 
-                    //extra logic to find the correct spot alphabetically to insert the new node in the tree`
-                    int i = 0;
-                    for (; i < parentNode.getChildCount(); i++) {
-                        ZooInspectorTreeNode existingChild = (ZooInspectorTreeNode) parentNode.getChildAt(i);
-                        if (newNodeName.compareTo(existingChild.getName()) < 0) {
-                            break;
+                    if (!success) {
+                        showWarnDialog("create " + newNodeName + " in " + parentNode + " fail, see log for more detail");
+                    }
+                    else {
+                        //extra logic to find the correct spot alphabetically to insert the new node in the tree`
+                        int i = 0;
+                        for (; i < parentNode.getChildCount(); i++) {
+                            ZooInspectorTreeNode existingChild = (ZooInspectorTreeNode) parentNode.getChildAt(i);
+                            if (newNodeName.compareTo(existingChild.getName()) < 0) {
+                                break;
+                            }
                         }
+                        insertNodeInto(new ZooInspectorTreeNode(newNodeName, parentNode, 0), parentNode, i);
+                        parentNode.setNumDisplayChildren(parentNode.getNumDisplayChildren() + 1);
                     }
-                    insertNodeInto(new ZooInspectorTreeNode(newNodeName, parentNode, 0), parentNode, i);
-                    parentNode.setNumDisplayChildren(parentNode.getNumDisplayChildren() + 1);
                     getRootPane().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                 }
             };
diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java
index 0db6140..0897bac 100644
--- a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java
+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java
@@ -106,10 +106,13 @@ public class ZooInspectorManagerImpl implements ZooInspectorManager {
     private static final File defaultConnectionFile = new File(
             "./src/main/resources/defaultConnectionSettings.cfg");
 
-    private DataEncryptionManager encryptionManager;
+    //package visible for test
+    DataEncryptionManager encryptionManager;
     private String connectString;
     private int sessionTimeout;
-    private ZooKeeper zooKeeper;
+
+    //package visible for test
+    ZooKeeper zooKeeper;
     private final Map<String, NodeWatcher> watchers = new HashMap<String, NodeWatcher>();
     protected boolean connected = true;
     private Properties lastConnectionProps;
@@ -390,7 +393,14 @@ public class ZooInspectorManagerImpl implements ZooInspectorManager {
             try {
                 String[] nodeElements = nodeName.split("/");
                 for (String nodeElement : nodeElements) {
-                    String node = parent + "/" + nodeElement;
+                    String node;
+                    //for case parent is "/" and maybe other cases
+                    if (parent.endsWith("/")) {
+                        node = parent + nodeElement;
+                    }
+                    else {
+                        node = parent + "/" + nodeElement;
+                    }
                     Stat s = zooKeeper.exists(node, false);
                     if (s == null) {
                         zooKeeper.create(node, this.encryptionManager
diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/test/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImplTest.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/test/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImplTest.java
new file mode 100644
index 0000000..5057d54
--- /dev/null
+++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/test/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImplTest.java
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.manager;
+
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.common.PathUtils;
+import org.apache.zookeeper.data.Stat;
+import org.apache.zookeeper.inspector.encryption.BasicDataEncryptionManager;
+import org.apache.zookeeper.retry.ZooKeeperRetry;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.io.IOException;
+
+public class ZooInspectorManagerImplTest {
+
+    /**
+     * test create zookeeper node operation,
+     * no easy way to create a real zk server so use a mocked client that only validate path
+     *
+     * @throws IOException
+     * @throws KeeperException
+     * @throws InterruptedException
+     */
+    @Test
+    public void testNodeCreateRoot() throws IOException, KeeperException, InterruptedException {
+        ZooKeeper mockedZk = getMockedZk();
+
+        ZooInspectorManagerImpl manager = getInspectorManagerImpl(mockedZk);
+
+        boolean createSuccess = manager.createNode("/", "test");
+        Assert.assertTrue(createSuccess);
+    }
+
+    /**
+     * test create a normal child node
+     *
+     * @throws IOException
+     * @throws KeeperException
+     * @throws InterruptedException
+     */
+
+    @Test
+    public void testNodeCreateNormal() throws IOException, KeeperException, InterruptedException {
+        ZooKeeper mockedZk = getMockedZk();
+
+        ZooInspectorManagerImpl manager = getInspectorManagerImpl(mockedZk);
+
+        boolean createSuccess = manager.createNode("/parent", "test");
+        Assert.assertTrue(createSuccess);
+    }
+
+
+    /**
+     * create a mocked zk client only check path validate
+     *
+     * @return
+     * @throws KeeperException
+     * @throws InterruptedException
+     */
+    private ZooKeeper getMockedZk() throws KeeperException, InterruptedException {
+        ZooKeeper mockZk = Mockito.mock(ZooKeeperRetry.class);
+        Mockito.when(mockZk.exists(Mockito.anyString(), Mockito.anyBoolean())).then((Answer<Stat>) invocation -> {
+            String path = invocation.getArgument(0);
+            PathUtils.validatePath(path);
+            return null;
+        });
+        Mockito.when(mockZk.create(Mockito.anyString(), Mockito.any(), Mockito.any(),
+                Mockito.any())).then(new Answer<String>() {
+            @Override
+            public String answer(InvocationOnMock invocation) throws Throwable {
+                String path = invocation.getArgument(0);
+                PathUtils.validatePath(path);
+                return path;
+            }
+        });
+        return mockZk;
+    }
+
+    /**
+     * create a inspector manager instance from zk
+     *
+     * @param zooKeeper
+     * @return
+     * @throws IOException
+     */
+    private ZooInspectorManagerImpl getInspectorManagerImpl(ZooKeeper zooKeeper) throws IOException {
+        ZooInspectorManagerImpl manager = new ZooInspectorManagerImpl();
+        manager.zooKeeper = zooKeeper;
+        manager.connected = true;
+        manager.encryptionManager = new BasicDataEncryptionManager();
+        return manager;
+    }
+}
diff --git a/zookeeper-docs/pom.xml b/zookeeper-docs/pom.xml
index b645413..22a53d3 100644
--- a/zookeeper-docs/pom.xml
+++ b/zookeeper-docs/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-docs</artifactId>
diff --git a/zookeeper-docs/src/main/resources/markdown/releasenotes.md b/zookeeper-docs/src/main/resources/markdown/releasenotes.md
index a64354f..7f78406 100644
--- a/zookeeper-docs/src/main/resources/markdown/releasenotes.md
+++ b/zookeeper-docs/src/main/resources/markdown/releasenotes.md
@@ -14,8 +14,54 @@ See the License for the specific language governing permissions and
 limitations under the License.
 //-->
 
+# Release Notes - ZooKeeper - Version 3.8.1
+
+## Bug
+
+* [ZOOKEEPER-3652](https://issues.apache.org/jira/browse/ZOOKEEPER-3652) - Improper synchronization in ClientCnxn
+* [ZOOKEEPER-4308](https://issues.apache.org/jira/browse/ZOOKEEPER-4308) - Flaky test: EagerACLFilterTest.testSetDataFail
+* [ZOOKEEPER-4460](https://issues.apache.org/jira/browse/ZOOKEEPER-4460) - QuorumPeer overrides Thread.getId with different semantics
+* [ZOOKEEPER-4473](https://issues.apache.org/jira/browse/ZOOKEEPER-4473) - zooInspector create root node fail with path validate
+* [ZOOKEEPER-4477](https://issues.apache.org/jira/browse/ZOOKEEPER-4477) - Single Kerberos ticket renewal failure can prevent all future renewals since Java 9
+* [ZOOKEEPER-4504](https://issues.apache.org/jira/browse/ZOOKEEPER-4504) - ZKUtil#deleteRecursive causing deadlock in HDFS HA functionality
+* [ZOOKEEPER-4505](https://issues.apache.org/jira/browse/ZOOKEEPER-4505) - CVE-2020-36518 - Upgrade jackson databind to 2.13.2.1
+* [ZOOKEEPER-4511](https://issues.apache.org/jira/browse/ZOOKEEPER-4511) - Flaky test: FileTxnSnapLogMetricsTest.testFileTxnSnapLogMetrics
+* [ZOOKEEPER-4514](https://issues.apache.org/jira/browse/ZOOKEEPER-4514) - ClientCnxnSocketNetty throwing NPE
+* [ZOOKEEPER-4515](https://issues.apache.org/jira/browse/ZOOKEEPER-4515) - ZK Cli quit command always logs error
+* [ZOOKEEPER-4537](https://issues.apache.org/jira/browse/ZOOKEEPER-4537) - Race between SyncThread and CommitProcessor thread
+* [ZOOKEEPER-4654](https://issues.apache.org/jira/browse/ZOOKEEPER-4654) - Fix C client test compilation error in Util.cc.
+
+## Improvement
+
+* [ZOOKEEPER-4289](https://issues.apache.org/jira/browse/ZOOKEEPER-4289) - Reduce the performance impact of Prometheus metrics
+* [ZOOKEEPER-4529](https://issues.apache.org/jira/browse/ZOOKEEPER-4529) - Upgrade netty to 4.1.76.Final
+* [ZOOKEEPER-4531](https://issues.apache.org/jira/browse/ZOOKEEPER-4531) - Revert Netty TCNative change
+* [ZOOKEEPER-4551](https://issues.apache.org/jira/browse/ZOOKEEPER-4551) - Do not log spammy stacktrace when a client closes its connection
+* [ZOOKEEPER-4616](https://issues.apache.org/jira/browse/ZOOKEEPER-4616) - Upgrade docker image for the dev enviroment to resolve CVEs
+* [ZOOKEEPER-4657](https://issues.apache.org/jira/browse/ZOOKEEPER-4657) - Publish SBOM artifacts
+* [ZOOKEEPER-4659](https://issues.apache.org/jira/browse/ZOOKEEPER-4659) - Upgrade Commons CLI to 1.5.0 due to OWASP failing on 1.4 CVE-2021-37533
+* [ZOOKEEPER-4660](https://issues.apache.org/jira/browse/ZOOKEEPER-4660) - Suppress false positive OWASP failure for CVE-2021-37533
+* [ZOOKEEPER-4661](https://issues.apache.org/jira/browse/ZOOKEEPER-4661) - Upgrade Jackson Databind to 2.13.4.2 for CVE-2022-42003 CVE-2022-42004
+
+## Task
+
+* [ZOOKEEPER-4479](https://issues.apache.org/jira/browse/ZOOKEEPER-4479) - Tests: C client test TestOperations.cc testTimeoutCausedByWatches1 is very flaky on CI
+* [ZOOKEEPER-4510](https://issues.apache.org/jira/browse/ZOOKEEPER-4510) - dependency-check:check failing - reload4j-1.2.19.jar: CVE-2020-9493, CVE-2022-23307
+* [ZOOKEEPER-4627](https://issues.apache.org/jira/browse/ZOOKEEPER-4627) - High CVE-2022-2048 in jetty-*-9.4.46.v20220331.jar fixed in 9.4.47
+* [ZOOKEEPER-4632](https://issues.apache.org/jira/browse/ZOOKEEPER-4632) - Fix NPE from ConnectionMetricsTest.testRevalidateCount
+* [ZOOKEEPER-4641](https://issues.apache.org/jira/browse/ZOOKEEPER-4641) - GH CI fails with error: implicit declaration of function FIPS_mode
+* [ZOOKEEPER-4649](https://issues.apache.org/jira/browse/ZOOKEEPER-4649) - Upgrade netty to 4.1.86 because of CVE-2022-41915
+* [ZOOKEEPER-4666](https://issues.apache.org/jira/browse/ZOOKEEPER-4666) - Fix license files for Netty: some files are for 4.1.76 and some other files are for 4.1.86
+
+## Sub-task
+
+* [ZOOKEEPER-4327](https://issues.apache.org/jira/browse/ZOOKEEPER-4327) - Flaky test: RequestThrottlerTest
+
+
+&nbsp;
+
+# Release Notes - ZooKeeper - Version 3.8.0
 
-        Release Notes - ZooKeeper - Version 3.8.0
     
 ## New Feature
 
diff --git a/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md b/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md
index 0b658d0..23e8580 100644
--- a/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md
+++ b/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md
@@ -1654,7 +1654,7 @@ and [SASL authentication for ZooKeeper](https://cwiki.apache.org/confluence/disp
     **New in 3.5.5:**
     Specifies the file format of client and quorum keystores. Values: JKS, PEM, PKCS12 or null (detect by filename).
     Default: null.
-    **New in 3.6.3, 3.7.0:**
+    **New in 3.5.10, 3.6.3, 3.7.0:**
     The format BCFKS was added.
 
 * *ssl.trustStore.location* and *ssl.trustStore.password* and *ssl.quorum.trustStore.location* and *ssl.quorum.trustStore.password* :
@@ -1675,7 +1675,7 @@ and [SASL authentication for ZooKeeper](https://cwiki.apache.org/confluence/disp
     **New in 3.5.5:**
     Specifies the file format of client and quorum trustStores. Values: JKS, PEM, PKCS12 or null (detect by filename).
     Default: null.
-    **New in 3.6.3, 3.7.0:**
+    **New in 3.5.10, 3.6.3, 3.7.0:**
     The format BCFKS was added.
 
 * *ssl.protocol* and *ssl.quorum.protocol* :
diff --git a/zookeeper-it/pom.xml b/zookeeper-it/pom.xml
index e69b3fb..4252e88 100755
--- a/zookeeper-it/pom.xml
+++ b/zookeeper-it/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-it</artifactId>
diff --git a/zookeeper-jute/pom.xml b/zookeeper-jute/pom.xml
index c8d0a5b..26a407a 100755
--- a/zookeeper-jute/pom.xml
+++ b/zookeeper-jute/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-jute</artifactId>
diff --git a/zookeeper-metrics-providers/pom.xml b/zookeeper-metrics-providers/pom.xml
index d15d877..e0fc80c 100755
--- a/zookeeper-metrics-providers/pom.xml
+++ b/zookeeper-metrics-providers/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-metrics-providers</artifactId>
diff --git a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml
index a54b6c8..a2cfeac 100755
--- a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml
+++ b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-metrics-providers</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-prometheus-metrics</artifactId>
diff --git a/zookeeper-recipes/pom.xml b/zookeeper-recipes/pom.xml
index 144e1ea..0932cca 100755
--- a/zookeeper-recipes/pom.xml
+++ b/zookeeper-recipes/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-recipes</artifactId>
diff --git a/zookeeper-recipes/zookeeper-recipes-election/pom.xml b/zookeeper-recipes/zookeeper-recipes-election/pom.xml
index f41304a..f4c70af 100755
--- a/zookeeper-recipes/zookeeper-recipes-election/pom.xml
+++ b/zookeeper-recipes/zookeeper-recipes-election/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-recipes</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-recipes-election</artifactId>
diff --git a/zookeeper-recipes/zookeeper-recipes-lock/pom.xml b/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
index 3ccb72e..8137d5f 100755
--- a/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
+++ b/zookeeper-recipes/zookeeper-recipes-lock/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-recipes</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-recipes-lock</artifactId>
diff --git a/zookeeper-recipes/zookeeper-recipes-queue/pom.xml b/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
index 5c47c49..5e2abaa 100755
--- a/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
+++ b/zookeeper-recipes/zookeeper-recipes-queue/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>zookeeper-recipes</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper-recipes-queue</artifactId>
diff --git a/zookeeper-server/pom.xml b/zookeeper-server/pom.xml
index 376ec94..ac2e92b 100755
--- a/zookeeper-server/pom.xml
+++ b/zookeeper-server/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.zookeeper</groupId>
     <artifactId>parent</artifactId>
-    <version>3.8.0</version>
+    <version>3.8.1</version>
   </parent>
 
   <artifactId>zookeeper</artifactId>
@@ -66,10 +66,6 @@
       <groupId>io.netty</groupId>
       <artifactId>netty-handler</artifactId>
     </dependency>
-      <dependency>
-        <groupId>io.netty</groupId>
-        <artifactId>netty-tcnative</artifactId>
-      </dependency>
     <dependency>
       <groupId>io.netty</groupId>
       <artifactId>netty-transport-native-epoll</artifactId>
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
index 347a68f..61555c3 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
@@ -870,6 +870,18 @@ public class ClientCnxn {
         private boolean isFirstConnect = true;
         private volatile ZooKeeperSaslClient zooKeeperSaslClient;
 
+        private String stripChroot(String serverPath) {
+            if (serverPath.startsWith(chrootPath)) {
+                if (serverPath.length() == chrootPath.length()) {
+                    return "/";
+                }
+                return serverPath.substring(chrootPath.length());
+            } else if (serverPath.startsWith(ZooDefs.ZOOKEEPER_NODE_SUBTREE)) {
+                return serverPath;
+            }
+            LOG.warn("Got server path {} which is not descendant of chroot path {}.", serverPath, chrootPath);
+            return serverPath;
+        }
 
         void readResponse(ByteBuffer incomingBuffer) throws IOException {
             ByteBufferInputStream bbis = new ByteBufferInputStream(incomingBuffer);
@@ -901,14 +913,8 @@ public class ClientCnxn {
                 // convert from a server path to a client path
                 if (chrootPath != null) {
                     String serverPath = event.getPath();
-                    if (serverPath.compareTo(chrootPath) == 0) {
-                        event.setPath("/");
-                    } else if (serverPath.length() > chrootPath.length()) {
-                        event.setPath(serverPath.substring(chrootPath.length()));
-                     } else {
-                         LOG.warn("Got server path {} which is too short for chroot path {}.",
-                             event.getPath(), chrootPath);
-                     }
+                    String clientPath = stripChroot(serverPath);
+                    event.setPath(clientPath);
                 }
 
                 WatchedEvent we = new WatchedEvent(event);
@@ -1175,6 +1181,7 @@ public class ClientCnxn {
         }
 
         @Override
+        @SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
         public void run() {
             clientCnxnSocket.introduce(this, sessionId, outgoingQueue);
             clientCnxnSocket.updateNow();
@@ -1283,10 +1290,11 @@ public class ClientCnxn {
                 } catch (Throwable e) {
                     if (closing) {
                         // closing so this is expected
-                        LOG.warn(
-                            "An exception was thrown while closing send thread for session 0x{}.",
-                            Long.toHexString(getSessionId()),
-                            e);
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug(
+                                "An exception was thrown while closing send thread for session 0x{}.",
+                                Long.toHexString(getSessionId()), e);
+                        }
                         break;
                     } else {
                         LOG.warn(
@@ -1303,7 +1311,7 @@ public class ClientCnxn {
                 }
             }
 
-            synchronized (state) {
+            synchronized (outgoingQueue) {
                 // When it comes to this point, it guarantees that later queued
                 // packet to outgoingQueue will be notified of death.
                 cleanup();
@@ -1645,6 +1653,7 @@ public class ClientCnxn {
         return queuePacket(h, r, request, response, cb, clientPath, serverPath, ctx, watchRegistration, null);
     }
 
+    @SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
     public Packet queuePacket(
         RequestHeader h,
         ReplyHeader r,
@@ -1671,7 +1680,7 @@ public class ClientCnxn {
         // 1. synchronize with the final cleanup() in SendThread.run() to avoid race
         // 2. synchronized against each packet. So if a closeSession packet is added,
         // later packet will be notified.
-        synchronized (state) {
+        synchronized (outgoingQueue) {
             if (!state.isAlive() || closing) {
                 conLossPacket(packet);
             } else {
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java
index 2686fed..df53978 100755
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java
@@ -304,7 +304,7 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
      * @return a ChannelFuture that will complete when the write operation
      *         succeeds or fails.
      */
-    private ChannelFuture sendPktAndFlush(Packet p) {
+    private ChannelFuture sendPktAndFlush(Packet p) throws IOException {
         return sendPkt(p, true);
     }
 
@@ -314,7 +314,7 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
      * @return a ChannelFuture that will complete when the write operation
      *         succeeds or fails.
      */
-    private ChannelFuture sendPktOnly(Packet p) {
+    private ChannelFuture sendPktOnly(Packet p) throws IOException {
         return sendPkt(p, false);
     }
 
@@ -325,7 +325,10 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
         }
     };
 
-    private ChannelFuture sendPkt(Packet p, boolean doFlush) {
+    private ChannelFuture sendPkt(Packet p, boolean doFlush) throws IOException {
+        if (channel == null) {
+            throw new IOException("channel has been closed");
+        }
         // Assuming the packet will be sent out successfully. Because if it fails,
         // the channel will close and clean up queues.
         p.createBB();
@@ -336,7 +339,7 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
         return result;
     }
 
-    private void sendPrimePacket() {
+    private void sendPrimePacket() throws IOException {
         // assuming the first packet is the priming packet.
         sendPktAndFlush(outgoingQueue.remove());
     }
@@ -344,7 +347,7 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
     /**
      * doWrite handles writing the packets from outgoingQueue via network to server.
      */
-    private void doWrite(Queue<Packet> pendingQueue, Packet p, ClientCnxn cnxn) {
+    private void doWrite(Queue<Packet> pendingQueue, Packet p, ClientCnxn cnxn) throws IOException {
         updateNow();
         boolean anyPacketsSent = false;
         while (true) {
@@ -374,9 +377,6 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket {
 
     @Override
     void sendPacket(ClientCnxn.Packet p) throws IOException {
-        if (channel == null) {
-            throw new IOException("channel has been closed");
-        }
         sendPktAndFlush(p);
     }
 
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/Login.java b/zookeeper-server/src/main/java/org/apache/zookeeper/Login.java
index e74cddb..ab2bf63 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/Login.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/Login.java
@@ -63,7 +63,10 @@ public class Login {
     // Regardless of TICKET_RENEW_WINDOW setting above and the ticket expiry time,
     // thread will not sleep between refresh attempts any less than 1 minute (60*1000 milliseconds = 1 minute).
     // Change the '1' to e.g. 5, to change this to 5 minutes.
-    private static final long MIN_TIME_BEFORE_RELOGIN = 1 * 60 * 1000L;
+    private static final long DEFAULT_MIN_TIME_BEFORE_RELOGIN = 1 * 60 * 1000L;
+    public static final String MIN_TIME_BEFORE_RELOGIN_CONFIG_KEY = "zookeeper.kerberos.minReLoginTimeMs";
+    private static final long MIN_TIME_BEFORE_RELOGIN = Long.getLong(
+      MIN_TIME_BEFORE_RELOGIN_CONFIG_KEY, DEFAULT_MIN_TIME_BEFORE_RELOGIN);
 
     private Subject subject = null;
     private Thread t = null;
@@ -223,7 +226,7 @@ public class Login {
                                     --retry;
                                     // sleep for 10 seconds
                                     try {
-                                        Thread.sleep(10 * 1000);
+                                        sleepBeforeRetryFailedRefresh();
                                     } catch (InterruptedException ie) {
                                         LOG.error("Interrupted while renewing TGT, exiting Login thread");
                                         return;
@@ -251,7 +254,7 @@ public class Login {
                                     --retry;
                                     // sleep for 10 seconds.
                                     try {
-                                        Thread.sleep(10 * 1000);
+                                        sleepBeforeRetryFailedRefresh();
                                     } catch (InterruptedException e) {
                                         LOG.error("Interrupted during login retry after LoginException:", le);
                                         throw le;
@@ -400,10 +403,10 @@ public class Login {
     }
 
     /**
-     * Get the time of the last login.
-     * @return the number of milliseconds since the beginning of time.
+     * Get the time of the last login (ticket initialization or last ticket renewal).
+     * @return the number of milliseconds since epoch.
      */
-    private long getLastLogin() {
+    public long getLastLogin() {
         return lastLogin;
     }
 
@@ -428,7 +431,7 @@ public class Login {
             //clear up the kerberos state. But the tokens are not cleared! As per
             //the Java kerberos login module code, only the kerberos credentials
             //are cleared
-            login.logout();
+            logout();
             //login and also update the subject field of this instance to
             //have the new credentials (pass it to the LoginContext constructor)
             login = new LoginContext(loginContextName, getSubject());
@@ -438,4 +441,18 @@ public class Login {
         }
     }
 
+    // this method also visible for unit tests, to make sure kerberos state cleaned up
+    protected synchronized void logout() throws LoginException {
+        // We need to make sure not to call LoginContext.logout() when we
+        // are not logged in. Since Java 9 this could result in an NPE.
+        // See ZOOKEEPER-4477 for more details.
+        if (subject != null && !subject.getPrincipals().isEmpty()) {
+            login.logout();
+        }
+    }
+
+    // this method is overwritten in unit tests to test concurrency
+    protected void sleepBeforeRetryFailedRefresh() throws InterruptedException {
+        Thread.sleep(10 * 1000);
+    }
 }
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
index d206341..2ccdfc8 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
@@ -49,7 +49,14 @@ public class ZKUtil {
      * If there is an error with deleting one of the sub-nodes in the tree,
      * this operation would abort and would be the responsibility of the app to handle the same.
      *
-     *
+     * @param zk Zookeeper client
+     * @param pathRoot path to be deleted
+     * @param batchSize number of delete operations to be submitted in one call.
+     *                  batchSize is also used to decide sync and async delete API invocation.
+     *                  If batchSize>0 then async otherwise sync delete API is invoked. batchSize>0
+     *                  gives better performance. batchSize<=0 scenario is handled to preserve
+     *                  backward compatibility.
+     * @return true if given node and all its sub nodes are deleted successfully otherwise false
      * @throws IllegalArgumentException if an invalid path is specified
      */
     public static boolean deleteRecursive(
@@ -61,7 +68,15 @@ public class ZKUtil {
         List<String> tree = listSubTreeBFS(zk, pathRoot);
         LOG.debug("Deleting tree: {}", tree);
 
-        return deleteInBatch(zk, tree, batchSize);
+        if (batchSize > 0) {
+            return deleteInBatch(zk, tree, batchSize);
+        } else {
+            for (int i = tree.size() - 1; i >= 0; --i) {
+                //Delete the leaves first and eventually get rid of the root
+                zk.delete(tree.get(i), -1); //Delete all versions of the node with -1.
+            }
+            return true;
+        }
     }
 
     /**
@@ -73,7 +88,8 @@ public class ZKUtil {
     public static void deleteRecursive(
         ZooKeeper zk,
         final String pathRoot) throws InterruptedException, KeeperException {
-        deleteRecursive(zk, pathRoot, 1000);
+        // batchSize=0 is passed to preserve the backward compatibility with older clients.
+        deleteRecursive(zk, pathRoot, 0);
     }
 
     private static class BatchedDeleteCbContext {
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java
index 02cde23..dd62154 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java
@@ -330,7 +330,15 @@ public class NIOServerCnxn extends ServerCnxn {
             if (k.isReadable()) {
                 int rc = sock.read(incomingBuffer);
                 if (rc < 0) {
-                    handleFailedRead();
+                    try {
+                        handleFailedRead();
+                    } catch (EndOfStreamException e) {
+                        // no stacktrace. this case is very common, and it is usually not a problem.
+                        LOG.info("{}", e.getMessage());
+                        // expecting close to log session closure
+                        close(e.getReason());
+                        return;
+                    }
                 }
                 if (incomingBuffer.remaining() == 0) {
                     boolean isPayload;
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java
index d60efa0..4a401e5 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java
@@ -195,13 +195,11 @@ public class RequestThrottler extends ZooKeeperCriticalThread {
         LOG.info("RequestThrottler shutdown. Dropped {} requests", dropped);
     }
 
-    private synchronized void throttleSleep(int stallTime) {
-        try {
-            ServerMetrics.getMetrics().REQUEST_THROTTLE_WAIT_COUNT.add(1);
-            this.wait(stallTime);
-        } catch (InterruptedException ie) {
-            return;
-        }
+
+    // @VisibleForTesting
+    synchronized void throttleSleep(int stallTime) throws InterruptedException {
+        ServerMetrics.getMetrics().REQUEST_THROTTLE_WAIT_COUNT.add(1);
+        this.wait(stallTime);
     }
 
     @SuppressFBWarnings(value = "NN_NAKED_NOTIFY", justification = "state change is in ZooKeeperServer.decInProgress() ")
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
index 86c13ae..0725c38 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
@@ -110,7 +110,7 @@ public class ZooKeeperServer implements SessionExpirer, ServerStats.Provider {
 
     // When enabled, will check ACL constraints appertained to the requests first,
     // before sending the requests to the quorum.
-    static final boolean enableEagerACLCheck;
+    static boolean enableEagerACLCheck;
 
     static final boolean skipACL;
 
@@ -157,6 +157,17 @@ public class ZooKeeperServer implements SessionExpirer, ServerStats.Provider {
         LOG.info("{} = {}", CLOSE_SESSION_TXN_ENABLED, closeSessionTxnEnabled);
     }
 
+    // @VisibleForTesting
+    public static boolean isEnableEagerACLCheck() {
+        return enableEagerACLCheck;
+    }
+
+    // @VisibleForTesting
+    public static void setEnableEagerACLCheck(boolean enabled) {
+        ZooKeeperServer.enableEagerACLCheck = enabled;
+        LOG.info("Update {} to {}", ENABLE_EAGER_ACL_CHECK, enabled);
+    }
+
     public static boolean isCloseSessionTxnEnabled() {
         return closeSessionTxnEnabled;
     }
@@ -738,9 +749,12 @@ public class ZooKeeperServer implements SessionExpirer, ServerStats.Provider {
     }
 
     protected void startRequestThrottler() {
-        requestThrottler = new RequestThrottler(this);
+        requestThrottler = createRequestThrottler();
         requestThrottler.start();
+    }
 
+    protected RequestThrottler createRequestThrottler() {
+        return new RequestThrottler(this);
     }
 
     protected void setupRequestProcessors() {
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
index 705c6cc..236c7ec 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
@@ -827,7 +827,7 @@ public class Commands {
                 QuorumPeer.ZabState zabState = peer.getZabState();
                 QuorumVerifier qv = peer.getQuorumVerifier();
 
-                QuorumPeer.QuorumServer voter = qv.getVotingMembers().get(peer.getId());
+                QuorumPeer.QuorumServer voter = qv.getVotingMembers().get(peer.getMyId());
                 boolean voting = (
                         voter != null
                                 && voter.addr.equals(peer.getQuorumAddress())
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/AckRequestProcessor.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/AckRequestProcessor.java
index 32eb8a8..f277dcd 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/AckRequestProcessor.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/AckRequestProcessor.java
@@ -44,7 +44,7 @@ class AckRequestProcessor implements RequestProcessor {
         QuorumPeer self = leader.self;
         if (self != null) {
             request.logLatency(ServerMetrics.getMetrics().PROPOSAL_ACK_CREATION_LATENCY);
-            leader.processAck(self.getId(), request.zxid, null);
+            leader.processAck(self.getMyId(), request.zxid, null);
         } else {
             LOG.error("Null QuorumPeer");
         }
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java
index 86dce2b..11ba093 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java
@@ -213,12 +213,11 @@ public class CommitProcessor extends ZooKeeperCriticalThread implements RequestP
                  * request from a client on another server (i.e., the order of
                  * the following two lines is important!).
                  */
-                commitIsWaiting = !committedRequests.isEmpty();
-                requestsToProcess = queuedRequests.size();
-                // Avoid sync if we have something to do
-                if (requestsToProcess == 0 && !commitIsWaiting) {
-                    // Waiting for requests to process
-                    synchronized (this) {
+                synchronized (this) {
+                    commitIsWaiting = !committedRequests.isEmpty();
+                    requestsToProcess = queuedRequests.size();
+                    if (requestsToProcess == 0 && !commitIsWaiting) {
+                        // Waiting for requests to process
                         while (!stopped && requestsToProcess == 0 && !commitIsWaiting) {
                             wait();
                             commitIsWaiting = !committedRequests.isEmpty();
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
index 654ed1c..91207d1 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
@@ -307,7 +307,7 @@ public class FastLeaderElection implements Election {
                                         QuorumVerifier curQV = self.getQuorumVerifier();
                                         if (rqv.getVersion() > curQV.getVersion()) {
                                             LOG.info("{} Received version: {} my version: {}",
-                                                     self.getId(),
+                                                     self.getMyId(),
                                                      Long.toHexString(rqv.getVersion()),
                                                      Long.toHexString(self.getQuorumVerifier().getVersion()));
                                             if (self.getPeerState() == ServerState.LOOKING) {
@@ -356,7 +356,7 @@ public class FastLeaderElection implements Election {
                             sendqueue.offer(notmsg);
                         } else {
                             // Receive new message
-                            LOG.debug("Receive new notification message. My id = {}", self.getId());
+                            LOG.debug("Receive new notification message. My id = {}", self.getMyId());
 
                             // State of peer that sent this message
                             QuorumPeer.ServerState ackstate = QuorumPeer.ServerState.LOOKING;
@@ -446,7 +446,7 @@ public class FastLeaderElection implements Election {
 
                                     LOG.debug(
                                         "Sending new notification. My id ={} recipient={} zxid=0x{} leader={} config version = {}",
-                                        self.getId(),
+                                        self.getMyId(),
                                         response.sid,
                                         Long.toHexString(current.getZxid()),
                                         current.getId(),
@@ -535,12 +535,12 @@ public class FastLeaderElection implements Election {
 
             this.ws = new WorkerSender(manager);
 
-            this.wsThread = new Thread(this.ws, "WorkerSender[myid=" + self.getId() + "]");
+            this.wsThread = new Thread(this.ws, "WorkerSender[myid=" + self.getMyId() + "]");
             this.wsThread.setDaemon(true);
 
             this.wr = new WorkerReceiver(manager);
 
-            this.wrThread = new Thread(this.wr, "WorkerReceiver[myid=" + self.getId() + "]");
+            this.wrThread = new Thread(this.wr, "WorkerReceiver[myid=" + self.getMyId() + "]");
             this.wrThread.setDaemon(true);
         }
 
@@ -663,7 +663,7 @@ public class FastLeaderElection implements Election {
             "About to leave FLE instance: leader={}, zxid=0x{}, my id={}, my state={}",
             v.getId(),
             Long.toHexString(v.getZxid()),
-            self.getId(),
+            self.getMyId(),
             self.getPeerState());
         recvqueue.clear();
     }
@@ -708,7 +708,7 @@ public class FastLeaderElection implements Election {
                 Long.toHexString(proposedZxid),
                 Long.toHexString(logicalclock.get()),
                 sid,
-                self.getId(),
+                self.getMyId(),
                 Long.toHexString(proposedEpoch));
 
             sendqueue.offer(notmsg);
@@ -800,7 +800,7 @@ public class FastLeaderElection implements Election {
          * from leader stating that it is leading, then predicate is false.
          */
 
-        if (leader != self.getId()) {
+        if (leader != self.getMyId()) {
             if (votes.get(leader) == null) {
                 predicate = false;
             } else if (votes.get(leader).getState() != ServerState.LEADING) {
@@ -839,10 +839,10 @@ public class FastLeaderElection implements Election {
      */
     private ServerState learningState() {
         if (self.getLearnerType() == LearnerType.PARTICIPANT) {
-            LOG.debug("I am a participant: {}", self.getId());
+            LOG.debug("I am a participant: {}", self.getMyId());
             return ServerState.FOLLOWING;
         } else {
-            LOG.debug("I am an observer: {}", self.getId());
+            LOG.debug("I am an observer: {}", self.getMyId());
             return ServerState.OBSERVING;
         }
     }
@@ -853,8 +853,8 @@ public class FastLeaderElection implements Election {
      * @return long
      */
     private long getInitId() {
-        if (self.getQuorumVerifier().getVotingMembers().containsKey(self.getId())) {
-            return self.getId();
+        if (self.getQuorumVerifier().getVotingMembers().containsKey(self.getMyId())) {
+            return self.getMyId();
         } else {
             return Long.MIN_VALUE;
         }
@@ -897,7 +897,7 @@ public class FastLeaderElection implements Election {
      * the leadingVoteSet if it becomes the leader.
      */
     private void setPeerState(long proposedLeader, SyncedLearnerTracker voteSet) {
-        ServerState ss = (proposedLeader == self.getId()) ? ServerState.LEADING : learningState();
+        ServerState ss = (proposedLeader == self.getMyId()) ? ServerState.LEADING : learningState();
         self.setPeerState(ss);
         if (ss == ServerState.LEADING) {
             leadingVoteSet = voteSet;
@@ -945,7 +945,7 @@ public class FastLeaderElection implements Election {
 
             LOG.info(
                 "New election. My id = {}, proposed zxid=0x{}",
-                self.getId(),
+                self.getMyId(),
                 Long.toHexString(proposedZxid));
             sendNotifications();
 
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java
index ce8f799..aebde05 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java
@@ -271,8 +271,8 @@ public class Leader extends LearnerMaster {
      */
     public boolean isQuorumSynced(QuorumVerifier qv) {
         HashSet<Long> ids = new HashSet<Long>();
-        if (qv.getVotingMembers().containsKey(self.getId())) {
-            ids.add(self.getId());
+        if (qv.getVotingMembers().containsKey(self.getMyId())) {
+            ids.add(self.getMyId());
         }
         synchronized (forwardingFollowers) {
             for (LearnerHandler learnerHandler : forwardingFollowers) {
@@ -603,7 +603,7 @@ public class Leader extends LearnerMaster {
             cnxAcceptor = new LearnerCnxAcceptor();
             cnxAcceptor.start();
 
-            long epoch = getEpochToPropose(self.getId(), self.getAcceptedEpoch());
+            long epoch = getEpochToPropose(self.getMyId(), self.getAcceptedEpoch());
 
             zk.setZxid(ZxidUtils.makeZxid(epoch, 0));
 
@@ -658,13 +658,13 @@ public class Leader extends LearnerMaster {
             // us. We do this by waiting for the NEWLEADER packet to get
             // acknowledged
 
-            waitForEpochAck(self.getId(), leaderStateSummary);
+            waitForEpochAck(self.getMyId(), leaderStateSummary);
             self.setCurrentEpoch(epoch);
-            self.setLeaderAddressAndId(self.getQuorumAddress(), self.getId());
+            self.setLeaderAddressAndId(self.getQuorumAddress(), self.getMyId());
             self.setZabState(QuorumPeer.ZabState.SYNCHRONIZATION);
 
             try {
-                waitForNewLeaderAck(self.getId(), zk.getZxid());
+                waitForNewLeaderAck(self.getMyId(), zk.getZxid());
             } catch (InterruptedException e) {
                 shutdown("Waiting for a quorum of followers, only synced with sids: [ "
                          + newLeaderProposal.ackSetsToString()
@@ -746,7 +746,7 @@ public class Leader extends LearnerMaster {
                         syncedAckSet.addQuorumVerifier(self.getLastSeenQuorumVerifier());
                     }
 
-                    syncedAckSet.addAck(self.getId());
+                    syncedAckSet.addAck(self.getMyId());
 
                     for (LearnerHandler f : getLearners()) {
                         if (f.synced()) {
@@ -870,15 +870,15 @@ public class Leader extends LearnerMaster {
 
         //check if I'm in the new configuration with the same quorum address -
         // if so, I'll remain the leader
-        if (newQVAcksetPair.getQuorumVerifier().getVotingMembers().containsKey(self.getId())
-            && newQVAcksetPair.getQuorumVerifier().getVotingMembers().get(self.getId()).addr.equals(self.getQuorumAddress())) {
-            return self.getId();
+        if (newQVAcksetPair.getQuorumVerifier().getVotingMembers().containsKey(self.getMyId())
+            && newQVAcksetPair.getQuorumVerifier().getVotingMembers().get(self.getMyId()).addr.equals(self.getQuorumAddress())) {
+            return self.getMyId();
         }
         // start with an initial set of candidates that are voters from new config that
         // acknowledged the reconfig op (there must be a quorum). Choose one of them as
         // current leader candidate
         HashSet<Long> candidates = new HashSet<Long>(newQVAcksetPair.getAckset());
-        candidates.remove(self.getId()); // if we're here, I shouldn't be the leader
+        candidates.remove(self.getMyId()); // if we're here, I shouldn't be the leader
         long curCandidate = candidates.iterator().next();
 
         //go over outstanding ops in order, and try to find a candidate that acked the most ops.
@@ -960,7 +960,7 @@ public class Leader extends LearnerMaster {
 
             self.processReconfig(newQV, designatedLeader, zk.getZxid(), true);
 
-            if (designatedLeader != self.getId()) {
+            if (designatedLeader != self.getMyId()) {
                 LOG.info(String.format("Committing a reconfiguration (reconfigEnabled=%s); this leader is not the designated "
                         + "leader anymore, setting allowedToCommit=false", self.isReconfigEnabled()));
                 allowedToCommit = false;
@@ -1424,13 +1424,13 @@ public class Leader extends LearnerMaster {
                 connectingFollowers.add(sid);
             }
             QuorumVerifier verifier = self.getQuorumVerifier();
-            if (connectingFollowers.contains(self.getId()) && verifier.containsQuorum(connectingFollowers)) {
+            if (connectingFollowers.contains(self.getMyId()) && verifier.containsQuorum(connectingFollowers)) {
                 waitingForNewEpoch = false;
                 self.setAcceptedEpoch(epoch);
                 connectingFollowers.notifyAll();
             } else {
                 long start = Time.currentElapsedTime();
-                if (sid == self.getId()) {
+                if (sid == self.getMyId()) {
                     timeStartWaitForEpoch = start;
                 }
                 long cur = start;
@@ -1476,7 +1476,7 @@ public class Leader extends LearnerMaster {
                 }
             }
             QuorumVerifier verifier = self.getQuorumVerifier();
-            if (electingFollowers.contains(self.getId()) && verifier.containsQuorum(electingFollowers)) {
+            if (electingFollowers.contains(self.getMyId()) && verifier.containsQuorum(electingFollowers)) {
                 electionFinished = true;
                 electingFollowers.notifyAll();
             } else {
@@ -1533,7 +1533,7 @@ public class Leader extends LearnerMaster {
             Long designatedLeader = getDesignatedLeader(newLeaderProposal, zk.getZxid());
 
             self.processReconfig(newQV, designatedLeader, zk.getZxid(), true);
-            if (designatedLeader != self.getId()) {
+            if (designatedLeader != self.getMyId()) {
                 LOG.warn("This leader is not the designated leader, it will be initialized with allowedToCommit = false");
                 allowedToCommit = false;
             }
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderZooKeeperServer.java
index 5a51bc2..2de080b 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderZooKeeperServer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderZooKeeperServer.java
@@ -175,7 +175,7 @@ public class LeaderZooKeeperServer extends QuorumZooKeeperServer {
             this,
             getZKDatabase().getSessionWithTimeOuts(),
             tickTime,
-            self.getId(),
+            self.getMyId(),
             self.areLocalSessionsEnabled(),
             getZooKeeperServerListener());
     }
@@ -291,7 +291,7 @@ public class LeaderZooKeeperServer extends QuorumZooKeeperServer {
      */
     @Override
     public long getServerId() {
-        return self.getId();
+        return self.getMyId();
     }
 
     @Override
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java
index 594c87f..44cbdf2 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java
@@ -495,7 +495,7 @@ public class Learner {
         /*
          * Add sid to payload
          */
-        LearnerInfo li = new LearnerInfo(self.getId(), 0x10000, self.getQuorumVerifier().getVersion());
+        LearnerInfo li = new LearnerInfo(self.getMyId(), 0x10000, self.getQuorumVerifier().getVersion());
         ByteArrayOutputStream bsid = new ByteArrayOutputStream();
         BinaryOutputArchive boa = BinaryOutputArchive.getArchive(bsid);
         boa.writeRecord(li, "LearnerInfo");
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerZooKeeperServer.java
index cab95b0..efd2e37 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerZooKeeperServer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerZooKeeperServer.java
@@ -71,7 +71,7 @@ public abstract class LearnerZooKeeperServer extends QuorumZooKeeperServer {
      */
     @Override
     public long getServerId() {
-        return self.getId();
+        return self.getMyId();
     }
 
     @Override
@@ -80,7 +80,7 @@ public abstract class LearnerZooKeeperServer extends QuorumZooKeeperServer {
             this,
             getZKDatabase().getSessionWithTimeOuts(),
             this.tickTime,
-            self.getId(),
+            self.getMyId(),
             self.areLocalSessionsEnabled(),
             getZooKeeperServerListener());
     }
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LocalPeerBean.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LocalPeerBean.java
index f5d0dbe..f1649ff 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LocalPeerBean.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LocalPeerBean.java
@@ -35,7 +35,7 @@ public class LocalPeerBean extends ServerBean implements LocalPeerMXBean {
     }
 
     public String getName() {
-        return "replica." + peer.getId();
+        return "replica." + peer.getMyId();
     }
 
     public boolean isHidden() {
@@ -119,12 +119,12 @@ public class LocalPeerBean extends ServerBean implements LocalPeerMXBean {
 
     @Override
     public boolean isPartOfEnsemble() {
-        return peer.getView().containsKey(peer.getId());
+        return peer.getView().containsKey(peer.getMyId());
     }
 
     @Override
     public boolean isLeader() {
-        return peer.isLeader(peer.getId());
+        return peer.isLeader(peer.getMyId());
     }
 
     @Override
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumBean.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumBean.java
index aae4552..46db686 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumBean.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumBean.java
@@ -28,7 +28,7 @@ public class QuorumBean implements QuorumMXBean, ZKMBeanInfo {
 
     public QuorumBean(QuorumPeer peer) {
         this.peer = peer;
-        name = "ReplicatedServer_id" + peer.getId();
+        name = "ReplicatedServer_id" + peer.getMyId();
     }
 
     @Override
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
index 9d9f8bd..eb5346a 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
@@ -466,7 +466,7 @@ public class QuorumCnxManager {
     private boolean startConnection(Socket sock, Long sid) throws IOException {
         DataOutputStream dout = null;
         DataInputStream din = null;
-        LOG.debug("startConnection (myId:{} --> sid:{})", self.getId(), sid);
+        LOG.debug("startConnection (myId:{} --> sid:{})", self.getMyId(), sid);
         try {
             // Use BufferedOutputStream to reduce the number of IP packets. This is
             // important for x-DC scenarios.
@@ -481,7 +481,7 @@ public class QuorumCnxManager {
             // understand the protocol version we use to avoid multiple partitions. see ZOOKEEPER-3720
             long protocolVersion = self.isMultiAddressEnabled() ? PROTOCOL_VERSION_V2 : PROTOCOL_VERSION_V1;
             dout.writeLong(protocolVersion);
-            dout.writeLong(self.getId());
+            dout.writeLong(self.getMyId());
 
             // now we send our election address. For the new protocol version, we can send multiple addresses.
             Collection<InetSocketAddress> addressesToSend = protocolVersion == PROTOCOL_VERSION_V2
@@ -510,12 +510,12 @@ public class QuorumCnxManager {
         }
 
         // If lost the challenge, then drop the new connection
-        if (sid > self.getId()) {
-            LOG.info("Have smaller server identifier, so dropping the connection: (myId:{} --> sid:{})", self.getId(), sid);
+        if (sid > self.getMyId()) {
+            LOG.info("Have smaller server identifier, so dropping the connection: (myId:{} --> sid:{})", self.getMyId(), sid);
             closeSocket(sock);
             // Otherwise proceed with the connection
         } else {
-            LOG.debug("Have larger server identifier, so keeping the connection: (myId:{} --> sid:{})", self.getId(), sid);
+            LOG.debug("Have larger server identifier, so keeping the connection: (myId:{} --> sid:{})", self.getMyId(), sid);
             SendWorker sw = new SendWorker(sock, sid);
             RecvWorker rw = new RecvWorker(sock, din, sid, sw);
             sw.setRecv(rw);
@@ -610,7 +610,7 @@ public class QuorumCnxManager {
                         electionAddr = new MultipleAddresses(init.electionAddr,
                                 Duration.ofMillis(self.getMultiAddressReachabilityCheckTimeoutMs()));
                     }
-                    LOG.debug("Initial message parsed by {}: {}", self.getId(), init.toString());
+                    LOG.debug("Initial message parsed by {}: {}", self.getMyId(), init.toString());
                 } catch (InitialMessage.InitialMessageException ex) {
                     LOG.error("Initial message parsing error!", ex);
                     closeSocket(sock);
@@ -635,7 +635,7 @@ public class QuorumCnxManager {
         // do authenticating learner
         authServer.authenticate(sock, din);
         //If wins the challenge, then close the new connection.
-        if (sid < self.getId()) {
+        if (sid < self.getMyId()) {
             /*
              * This replica might still believe that the connection to sid is
              * up, so we have to shut down the workers before trying to open a
@@ -658,7 +658,7 @@ public class QuorumCnxManager {
                 connectOne(sid);
             }
 
-        } else if (sid == self.getId()) {
+        } else if (sid == self.getMyId()) {
             // we saw this case in ZOOKEEPER-2164
             LOG.warn("We got a connection request from a server with our own ID. "
                      + "This should be either a configuration error, or a bug.");
@@ -760,7 +760,7 @@ public class QuorumCnxManager {
             Map<Long, QuorumPeer.QuorumServer> lastProposedView = lastSeenQV.getAllMembers();
             if (lastCommittedView.containsKey(sid)) {
                 knownId = true;
-                LOG.debug("Server {} knows {} already, it is in the lastCommittedView", self.getId(), sid);
+                LOG.debug("Server {} knows {} already, it is in the lastCommittedView", self.getMyId(), sid);
                 if (connectOne(sid, lastCommittedView.get(sid).electionAddr)) {
                     return;
                 }
@@ -770,7 +770,7 @@ public class QuorumCnxManager {
                 && (!knownId
                     || !lastProposedView.get(sid).electionAddr.equals(lastCommittedView.get(sid).electionAddr))) {
                 knownId = true;
-                LOG.debug("Server {} knows {} already, it is in the lastProposedView", self.getId(), sid);
+                LOG.debug("Server {} knows {} already, it is in the lastProposedView", self.getMyId(), sid);
 
                 if (connectOne(sid, lastProposedView.get(sid).electionAddr)) {
                     return;
@@ -839,7 +839,7 @@ public class QuorumCnxManager {
      */
     public void softHalt() {
         for (SendWorker sw : senderWorkerMap.values()) {
-            LOG.debug("Server {} is soft-halting sender towards: {}", self.getId(), sw);
+            LOG.debug("Server {} is soft-halting sender towards: {}", self.getMyId(), sw);
             sw.finish();
         }
     }
@@ -943,7 +943,7 @@ public class QuorumCnxManager {
         @Override
         public void run() {
             if (!shutdown) {
-                LOG.debug("Listener thread started, myId: {}", self.getId());
+                LOG.debug("Listener thread started, myId: {}", self.getMyId());
                 Set<InetSocketAddress> addresses;
 
                 if (self.getQuorumListenOnAllIPs()) {
@@ -1297,7 +1297,7 @@ public class QuorumCnxManager {
             }
             this.finish();
 
-            LOG.warn("Send worker leaving thread id {} my id = {}", sid, self.getId());
+            LOG.warn("Send worker leaving thread id {} my id = {}", sid, self.getMyId());
         }
 
 
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
index 18e97bb..404aaff 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
@@ -628,7 +628,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
     /**
      * get the id of this quorum peer.
      */
-    public long getId() {
+    public long getMyId() {
         return myid;
     }
 
@@ -990,7 +990,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
             QuorumServer qs = qv.getAllMembers().get(id);
             if (qs != null) {
                 qs.recreateSocketAddresses();
-                if (id == getId()) {
+                if (id == getMyId()) {
                     setAddrs(qs.addr, qs.electionAddr, qs.clientAddr);
                 }
             }
@@ -1418,7 +1418,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
             MBeanRegistry.getInstance().register(jmxQuorumBean, null);
             for (QuorumServer s : getView().values()) {
                 ZKMBeanInfo p;
-                if (getId() == s.id) {
+                if (getMyId() == s.id) {
                     p = jmxLocalPeerBean = new LocalPeerBean(this);
                     try {
                         MBeanRegistry.getInstance().register(p, jmxQuorumBean);
@@ -1586,7 +1586,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
             return;
         }
 
-        if (getId() == getCurrentVote().getId()) {
+        if (getMyId() == getCurrentVote().getId()) {
             setPeerState(ServerState.LEADING);
             LOG.debug("PeerState set to LEADING");
         } else if (getLearnerType() == LearnerType.PARTICIPANT) {
@@ -1880,7 +1880,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
         if (quorumVerifier != null && lastSeenQuorumVerifier != null) {
             Map<Long, QuorumServer> committedView = quorumVerifier.getAllMembers();
             for (Entry<Long, QuorumServer> e : lastSeenQuorumVerifier.getAllMembers().entrySet()) {
-                if (e.getKey() != getId() && !committedView.containsKey(e.getKey())) {
+                if (e.getKey() != getMyId() && !committedView.containsKey(e.getKey())) {
                     qcm.connectOne(e.getKey());
                 }
             }
@@ -1941,7 +1941,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
                 // and then got the same config in UPTODATE message so its already known
                 LOG.debug(
                     "{} setQuorumVerifier called with known or old config {}. Current version: {}",
-                    getId(),
+                    getMyId(),
                     qv.getVersion(),
                     quorumVerifier.getVersion());
                 return quorumVerifier;
@@ -1970,7 +1970,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
             if (qv.getVersion() == lastSeenQuorumVerifier.getVersion()) {
                 QuorumPeerConfig.deleteFile(getNextDynamicConfigFilename());
             }
-            QuorumServer qs = qv.getAllMembers().get(getId());
+            QuorumServer qs = qv.getAllMembers().get(getMyId());
             if (qs != null) {
                 setAddrs(qs.addr, qs.electionAddr, qs.clientAddr);
             }
@@ -1984,7 +1984,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
     }
 
     private boolean needEraseClientInfoFromStaticConfig() {
-        QuorumServer server = quorumVerifier.getAllMembers().get(getId());
+        QuorumServer server = quorumVerifier.getAllMembers().get(getMyId());
         return (server != null && server.clientAddr != null && !server.isClientAddrFromStatic);
     }
 
@@ -2268,7 +2268,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
                 restartLeaderElection(prevQV, qv);
             }
 
-            QuorumServer myNewQS = newMembers.get(getId());
+            QuorumServer myNewQS = newMembers.get(getMyId());
             if (myNewQS != null && myNewQS.clientAddr != null && !myNewQS.clientAddr.equals(oldClientAddr)) {
                 cnxnFactory.reconfigure(myNewQS.clientAddr);
                 updateThreadName();
@@ -2308,7 +2308,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
 
         Set<Long> joiningMembers = new HashSet<Long>(newMembers.keySet());
         joiningMembers.removeAll(jmxRemotePeerBean.keySet());
-        joiningMembers.remove(getId()); // remove self as it is local bean
+        joiningMembers.remove(getMyId()); // remove self as it is local bean
         for (Long id : joiningMembers) {
             QuorumServer qs = newMembers.get(id);
             RemotePeerBean rBean = new RemotePeerBean(this, qs);
@@ -2421,7 +2421,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
 
     private boolean updateLearnerType(QuorumVerifier newQV) {
         //check if I'm an observer in new config
-        if (newQV.getObservingMembers().containsKey(getId())) {
+        if (newQV.getObservingMembers().containsKey(getMyId())) {
             if (getLearnerType() != LearnerType.OBSERVER) {
                 setLearnerType(LearnerType.OBSERVER);
                 LOG.info("Becoming an observer");
@@ -2430,7 +2430,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
             } else {
                 return false;
             }
-        } else if (newQV.getVotingMembers().containsKey(getId())) {
+        } else if (newQV.getVotingMembers().containsKey(getMyId())) {
             if (getLearnerType() != LearnerType.PARTICIPANT) {
                 setLearnerType(LearnerType.PARTICIPANT);
                 LOG.info("Becoming a voting participant");
@@ -2514,7 +2514,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
                     : "disabled"
                 : "disabled";
         String secure = secureCnxnFactory != null ? formatInetAddr(secureCnxnFactory.getLocalAddress()) : "disabled";
-        setName(String.format("QuorumPeer[myid=%d](plain=%s)(secure=%s)", getId(), plain, secure));
+        setName(String.format("QuorumPeer[myid=%d](plain=%s)(secure=%s)", getMyId(), plain, secure));
     }
 
     /**
@@ -2591,7 +2591,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
         LOG.info("Using {}ms as the quorum cnxn socket timeout", timeout);
         return new QuorumCnxManager(
             this,
-            this.getId(),
+            this.getMyId(),
             this.getView(),
             this.authServer,
             this.authLearner,
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java
index d2f6b39..0efa467 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java
@@ -88,7 +88,7 @@ public class ReadOnlyZooKeeperServer extends ZooKeeperServer {
     public void createSessionTracker() {
         sessionTracker = new LearnerSessionTracker(
                 this, getZKDatabase().getSessionWithTimeOuts(),
-                this.tickTime, self.getId(), self.areLocalSessionsEnabled(),
+                this.tickTime, self.getMyId(), self.areLocalSessionsEnabled(),
                 getZooKeeperServerListener());
     }
 
@@ -186,7 +186,7 @@ public class ReadOnlyZooKeeperServer extends ZooKeeperServer {
      */
     @Override
     public long getServerId() {
-        return self.getId();
+        return self.getMyId();
     }
 
     @Override
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/util/ServiceUtils.java b/zookeeper-server/src/main/java/org/apache/zookeeper/util/ServiceUtils.java
index 544e13d..944bbc0 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/util/ServiceUtils.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/util/ServiceUtils.java
@@ -39,7 +39,14 @@ public abstract class ServiceUtils {
      */
     @SuppressFBWarnings("DM_EXIT")
     public static final Consumer<Integer> SYSTEM_EXIT = (code) -> {
-        LOG.error("Exiting JVM with code {}", code);
+        String msg = "Exiting JVM with code {}";
+        if (code == 0) {
+            // JVM exits normally
+            LOG.info(msg, code);
+        } else {
+            // JVM exits with error
+            LOG.error(msg, code);
+        }
         System.exit(code);
     };
 
@@ -47,8 +54,12 @@ public abstract class ServiceUtils {
      * No-op strategy, useful for tests.
      */
     public static final Consumer<Integer> LOG_ONLY = (code) -> {
-        LOG.error("Fatal error, JVM should exit with code {}. "
+        if (code != 0) {
+            LOG.error("Fatal error, JVM should exit with code {}. "
                 + "Actually System.exit is disabled", code);
+        } else {
+            LOG.info("JVM should exit with code {}. Actually System.exit is disabled", code);
+        }
     };
 
     private static volatile Consumer<Integer> systemExitProcedure = SYSTEM_EXIT;
diff --git a/zookeeper-server/src/main/resources/NOTICE.txt b/zookeeper-server/src/main/resources/NOTICE.txt
index efdd6b4..0360160 100644
--- a/zookeeper-server/src/main/resources/NOTICE.txt
+++ b/zookeeper-server/src/main/resources/NOTICE.txt
@@ -11,10 +11,10 @@ for Airlift code can be found at:
 https://github.com/airlift/airlift/blob/master/LICENSE
 
 This product includes software developed by
-The Netty Project (http://netty.io/)
-Copyright 2011 The Netty Project
-
-The Netty NOTICE file contains the following items:
+The Netty Project (http://netty.io/) Copyright 2011 The Netty Project
+The Netty NOTICE file (https://github.com/netty/netty/blob/4.1/NOTICE.txt)
+contains the following items:
+---------------- start of netty NOTICE file ----------------
 This product contains the extensions to Java Collections Framework which has
 been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
 
@@ -32,29 +32,112 @@ Base64 Encoder and Decoder, which can be obtained at:
   * HOMEPAGE:
     * http://iharder.sourceforge.net/current/java/base64/
 
-This product contains a modified version of 'JZlib', a re-implementation of
-zlib in pure Java, which can be obtained at:
+This product contains a modified portion of 'Webbit', an event based
+WebSocket and HTTP server, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.webbit.txt (BSD License)
+  * HOMEPAGE:
+    * https://github.com/joewalnes/webbit
+
+This product contains a modified portion of 'SLF4J', a simple logging
+facade for Java, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.slf4j.txt (MIT License)
+  * HOMEPAGE:
+    * https://www.slf4j.org/
+
+This product contains a modified portion of 'Apache Harmony', an open source
+Java SE, which can be obtained at:
 
+  * NOTICE:
+    * license/NOTICE.harmony.txt
   * LICENSE:
-    * license/LICENSE.jzlib.txt (BSD Style License)
+    * license/LICENSE.harmony.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://archive.apache.org/dist/harmony/
+
+This product contains a modified portion of 'jbzip2', a Java bzip2 compression
+and decompression library written by Matthew J. Francis. It can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.jbzip2.txt (MIT License)
+  * HOMEPAGE:
+    * https://code.google.com/p/jbzip2/
+
+This product contains a modified portion of 'libdivsufsort', a C API library to construct
+the suffix array and the Burrows-Wheeler transformed string for any input string of
+a constant-size alphabet written by Yuta Mori. It can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.libdivsufsort.txt (MIT License)
+  * HOMEPAGE:
+    * https://github.com/y-256/libdivsufsort
+
+This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM,
+ which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.jctools.txt (ASL2 License)
+  * HOMEPAGE:
+    * https://github.com/JCTools/JCTools
+
+This product optionally depends on 'JZlib', a re-implementation of zlib in
+pure Java, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.jzlib.txt (BSD style License)
   * HOMEPAGE:
     * http://www.jcraft.com/jzlib/
 
-This product contains a modified version of 'Webbit', a Java event based
-WebSocket and HTTP server:
+This product optionally depends on 'Compress-LZF', a Java library for encoding and
+decoding data in LZF format, written by Tatu Saloranta. It can be obtained at:
 
   * LICENSE:
-    * license/LICENSE.webbit.txt (BSD License)
+    * license/LICENSE.compress-lzf.txt (Apache License 2.0)
   * HOMEPAGE:
-    * https://github.com/joewalnes/webbit
+    * https://github.com/ning/compress
+
+This product optionally depends on 'lz4', a LZ4 Java compression
+and decompression library written by Adrien Grand. It can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.lz4.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/jpountz/lz4-java
+
+This product optionally depends on 'lzma-java', a LZMA Java compression
+and decompression library, which can be obtained at:
 
-This product optionally depends on 'Protocol Buffers', Google's data
+  * LICENSE:
+    * license/LICENSE.lzma-java.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/jponge/lzma-java
+
+This product optionally depends on 'zstd-jni', a zstd-jni Java compression
+and decompression library, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.zstd-jni.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/luben/zstd-jni
+
+This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression
+and decompression library written by William Kinney. It can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.jfastlz.txt (MIT License)
+  * HOMEPAGE:
+    * https://code.google.com/p/jfastlz/
+
+This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data
 interchange format, which can be obtained at:
 
   * LICENSE:
     * license/LICENSE.protobuf.txt (New BSD License)
   * HOMEPAGE:
-    * http://code.google.com/p/protobuf/
+    * https://github.com/google/protobuf
 
 This product optionally depends on 'Bouncy Castle Crypto APIs' to generate
 a temporary self-signed X.509 certificate when the JVM does not provide the
@@ -63,15 +146,31 @@ equivalent functionality.  It can be obtained at:
   * LICENSE:
     * license/LICENSE.bouncycastle.txt (MIT License)
   * HOMEPAGE:
-    * http://www.bouncycastle.org/
+    * https://www.bouncycastle.org/
 
-This product optionally depends on 'SLF4J', a simple logging facade for Java,
-which can be obtained at:
+This product optionally depends on 'Snappy', a compression library produced
+by Google Inc, which can be obtained at:
 
   * LICENSE:
-    * license/LICENSE.slf4j.txt (MIT License)
+    * license/LICENSE.snappy.txt (New BSD License)
   * HOMEPAGE:
-    * http://www.slf4j.org/
+    * https://github.com/google/snappy
+
+This product optionally depends on 'JBoss Marshalling', an alternative Java
+serialization API, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.jboss-marshalling.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/jboss-remoting/jboss-marshalling
+
+This product optionally depends on 'Caliper', Google's micro-
+benchmarking framework, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.caliper.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/google/caliper
 
 This product optionally depends on 'Apache Commons Logging', a logging
 framework, which can be obtained at:
@@ -79,61 +178,79 @@ framework, which can be obtained at:
   * LICENSE:
     * license/LICENSE.commons-logging.txt (Apache License 2.0)
   * HOMEPAGE:
-    * http://commons.apache.org/logging/
+    * https://commons.apache.org/logging/
 
-This product optionally depends on 'Apache Logback', a logging framework,
-which can be obtained at:
+This product optionally depends on 'Apache Log4J', a logging framework, which
+can be obtained at:
 
   * LICENSE:
-    * license/LICENSE.logback.txt (Eclipse Public License 1.0)
+    * license/LICENSE.log4j.txt (Apache License 2.0)
   * HOMEPAGE:
-    * https://logback.qos.ch/
+    * https://logging.apache.org/log4j/
 
-This product optionally depends on 'JBoss Logging', a logging framework,
-which can be obtained at:
+This product optionally depends on 'Aalto XML', an ultra-high performance
+non-blocking XML processor, which can be obtained at:
 
   * LICENSE:
-    * license/LICENSE.jboss-logging.txt (GNU LGPL 2.1)
+    * license/LICENSE.aalto-xml.txt (Apache License 2.0)
   * HOMEPAGE:
-    * http://anonsvn.jboss.org/repos/common/common-logging-spi/
+    * https://wiki.fasterxml.com/AaltoHome
 
-This product optionally depends on 'Apache Felix', an open source OSGi
-framework implementation, which can be obtained at:
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at:
 
   * LICENSE:
-    * license/LICENSE.felix.txt (Apache License 2.0)
+    * license/LICENSE.hpack.txt (Apache License 2.0)
   * HOMEPAGE:
-    * http://felix.apache.org/
+    * https://github.com/twitter/hpack
 
-The bundled library Metrics Core NOTICE file reports the following items
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at:
 
-Metrics
-Copyright 2010-2013 Coda Hale and Yammer, Inc.
+  * LICENSE:
+    * license/LICENSE.hyper-hpack.txt (MIT License)
+  * HOMEPAGE:
+    * https://github.com/python-hyper/hpack/
 
-This product includes software developed by Coda Hale and Yammer, Inc.
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at:
 
-This product includes code derived from the JSR-166 project (ThreadLocalRandom, Striped64,
-LongAdder), which was released with the following comments:
+  * LICENSE:
+    * license/LICENSE.nghttp2-hpack.txt (MIT License)
+  * HOMEPAGE:
+    * https://github.com/nghttp2/nghttp2/
 
-    Written by Doug Lea with assistance from members of JCP JSR-166
-    Expert Group and released to the public domain, as explained at
-    http://creativecommons.org/publicdomain/zero/1.0/
+This product contains a modified portion of 'Apache Commons Lang', a Java library
+provides utilities for the java.lang API, which can be obtained at:
 
-The Nappy Java NOTICE file reports the following items:
+  * LICENSE:
+    * license/LICENSE.commons-lang.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://commons.apache.org/proper/commons-lang/
 
-This product includes software developed by Google
- Snappy: http://code.google.com/p/snappy/ (New BSD License)
 
-This product includes software developed by Apache
- PureJavaCrc32C from apache-hadoop-common http://hadoop.apache.org/
- (Apache 2.0 license)
+This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build.
 
-This library containd statically linked libstdc++. This inclusion is allowed by
-"GCC RUntime Library Exception"
-http://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html
+  * LICENSE:
+    * license/LICENSE.mvn-wrapper.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/takari/maven-wrapper
+
+This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS.
+This private header is also used by Apple's open source
+ mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/).
+
+ * LICENSE:
+    * license/LICENSE.dnsinfo.txt (Apple Public Source License 2.0)
+  * HOMEPAGE:
+    * https://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h
+
+This product optionally depends on 'Brotli4j', Brotli compression and
+decompression for Java., which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.brotli4j.txt (Apache License 2.0)
+  * HOMEPAGE:
+    * https://github.com/hyperxpro/Brotli4j
 
-== Contributors ==
-  * Tatu Saloranta
-    * Providing benchmark suite
-  * Alec Wysoker
-    * Performance and memory usage improvement
+---------------- end of netty NOTICE file ----------------
\ No newline at end of file
diff --git a/zookeeper-server/src/main/resources/lib/commons-io-2.7.LICENSE.txt b/zookeeper-server/src/main/resources/lib/commons-cli-1.5.0.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/commons-io-2.7.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/commons-cli-1.5.0.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-transport-native-unix-common-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/commons-io-2.11.0.LICENSE.txt
similarity index 99%
rename from zookeeper-server/src/main/resources/lib/netty-transport-native-unix-common-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/commons-io-2.11.0.LICENSE.txt
index 6279e52..6b0b127 100644
--- a/zookeeper-server/src/main/resources/lib/netty-transport-native-unix-common-4.1.73.Final.LICENSE.txt
+++ b/zookeeper-server/src/main/resources/lib/commons-io-2.11.0.LICENSE.txt
@@ -187,7 +187,7 @@
       same "printed page" as the copyright notice for easier
       identification within third-party archives.
 
-   Copyright 1999-2005 The Apache Software Foundation
+   Copyright [yyyy] [name of copyright owner]
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -200,3 +200,4 @@
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
+
diff --git a/zookeeper-server/src/main/resources/lib/jetty-http-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-http-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-http-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-http-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-io-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-io-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-io-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-io-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-security-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-security-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-security-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-security-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-server-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-server-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-server-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-server-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-servlet-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-servlet-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-servlet-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-servlet-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-util-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-util-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-util-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-util-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/jetty-util-ajax-9.4.43.v20210629.LICENSE.txt b/zookeeper-server/src/main/resources/lib/jetty-util-ajax-9.4.49.v20220914.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/jetty-util-ajax-9.4.43.v20210629.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/jetty-util-ajax-9.4.49.v20220914.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-buffer-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-buffer-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-buffer-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-buffer-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-codec-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-codec-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-codec-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-codec-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-common-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-common-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-common-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-common-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-handler-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-handler-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-handler-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-handler-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-resolver-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-resolver-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-resolver-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-resolver-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-tcnative-classes-2.0.48.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-transport-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-tcnative-classes-2.0.48.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-transport-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-transport-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-transport-native-epoll-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-transport-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-transport-native-epoll-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/main/resources/lib/netty-transport-native-epoll-4.1.73.Final.LICENSE.txt b/zookeeper-server/src/main/resources/lib/netty-transport-native-unix-common-4.1.86.Final.LICENSE.txt
similarity index 100%
rename from zookeeper-server/src/main/resources/lib/netty-transport-native-epoll-4.1.73.Final.LICENSE.txt
rename to zookeeper-server/src/main/resources/lib/netty-transport-native-unix-common-4.1.86.Final.LICENSE.txt
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/KerberosTicketRenewalTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/KerberosTicketRenewalTest.java
new file mode 100644
index 0000000..84b2140
--- /dev/null
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/KerberosTicketRenewalTest.java
@@ -0,0 +1,278 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.zookeeper;
+
+import static org.apache.zookeeper.server.quorum.auth.MiniKdc.MAX_TICKET_LIFETIME;
+import static org.apache.zookeeper.server.quorum.auth.MiniKdc.MIN_TICKET_LIFETIME;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTimeout;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.security.Principal;
+import java.time.Duration;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Supplier;
+import javax.security.auth.login.Configuration;
+import javax.security.auth.login.LoginException;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.zookeeper.common.ZKConfig;
+import org.apache.zookeeper.server.quorum.auth.KerberosTestUtils;
+import org.apache.zookeeper.server.quorum.auth.MiniKdc;
+import org.apache.zookeeper.test.ClientBase;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This test class is mainly testing the TGT renewal logic implemented
+ * in the org.apache.zookeeper.Login class.
+ */
+public class KerberosTicketRenewalTest {
+
+
+  private static final Logger LOG = LoggerFactory.getLogger(KerberosTicketRenewalTest.class);
+  private static final String JAAS_CONFIG_SECTION = "ClientUsingKerberos";
+  private static final String TICKET_LIFETIME = "5000";
+  private static File testTempDir;
+  private static MiniKdc kdc;
+  private static File kdcWorkDir;
+  private static String PRINCIPAL = KerberosTestUtils.getClientPrincipal();
+
+  TestableKerberosLogin login;
+
+  @BeforeAll
+  public static void setupClass() throws Exception {
+    // by default, we should wait at least 1 minute between subsequent TGT renewals.
+    // changing it to 500ms.
+    System.setProperty(Login.MIN_TIME_BEFORE_RELOGIN_CONFIG_KEY, "500");
+
+    testTempDir = ClientBase.createTmpDir();
+    startMiniKdcAndAddPrincipal();
+
+    String keytabFilePath = FilenameUtils.normalize(KerberosTestUtils.getKeytabFile(), true);
+
+    // note: we use "refreshKrb5Config=true" to refresh the kerberos config in the JVM,
+    // making sure that we use the latest config even if other tests already have been executed
+    // and initialized the kerberos client configs before)
+    String jaasEntries = ""
+      + "ClientUsingKerberos {\n"
+      + "  com.sun.security.auth.module.Krb5LoginModule required\n"
+      + "  storeKey=\"false\"\n"
+      + "  useTicketCache=\"false\"\n"
+      + "  useKeyTab=\"true\"\n"
+      + "  doNotPrompt=\"true\"\n"
+      + "  debug=\"true\"\n"
+      + "  refreshKrb5Config=\"true\"\n"
+      + "  keyTab=\"" + keytabFilePath + "\"\n"
+      + "  principal=\"" + PRINCIPAL + "\";\n"
+      + "};\n";
+    setupJaasConfig(jaasEntries);
+  }
+
+  @AfterAll
+  public static void tearDownClass() {
+    System.clearProperty(Login.MIN_TIME_BEFORE_RELOGIN_CONFIG_KEY);
+    System.clearProperty("java.security.auth.login.config");
+    stopMiniKdc();
+    if (testTempDir != null) {
+      // the testTempDir contains the jaas config file and also the
+      // working folder of the currently running KDC server
+      FileUtils.deleteQuietly(testTempDir);
+    }
+  }
+
+  @AfterEach
+  public void tearDownTest() throws Exception {
+    if (login != null) {
+      login.shutdown();
+      login.logout();
+    }
+  }
+
+
+  /**
+   * We extend the regular Login class to be able to properly control the
+   * "sleeping" between the retry attempts of ticket refresh actions.
+   */
+  private static class TestableKerberosLogin extends Login {
+
+    private AtomicBoolean refreshFailed = new AtomicBoolean(false);
+    private CountDownLatch continueRefreshThread = new CountDownLatch(1);
+
+    public TestableKerberosLogin() throws LoginException {
+      super(JAAS_CONFIG_SECTION, (callbacks) -> {}, new ZKConfig());
+    }
+
+    @Override
+    protected void sleepBeforeRetryFailedRefresh() throws InterruptedException {
+      LOG.info("sleep started due to failed refresh");
+      refreshFailed.set(true);
+      continueRefreshThread.await(20, TimeUnit.SECONDS);
+      LOG.info("sleep due to failed refresh finished");
+    }
+
+    public void assertRefreshFailsEventually(Duration timeout) {
+      assertEventually(timeout, () -> refreshFailed.get());
+    }
+
+    public void continueWithRetryAfterFailedRefresh() {
+      LOG.info("continue refresh thread");
+      continueRefreshThread.countDown();
+    }
+  }
+
+
+  @Test
+  public void shouldLoginUsingKerberos() throws Exception {
+    login = new TestableKerberosLogin();
+    login.startThreadIfNeeded();
+
+    assertPrincipalLoggedIn();
+  }
+
+
+  @Test
+  public void shouldRenewTicketUsingKerberos() throws Exception {
+    login = new TestableKerberosLogin();
+    login.startThreadIfNeeded();
+
+    long initialLoginTime = login.getLastLogin();
+
+    // ticket lifetime is 5sec, so we will trigger ticket renewal in each ~2-3 sec
+    assertTicketRefreshHappenedUntil(Duration.ofSeconds(15));
+
+    assertPrincipalLoggedIn();
+    assertTrue(initialLoginTime < login.getLastLogin());
+  }
+
+
+  @Test
+  public void shouldRecoverIfKerberosNotAvailableForSomeTime() throws Exception {
+    login = new TestableKerberosLogin();
+    login.startThreadIfNeeded();
+
+    assertTicketRefreshHappenedUntil(Duration.ofSeconds(15));
+
+    stopMiniKdc();
+
+    // ticket lifetime is 5sec, so we will trigger ticket renewal in each ~2-3 sec
+    // the very next ticket renewal should fail (as KDC is offline)
+    login.assertRefreshFailsEventually(Duration.ofSeconds(15));
+
+    // now the ticket thread is "sleeping", it will retry the refresh later
+
+    // we restart KDC, then terminate the "sleeping" and expecting
+    // that the next retry should succeed
+    startMiniKdcAndAddPrincipal();
+    login.continueWithRetryAfterFailedRefresh();
+    assertTicketRefreshHappenedUntil(Duration.ofSeconds(15));
+
+    assertPrincipalLoggedIn();
+  }
+
+
+  private void assertPrincipalLoggedIn() {
+    assertEquals(PRINCIPAL, login.getUserName());
+    assertNotNull(login.getSubject());
+    assertEquals(1, login.getSubject().getPrincipals().size());
+    Principal actualPrincipal = login.getSubject().getPrincipals().iterator().next();
+    assertEquals(PRINCIPAL, actualPrincipal.getName());
+  }
+
+  private void assertTicketRefreshHappenedUntil(Duration timeout) {
+    long lastLoginTime = login.getLastLogin();
+    assertEventually(timeout, () -> login.getLastLogin() != lastLoginTime
+      && login.getSubject() != null && !login.getSubject().getPrincipals().isEmpty());
+  }
+
+  private static void assertEventually(Duration timeout, Supplier<Boolean> test) {
+    assertTimeout(timeout, () -> {
+      while (true) {
+        if (test.get()) {
+          return;
+        }
+        Thread.sleep(100);
+      }
+    });
+  }
+
+  public static void startMiniKdcAndAddPrincipal() throws Exception {
+    kdcWorkDir = createTmpDirInside(testTempDir);
+
+    Properties conf = MiniKdc.createConf();
+    conf.setProperty(MAX_TICKET_LIFETIME, TICKET_LIFETIME);
+    conf.setProperty(MIN_TICKET_LIFETIME, TICKET_LIFETIME);
+
+    kdc = new MiniKdc(conf, kdcWorkDir);
+    kdc.start();
+
+    String principalName = PRINCIPAL.substring(0, PRINCIPAL.lastIndexOf("@"));
+    kdc.createPrincipal(new File(KerberosTestUtils.getKeytabFile()), principalName);
+  }
+
+  private static void stopMiniKdc() {
+    if (kdc != null) {
+      kdc.stop();
+      kdc = null;
+    }
+    if (kdcWorkDir != null) {
+      FileUtils.deleteQuietly(kdcWorkDir);
+      kdcWorkDir = null;
+    }
+  }
+
+  private static File createTmpDirInside(File parentDir) throws IOException {
+    File tmpFile = File.createTempFile("test", ".junit", parentDir);
+    // don't delete tmpFile - this ensures we don't attempt to create
+    // a tmpDir with a duplicate name
+    File tmpDir = new File(tmpFile + ".dir");
+    // never true if tmpfile does it's job
+    assertFalse(tmpDir.exists());
+    assertTrue(tmpDir.mkdirs());
+    return tmpDir;
+  }
+
+  private static void setupJaasConfig(String jaasEntries) {
+    try {
+      File saslConfFile = new File(testTempDir, "jaas.conf");
+      FileWriter fwriter = new FileWriter(saslConfFile);
+      fwriter.write(jaasEntries);
+      fwriter.close();
+      System.setProperty("java.security.auth.login.config", saslConfFile.getAbsolutePath());
+    } catch (IOException ioe) {
+      LOG.error("Failed to initialize JAAS conf file", ioe);
+    }
+
+    // refresh the SASL configuration in this JVM (making sure that we use the latest config
+    // even if other tests already have been executed and initialized the SASL configs before)
+    Configuration.getConfiguration().refresh();
+  }
+
+}
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java b/zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java
index 21343c1..eb8fcbf 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java
@@ -21,7 +21,7 @@ package org.apache.zookeeper;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 import java.io.File;
-import java.time.LocalDateTime;
+import java.time.Instant;
 import org.apache.zookeeper.util.ServiceUtils;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeAll;
@@ -100,8 +100,8 @@ public class ZKTestCase {
      * @throws InterruptedException
      */
     public void waitFor(String msg, WaitForCondition condition, int timeout) throws InterruptedException {
-        final LocalDateTime deadline = LocalDateTime.now().plusSeconds(timeout);
-        while (LocalDateTime.now().isBefore(deadline)) {
+        final Instant deadline = Instant.now().plusSeconds(timeout);
+        while (Instant.now().isBefore(deadline)) {
             if (condition.evaluate()) {
                 return;
             }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/ZKUtilTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/ZKUtilTest.java
index 51df907..a73ff2f 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/ZKUtilTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/ZKUtilTest.java
@@ -25,10 +25,12 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
+import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.test.ClientBase;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
@@ -119,4 +121,52 @@ public class ZKUtilTest extends ClientBase {
         assertEquals(1, bList.size());
         assertIterableEquals(Collections.singletonList("/a/b"), bList);
     }
+
+    @Test
+    public void testDeleteRecursiveInAsyncMode() throws Exception {
+        int batchSize = 10;
+        testDeleteRecursiveInSyncAsyncMode(batchSize);
+    }
+
+    @Test
+    public void testDeleteRecursiveInSyncMode() throws Exception {
+        int batchSize = 0;
+        testDeleteRecursiveInSyncAsyncMode(batchSize);
+    }
+
+    // batchSize>0 is async mode otherwise it is sync mode
+    private void testDeleteRecursiveInSyncAsyncMode(int batchSize)
+        throws IOException, InterruptedException, KeeperException {
+        TestableZooKeeper zk = createClient();
+        String parentPath = "/a";
+        zk.create(parentPath, "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+        int numberOfNodes = 50;
+        List<Op> ops = new ArrayList<>();
+        for (int i = 0; i < numberOfNodes; i++) {
+            ops.add(Op.create(parentPath + "/a" + i, "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+                CreateMode.PERSISTENT));
+        }
+        zk.multi(ops);
+        ops.clear();
+
+        // check nodes create successfully
+        List<String> children = zk.getChildren(parentPath, false);
+        assertEquals(numberOfNodes, children.size());
+
+        // create one more level of z nodes
+        String subNode = "/a/a0";
+        for (int i = 0; i < numberOfNodes; i++) {
+            ops.add(Op.create(subNode + "/b" + i, "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+                CreateMode.PERSISTENT));
+        }
+        zk.multi(ops);
+
+        // check sub nodes created successfully
+        children = zk.getChildren(subNode, false);
+        assertEquals(numberOfNodes, children.size());
+
+        ZKUtil.deleteRecursive(zk, parentPath, batchSize);
+        Stat exists = zk.exists(parentPath, false);
+        assertNull(exists, "ZKUtil.deleteRecursive() could not delete all the z nodes");
+    }
 }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
index 45d5c67..ac734d2 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java
@@ -57,8 +57,8 @@ public class ConnectionMetricsTest extends ZKTestCase {
         util.enableLocalSession(false);
         util.startAll();
 
-        int follower1 = (int) util.getFollowerQuorumPeers().get(0).getId();
-        int follower2 = (int) util.getFollowerQuorumPeers().get(1).getId();
+        int follower1 = (int) util.getFollowerQuorumPeers().get(0).getMyId();
+        int follower2 = (int) util.getFollowerQuorumPeers().get(1).getMyId();
         LOG.info("connecting to server: {}", follower1);
         ClientBase.CountdownWatcher watcher = new ClientBase.CountdownWatcher();
         // create a connection to follower
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorTest.java
index 9e71205..e5c2940 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/PrepRequestProcessorTest.java
@@ -195,7 +195,7 @@ public class PrepRequestProcessorTest extends ClientBase {
 
         QuorumPeer qp = new QuorumPeer();
         QuorumVerifier quorumVerifierMock = mock(QuorumVerifier.class);
-        when(quorumVerifierMock.getAllMembers()).thenReturn(LeaderBeanTest.getMockedPeerViews(qp.getId()));
+        when(quorumVerifierMock.getAllMembers()).thenReturn(LeaderBeanTest.getMockedPeerViews(qp.getMyId()));
 
         qp.setQuorumVerifier(quorumVerifierMock, false);
         FileTxnSnapLog snapLog = new FileTxnSnapLog(tmpDir, tmpDir);
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
index 62d371d..1525920 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/RequestThrottlerTest.java
@@ -67,11 +67,17 @@ public class RequestThrottlerTest extends ZKTestCase {
 
     CountDownLatch disconnected = null;
 
+    CountDownLatch throttled = null;
+    CountDownLatch throttling = null;
+
     ZooKeeperServer zks = null;
     ServerCnxnFactory f = null;
     ZooKeeper zk = null;
     int connectionLossCount = 0;
 
+    private long getCounterMetric(String name) {
+        return (long) MetricsUtils.currentServerMetrics().get(name);
+    }
 
     @BeforeEach
     public void setup() throws Exception {
@@ -115,6 +121,11 @@ public class RequestThrottlerTest extends ZKTestCase {
             super(snapDir, logDir, tickTime);
         }
 
+        @Override
+        protected RequestThrottler createRequestThrottler() {
+            return new TestRequestThrottler(this);
+        }
+
         @Override
         protected void setupRequestProcessors() {
             RequestProcessor finalProcessor = new FinalRequestProcessor(this);
@@ -141,6 +152,24 @@ public class RequestThrottlerTest extends ZKTestCase {
         }
     }
 
+    class TestRequestThrottler extends RequestThrottler {
+        public TestRequestThrottler(ZooKeeperServer zks) {
+            super(zks);
+        }
+
+        @Override
+        synchronized void throttleSleep(int stallTime) throws InterruptedException {
+            if (throttling != null) {
+                throttling.countDown();
+            }
+            super.throttleSleep(stallTime);
+            // Defend against unstable timing and potential spurious wakeup.
+            if (throttled != null) {
+                assertTrue(throttled.await(20, TimeUnit.SECONDS));
+            }
+        }
+    }
+
     class TestPrepRequestProcessor extends PrepRequestProcessor {
 
         public TestPrepRequestProcessor(ZooKeeperServer zks, RequestProcessor syncProcessor) {
@@ -191,18 +220,22 @@ public class RequestThrottlerTest extends ZKTestCase {
 
         // make sure the server received all 5 requests
         submitted.await(5, TimeUnit.SECONDS);
-        Map<String, Object> metrics = MetricsUtils.currentServerMetrics();
 
         // but only two requests can get into the pipeline because of the throttler
-        assertEquals(2L, (long) metrics.get("prep_processor_request_queued"));
-        assertEquals(1L, (long) metrics.get("request_throttle_wait_count"));
+        WaitForCondition requestQueued = () -> getCounterMetric("prep_processor_request_queued") == 2;
+        waitFor("request not queued", requestQueued, 5);
+
+        WaitForCondition throttleWait = () -> getCounterMetric("request_throttle_wait_count") >= 1;
+        waitFor("no throttle wait", throttleWait, 5);
 
         // let the requests go through the pipeline and the throttler will be waken up to allow more requests
         // to enter the pipeline
         resumeProcess.countDown();
-        entered.await(STALL_TIME, TimeUnit.MILLISECONDS);
 
-        metrics = MetricsUtils.currentServerMetrics();
+        // wait for more than one STALL_TIME to reduce timeout before wakeup
+        assertTrue(entered.await(STALL_TIME + 5000, TimeUnit.MILLISECONDS));
+
+        Map<String, Object> metrics = MetricsUtils.currentServerMetrics();
         assertEquals(TOTAL_REQUESTS, (long) metrics.get("prep_processor_request_queued"));
     }
 
@@ -221,6 +254,9 @@ public class RequestThrottlerTest extends ZKTestCase {
         resumeProcess = new CountDownLatch(1);
         submitted = new CountDownLatch(TOTAL_REQUESTS);
 
+        throttled = new CountDownLatch(1);
+        throttling = new CountDownLatch(1);
+
         // send 5 requests asynchronously
         for (int i = 0; i < TOTAL_REQUESTS; i++) {
             zk.create("/request_throttle_test- " + i, ("/request_throttle_test- "
@@ -229,18 +265,20 @@ public class RequestThrottlerTest extends ZKTestCase {
         }
 
         // make sure the server received all 5 requests
-        submitted.await(5, TimeUnit.SECONDS);
-        Map<String, Object> metrics = MetricsUtils.currentServerMetrics();
-
-        // but only two requests can get into the pipeline because of the throttler
-        assertEquals(2L, (long) metrics.get("prep_processor_request_queued"));
-        assertEquals(1L, (long) metrics.get("request_throttle_wait_count"));
+        assertTrue(submitted.await(5, TimeUnit.SECONDS));
 
+        // stale throttled requests
+        assertTrue(throttling.await(5, TimeUnit.SECONDS));
         for (ServerCnxn cnxn : f.cnxns) {
             cnxn.setStale();
         }
+        throttled.countDown();
         zk = null;
 
+        // only first three requests are counted as finished
+        finished = new CountDownLatch(3);
+
+        // let the requests go through the pipeline
         resumeProcess.countDown();
         LOG.info("raise the latch");
 
@@ -248,10 +286,18 @@ public class RequestThrottlerTest extends ZKTestCase {
             Thread.sleep(50);
         }
 
+        assertTrue(finished.await(5, TimeUnit.SECONDS));
+
+        // assert after all requests processed to avoid concurrent issues as metrics are
+        // counted in different threads.
+        Map<String, Object> metrics = MetricsUtils.currentServerMetrics();
+
+        // only two requests can get into the pipeline because of the throttler
+        assertEquals(2L, (long) metrics.get("prep_processor_request_queued"));
+
         // the rest of the 3 requests will be dropped
         // but only the first one for a connection will be counted
-        metrics = MetricsUtils.currentServerMetrics();
-        assertEquals(2L, (long) metrics.get("prep_processor_request_queued"));
+        assertEquals(1L, (long) metrics.get("request_throttle_wait_count"));
         assertEquals(1, (long) metrics.get("stale_requests_dropped"));
     }
 
@@ -261,13 +307,22 @@ public class RequestThrottlerTest extends ZKTestCase {
 
         AsyncCallback.StringCallback createCallback = (rc, path, ctx, name) -> {
             if (KeeperException.Code.get(rc) == KeeperException.Code.CONNECTIONLOSS) {
-                disconnected.countDown();
                 connectionLossCount++;
+                disconnected.countDown();
             }
         };
 
-        // we allow five requests in the pipeline
-        RequestThrottler.setMaxRequests(5);
+        // the total length of the request is about 170-180 bytes, so only two requests are allowed
+        byte[] data = new byte[100];
+        // the third request will incur throttle. We don't send more requests to avoid reconnecting
+        // due to unstable test environment(e.g. slow sending).
+        int number_requests = 3;
+
+        // we allow more requests in the pipeline
+        RequestThrottler.setMaxRequests(number_requests + 2);
+
+        // request could become stale in processor threads due to throttle in io thread
+        RequestThrottler.setDropStaleRequests(false);
 
         // enable large request throttling
         zks.setLargeRequestThreshold(150);
@@ -277,34 +332,32 @@ public class RequestThrottlerTest extends ZKTestCase {
         resumeProcess = new CountDownLatch(1);
         // the connection will be close when large requests exceed the limit
         // we can't use the submitted latch because requests after close won't be submitted
-        disconnected = new CountDownLatch(TOTAL_REQUESTS);
-
-        // the total length of the request is about 170-180 bytes, so only two requests are allowed
-        byte[] data = new byte[100];
+        disconnected = new CountDownLatch(number_requests);
 
-        // send 5 requests asynchronously
-        for (int i = 0; i < TOTAL_REQUESTS; i++) {
+        // send requests asynchronously
+        for (int i = 0; i < number_requests; i++) {
             zk.create("/request_throttle_test- " + i , data,
                     ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, createCallback, null);
         }
 
-        // make sure the server received all 5 requests
-        disconnected.await(30, TimeUnit.SECONDS);
+        // make sure the server received all requests
+        assertTrue(disconnected.await(30, TimeUnit.SECONDS));
+
+        finished = new CountDownLatch(2);
+        // let the requests go through the pipeline
+        resumeProcess.countDown();
+        assertTrue(finished.await(5, TimeUnit.SECONDS));
+
+        // assert metrics after finished so metrics in no io threads are set also.
         Map<String, Object> metrics = MetricsUtils.currentServerMetrics();
 
         // but only two requests can get into the pipeline because they are large requests
         // the connection will be closed
         assertEquals(2L, (long) metrics.get("prep_processor_request_queued"));
         assertEquals(1L, (long) metrics.get("large_requests_rejected"));
-        assertEquals(5, connectionLossCount);
-
-        finished = new CountDownLatch(2);
-        // let the requests go through the pipeline
-        resumeProcess.countDown();
-        finished.await(5, TimeUnit.SECONDS);
+        assertEquals(number_requests, connectionLossCount);
 
         // when the two requests finish, they are stale because the connection is closed already
-        metrics = MetricsUtils.currentServerMetrics();
         assertEquals(2, (long) metrics.get("stale_replies"));
     }
 
@@ -319,7 +372,6 @@ public class RequestThrottlerTest extends ZKTestCase {
             RequestThrottler.setMaxRequests(0);
             resumeProcess = new CountDownLatch(1);
             int totalRequests = 10;
-            submitted = new CountDownLatch(totalRequests);
 
             for (int i = 0; i < totalRequests; i++) {
                 zk.create("/request_throttle_test- " + i, ("/request_throttle_test- "
@@ -327,16 +379,16 @@ public class RequestThrottlerTest extends ZKTestCase {
                 }, null);
             }
 
-            submitted.await(5, TimeUnit.SECONDS);
-
             // We should start throttling instead of queuing more requests.
             //
             // We always allow up to GLOBAL_OUTSTANDING_LIMIT + 1 number of requests coming in request processing pipeline
             // before throttling. For the next request, we will throttle by disabling receiving future requests but we still
-            // allow this single request coming in. So the total number of queued requests in processing pipeline would
+            // allow this single request coming in. Ideally, the total number of queued requests in processing pipeline would
             // be GLOBAL_OUTSTANDING_LIMIT + 2.
-            assertEquals(Integer.parseInt(GLOBAL_OUTSTANDING_LIMIT) + 2,
-                    (long) MetricsUtils.currentServerMetrics().get("prep_processor_request_queued"));
+            //
+            // But due to leak of consistent view of number of outstanding requests, the number could be larger.
+            WaitForCondition requestQueued = () -> getCounterMetric("prep_processor_request_queued") >= Integer.parseInt(GLOBAL_OUTSTANDING_LIMIT) + 2;
+            waitFor("no enough requests queued", requestQueued, 5);
 
             resumeProcess.countDown();
         } catch (Exception e) {
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnSnapLogMetricsTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnSnapLogMetricsTest.java
index a93dcc8..65648fe 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnSnapLogMetricsTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnSnapLogMetricsTest.java
@@ -22,20 +22,21 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.number.OrderingComparison.greaterThan;
 import static org.hamcrest.number.OrderingComparison.greaterThanOrEqualTo;
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import java.io.File;
 import java.util.Map;
-import java.util.concurrent.CountDownLatch;
 import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.metrics.MetricsUtils;
+import org.apache.zookeeper.server.ServerCnxnFactory;
 import org.apache.zookeeper.server.ServerMetrics;
 import org.apache.zookeeper.server.SyncRequestProcessor;
+import org.apache.zookeeper.server.ZooKeeperServer;
 import org.apache.zookeeper.test.ClientBase;
-import org.apache.zookeeper.test.QuorumUtil;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,43 +44,53 @@ public class FileTxnSnapLogMetricsTest extends ZKTestCase {
 
     private static final Logger LOG = LoggerFactory.getLogger(FileTxnSnapLogMetricsTest.class);
 
-    CountDownLatch allCreatedLatch;
+    @TempDir
+    File logDir;
 
-    private class MockWatcher implements Watcher {
+    @TempDir
+    File snapDir;
 
-        @Override
-        public void process(WatchedEvent e) {
-            LOG.info("all nodes created");
-            allCreatedLatch.countDown();
-        }
+    private ServerCnxnFactory startServer() throws Exception {
+        ZooKeeperServer zkServer = new ZooKeeperServer(snapDir, logDir, 3000);
+        ServerCnxnFactory cnxnFactory = ServerCnxnFactory.createFactory(0, -1);
+        cnxnFactory.startup(zkServer);
+        return cnxnFactory;
+    }
 
+    @AfterEach
+    public void cleanup() throws Exception {
+        SyncRequestProcessor.setSnapCount(ZooKeeperServer.getSnapCount());
     }
 
     @Test
     public void testFileTxnSnapLogMetrics() throws Exception {
         SyncRequestProcessor.setSnapCount(100);
 
-        QuorumUtil util = new QuorumUtil(1);
-        util.startAll();
+        ServerCnxnFactory cnxnFactory = startServer();
+        String connectString = "127.0.0.1:" + cnxnFactory.getLocalPort();
 
-        allCreatedLatch = new CountDownLatch(1);
+        // Snapshot in load data.
+        assertEquals(1L, MetricsUtils.currentServerMetrics().get("cnt_snapshottime"));
 
         byte[] data = new byte[500];
-        // make sure a snapshot is taken and some txns are not in a snapshot
-        ZooKeeper zk = ClientBase.createZKClient(util.getConnString());
+        ZooKeeper zk = ClientBase.createZKClient(connectString);
         for (int i = 0; i < 150; i++) {
             zk.create("/path" + i, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
         }
 
-        if (null == zk.exists("/path149", new MockWatcher())) {
-            allCreatedLatch.await();
-        }
+        // It is possible that above writes will trigger more than one snapshot due to randomization.
+        WaitForCondition newSnapshot = () -> (long) MetricsUtils.currentServerMetrics().get("cnt_snapshottime") >= 2L;
+        waitFor("no snapshot in 10s", newSnapshot, 10);
+
+        // Pauses snapshot and logs more txns.
+        cnxnFactory.getZooKeeperServer().getTxnLogFactory().snapLog.close();
+        zk.create("/" + 1000, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+        zk.create("/" + 1001, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
 
+        // Restart server to count startup metrics.
+        cnxnFactory.shutdown();
         ServerMetrics.getMetrics().resetAll();
-        int leader = util.getLeaderServer();
-        // restart a server so it will read the snapshot and the txn logs
-        util.shutdown(leader);
-        util.start(leader);
+        cnxnFactory = startServer();
 
         Map<String, Object> values = MetricsUtils.currentServerMetrics();
         LOG.info("txn loaded during start up {}", values.get("max_startup_txns_loaded"));
@@ -90,7 +101,7 @@ public class FileTxnSnapLogMetricsTest extends ZKTestCase {
         assertEquals(1L, values.get("cnt_startup_snap_load_time"));
         assertThat((long) values.get("max_startup_snap_load_time"), greaterThan(0L));
 
-        util.shutdownAll();
+        cnxnFactory.shutdown();
     }
 
 }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java
index e8b19dc..ad43d88 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java
@@ -251,7 +251,7 @@ public class CnxManagerTest extends ZKTestCase {
             LOG.error("Null listener when initializing cnx manager");
         }
 
-        InetSocketAddress address = peers.get(peer.getId()).electionAddr.getReachableOrOne();
+        InetSocketAddress address = peers.get(peer.getMyId()).electionAddr.getReachableOrOne();
         LOG.info("Election port: {}", address.getPort());
 
         Thread.sleep(1000);
@@ -339,7 +339,7 @@ public class CnxManagerTest extends ZKTestCase {
         } else {
             LOG.error("Null listener when initializing cnx manager");
         }
-        InetSocketAddress address = peers.get(peer.getId()).electionAddr.getReachableOrOne();
+        InetSocketAddress address = peers.get(peer.getMyId()).electionAddr.getReachableOrOne();
         LOG.info("Election port: {}", address.getPort());
 
         Thread.sleep(1000);
@@ -386,7 +386,7 @@ public class CnxManagerTest extends ZKTestCase {
         } else {
             LOG.error("Null listener when initializing cnx manager");
         }
-        InetSocketAddress address = peers.get(peer.getId()).electionAddr.getReachableOrOne();
+        InetSocketAddress address = peers.get(peer.getMyId()).electionAddr.getReachableOrOne();
         LOG.info("Election port: {}", address.getPort());
         Thread.sleep(1000);
 
@@ -503,7 +503,7 @@ public class CnxManagerTest extends ZKTestCase {
         try {
             for (int sid = 0; sid < 3; sid++) {
                 QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[sid], peerTmpdir[sid], peerClientPort[sid], 3, sid, 1000, 2, 2, 2);
-                LOG.info("Starting peer {}", peer.getId());
+                LOG.info("Starting peer {}", peer.getMyId());
                 peer.start();
                 peerList.add(sid, peer);
             }
@@ -513,14 +513,14 @@ public class CnxManagerTest extends ZKTestCase {
                 for (int i = 0; i < 5; i++) {
                     // halt one of the listeners and verify count
                     QuorumPeer peer = peerList.get(myid);
-                    LOG.info("Round {}, halting peer {}", i, peer.getId());
+                    LOG.info("Round {}, halting peer {}", i, peer.getMyId());
                     peer.shutdown();
                     peerList.remove(myid);
                     failure = verifyThreadCount(peerList, 2);
                     assertNull(failure, failure);
                     // Restart halted node and verify count
                     peer = new QuorumPeer(peers, peerTmpdir[myid], peerTmpdir[myid], peerClientPort[myid], 3, myid, 1000, 2, 2, 2);
-                    LOG.info("Round {}, restarting peer {}", i, peer.getId());
+                    LOG.info("Round {}, restarting peer {}", i, peer.getMyId());
                     peer.start();
                     peerList.add(myid, peer);
                     failure = verifyThreadCount(peerList, 4);
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EagerACLFilterTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EagerACLFilterTest.java
index a27d5cf..4141c58 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EagerACLFilterTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/EagerACLFilterTest.java
@@ -19,14 +19,16 @@
 package org.apache.zookeeper.server.quorum;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
-import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Stream;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.TestableZooKeeper;
 import org.apache.zookeeper.ZooDefs.Ids;
+import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.server.ZooKeeperServer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;
 import org.apache.zookeeper.test.QuorumBase;
@@ -38,7 +40,6 @@ import org.junit.jupiter.params.provider.MethodSource;
 
 public class EagerACLFilterTest extends QuorumBase {
 
-    protected final CountDownLatch callComplete = new CountDownLatch(1);
     protected boolean complete = false;
     protected static final String PARENT_PATH = "/foo";
     protected static final String CHILD_PATH = "/foo/bar";
@@ -48,7 +49,9 @@ public class EagerACLFilterTest extends QuorumBase {
     protected static final byte[] DATA = "Hint Water".getBytes();
     protected TestableZooKeeper zkClient;
     protected TestableZooKeeper zkClientB;
+    protected TestableZooKeeper zkLeaderClient;
     protected QuorumPeer zkLeader;
+    protected QuorumPeer zkConnected;
     protected ZooKeeperServer connectedServer;
 
     public static Stream<Arguments> data() {
@@ -70,6 +73,7 @@ public class EagerACLFilterTest extends QuorumBase {
 
     public void setUp(ServerState serverState, boolean checkEnabled) throws Exception {
         ensureCheck(checkEnabled);
+        CountdownWatcher leaderWatch = new CountdownWatcher();
         CountdownWatcher clientWatch = new CountdownWatcher();
         CountdownWatcher clientWatchB = new CountdownWatcher();
         super.setUp(true, true);
@@ -78,16 +82,31 @@ public class EagerACLFilterTest extends QuorumBase {
         int clientPort = Integer.parseInt(hostPort.split(":")[1]);
 
         zkLeader = getPeerList().get(getLeaderIndex());
-        connectedServer = getPeerByClientPort(clientPort).getActiveServer();
+        zkConnected = getPeerByClientPort(clientPort);
+        connectedServer = zkConnected.getActiveServer();
 
+        zkLeaderClient = createClient(leaderWatch, getPeersMatching(ServerState.LEADING));
         zkClient = createClient(clientWatch, hostPort);
         zkClientB = createClient(clientWatchB, hostPort);
         zkClient.addAuthInfo(AUTH_PROVIDER, AUTH);
         zkClientB.addAuthInfo(AUTH_PROVIDER, AUTHB);
+        leaderWatch.waitForConnected(CONNECTION_TIMEOUT);
         clientWatch.waitForConnected(CONNECTION_TIMEOUT);
         clientWatchB.waitForConnected(CONNECTION_TIMEOUT);
     }
 
+    void syncClient(ZooKeeper zk) {
+        CompletableFuture<Void> synced = new CompletableFuture<>();
+        zk.sync("/", (rc, path, ctx) -> {
+            if (rc == 0) {
+                synced.complete(null);
+            } else {
+                synced.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc)));
+            }
+        }, null);
+        synced.join();
+    }
+
     @AfterEach
     public void tearDown() throws Exception {
         if (zkClient != null) {
@@ -102,19 +121,29 @@ public class EagerACLFilterTest extends QuorumBase {
     }
 
     private void ensureCheck(boolean enabled) {
-        if (enabled) {
-            System.setProperty(ZooKeeperServer.ENABLE_EAGER_ACL_CHECK, "true");
-        } else {
-            System.clearProperty(ZooKeeperServer.ENABLE_EAGER_ACL_CHECK);
-        }
+        ZooKeeperServer.setEnableEagerACLCheck(enabled);
     }
 
-    private void assertTransactionState(String condition, long lastxid, ServerState serverState, boolean checkEnabled) {
-        String assertion = String.format("Server State: %s Check Enabled: %s %s", serverState, checkEnabled, condition);
-        if (checkEnabled) {
-            assertEquals(lastxid, zkLeader.getLastLoggedZxid(), assertion);
+    private void assertTransactionState(String operation, QuorumPeer peer, long lastxid) {
+        if (peer == zkLeader && peer != zkConnected) {
+            // The operation is performed on no leader, but we are asserting on leader.
+            // There is no happen-before between `zkLeader.getLastLoggedZxid()` and
+            // successful response from other server. The commit and response are routed
+            // to different servers and performed asynchronous in each server. So we have
+            // to sync leader client to go through commit and response path in leader to
+            // build happen-before between `zkLeader.getLastLoggedZxid()` and side effect
+            // of previous operation.
+            syncClient(zkLeaderClient);
+        }
+        assertTrue(peer == zkLeader || peer == zkConnected);
+        boolean eagerACL = ZooKeeperServer.isEnableEagerACLCheck();
+        String assertion = String.format(
+                "Connecting: %s Checking: %s EagerACL: %s Operation: %s",
+                zkConnected.getPeerState(), peer.getPeerState(), eagerACL, operation);
+        if (eagerACL) {
+            assertEquals(lastxid, peer.getLastLoggedZxid(), assertion);
         } else {
-            assertNotSame(lastxid, zkLeader.getLastLoggedZxid(), assertion);
+            assertNotEquals(lastxid, peer.getLastLoggedZxid(), assertion);
         }
     }
 
@@ -144,15 +173,17 @@ public class EagerACLFilterTest extends QuorumBase {
     public void testCreateFail(ServerState serverState, boolean checkEnabled) throws Exception {
         setUp(serverState, checkEnabled);
         zkClient.create(PARENT_PATH, DATA, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT);
-        long lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
         try {
             zkClientB.create(CHILD_PATH, DATA, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+            fail("expect no auth");
         } catch (KeeperException.NoAuthException e) {
         }
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("Transaction state on Leader after failed create", lastxid, serverState, checkEnabled);
+        assertTransactionState("failed create", zkConnected, lastxid);
+        assertTransactionState("failed create", zkLeader, lastxid);
     }
 
     @ParameterizedTest
@@ -160,15 +191,17 @@ public class EagerACLFilterTest extends QuorumBase {
     public void testCreate2Fail(ServerState serverState, boolean checkEnabled) throws Exception {
         setUp(serverState, checkEnabled);
         zkClient.create(PARENT_PATH, DATA, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, null);
-        long lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
         try {
             zkClientB.create(CHILD_PATH, DATA, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, null);
+            fail("expect no auth");
         } catch (KeeperException.NoAuthException e) {
         }
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("Transaction state on Leader after failed create2", lastxid, serverState, checkEnabled);
+        assertTransactionState("failed create2", zkConnected, lastxid);
+        assertTransactionState("failed create2", zkLeader, lastxid);
     }
 
     @ParameterizedTest
@@ -187,15 +220,17 @@ public class EagerACLFilterTest extends QuorumBase {
         setUp(serverState, checkEnabled);
         zkClient.create(PARENT_PATH, DATA, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, null);
         zkClient.create(CHILD_PATH, DATA, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, null);
-        long lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
         try {
             zkClientB.delete(CHILD_PATH, -1);
+            fail("expect no auth");
         } catch (KeeperException.NoAuthException e) {
         }
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("Transaction state on Leader after failed delete", lastxid, serverState, checkEnabled);
+        assertTransactionState("failed delete", zkConnected, lastxid);
+        assertTransactionState("failed delete", zkLeader, lastxid);
     }
 
     @ParameterizedTest
@@ -211,15 +246,17 @@ public class EagerACLFilterTest extends QuorumBase {
     public void testSetDataFail(ServerState serverState, boolean checkEnabled) throws Exception {
         setUp(serverState, checkEnabled);
         zkClient.create(PARENT_PATH, null, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, null);
-        long lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
         try {
             zkClientB.setData(PARENT_PATH, DATA, -1);
+            fail("expect no auth");
         } catch (KeeperException.NoAuthException e) {
         }
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("Transaction state on Leader after failed setData", lastxid, serverState, checkEnabled);
+        assertTransactionState("failed setData", zkConnected, lastxid);
+        assertTransactionState("failed setData", zkLeader, lastxid);
     }
 
     @ParameterizedTest
@@ -237,15 +274,17 @@ public class EagerACLFilterTest extends QuorumBase {
     public void testSetACLFail(ServerState serverState, boolean checkEnabled) throws Exception {
         setUp(serverState, checkEnabled);
         zkClient.create(PARENT_PATH, null, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, null);
-        long lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
         try {
             zkClientB.setACL(PARENT_PATH, Ids.READ_ACL_UNSAFE, -1);
-        } catch (KeeperException.NoAuthException e) {
+            fail("expect no auth");
+        } catch (KeeperException.NoAuthException ignored) {
         }
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("Transaction state on Leader after failed setACL", lastxid, serverState, checkEnabled);
+        assertTransactionState("failed setACL", zkConnected, lastxid);
+        assertTransactionState("failed setACL", zkLeader, lastxid);
     }
 
     @ParameterizedTest
@@ -253,12 +292,12 @@ public class EagerACLFilterTest extends QuorumBase {
     public void testBadACL(ServerState serverState, boolean checkEnabled) throws Exception {
         setUp(serverState, checkEnabled);
         CountdownWatcher cw = new CountdownWatcher();
-        TestableZooKeeper zk = createClient(cw, getPeersMatching(serverState));
-        long lastxid;
+        String addr = String.format("%s:%d", LOCALADDR, zkConnected.getClientPort());
+        TestableZooKeeper zk = createClient(cw, addr);
 
         cw.waitForConnected(CONNECTION_TIMEOUT);
 
-        lastxid = zkLeader.getLastLoggedZxid();
+        long lastxid = zkConnected.getLastLoggedZxid();
 
         try {
             zk.create("/acltest", new byte[0], Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT);
@@ -268,7 +307,8 @@ public class EagerACLFilterTest extends QuorumBase {
 
         assertEquals(0, connectedServer.getInProcess(), "OutstandingRequests not decremented");
 
-        assertTransactionState("zxid after invalid ACL", lastxid, serverState, checkEnabled);
+        assertTransactionState("invalid ACL", zkConnected, lastxid);
+        assertTransactionState("invalid ACL", zkLeader, lastxid);
     }
 
 }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java
index 3dcaf5d..c39bc54 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java
@@ -533,7 +533,7 @@ public class FuzzySnapshotRelatedTest extends QuorumPeerTestBase {
                                     this,
                                     getZKDatabase().getSessionWithTimeOuts(),
                                     this.tickTime,
-                                    self.getId(),
+                                    self.getMyId(),
                                     self.areLocalSessionsEnabled(),
                                     getZooKeeperServerListener()) {
 
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java
index 618ffa0..dc537ab 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java
@@ -76,7 +76,7 @@ public class LeaderBeanTest {
     public void setUp() throws IOException, X509Exception {
         qp = new QuorumPeer();
         quorumVerifierMock = mock(QuorumVerifier.class);
-        when(quorumVerifierMock.getAllMembers()).thenReturn(getMockedPeerViews(qp.getId()));
+        when(quorumVerifierMock.getAllMembers()).thenReturn(getMockedPeerViews(qp.getMyId()));
 
         qp.setQuorumVerifier(quorumVerifierMock, false);
         File tmpDir = ClientBase.createEmptyTestDir();
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderWithObserverTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderWithObserverTest.java
index f5df549..7ac5636 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderWithObserverTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderWithObserverTest.java
@@ -73,7 +73,7 @@ public class LeaderWithObserverTest {
         try {
             // Leader asks for epoch (mocking Leader.lead behavior)
             // First add to connectingFollowers
-            leader.getEpochToPropose(peer.getId(), lastAcceptedEpoch);
+            leader.getEpochToPropose(peer.getMyId(), lastAcceptedEpoch);
         } catch (InterruptedException e) {
             // ignore timeout
         }
@@ -113,7 +113,7 @@ public class LeaderWithObserverTest {
         assertFalse(leader.electionFinished);
         try {
             // leader calls waitForEpochAck, first add to electingFollowers
-            leader.waitForEpochAck(peer.getId(), new StateSummary(0, 0));
+            leader.waitForEpochAck(peer.getMyId(), new StateSummary(0, 0));
         } catch (InterruptedException e) {
             // ignore timeout
         }
@@ -152,7 +152,7 @@ public class LeaderWithObserverTest {
         assertFalse(leader.quorumFormed);
         try {
             // leader calls waitForNewLeaderAck, first add to ackSet
-            leader.waitForNewLeaderAck(peer.getId(), zxid);
+            leader.waitForNewLeaderAck(peer.getMyId(), zxid);
         } catch (InterruptedException e) {
             // ignore timeout
         }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LocalPeerBeanTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LocalPeerBeanTest.java
index 6ff491a..74d4370 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LocalPeerBeanTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LocalPeerBeanTest.java
@@ -85,7 +85,7 @@ public class LocalPeerBeanTest {
     public void testLocalPeerIsLeader() throws Exception {
         long localPeerId = 7;
         QuorumPeer peer = mock(QuorumPeer.class);
-        when(peer.getId()).thenReturn(localPeerId);
+        when(peer.getMyId()).thenReturn(localPeerId);
         when(peer.isLeader(eq(localPeerId))).thenReturn(true);
         LocalPeerBean localPeerBean = new LocalPeerBean(peer);
         assertTrue(localPeerBean.isLeader());
@@ -95,7 +95,7 @@ public class LocalPeerBeanTest {
     public void testLocalPeerIsNotLeader() throws Exception {
         long localPeerId = 7;
         QuorumPeer peer = mock(QuorumPeer.class);
-        when(peer.getId()).thenReturn(localPeerId);
+        when(peer.getMyId()).thenReturn(localPeerId);
         when(peer.isLeader(eq(localPeerId))).thenReturn(false);
         LocalPeerBean localPeerBean = new LocalPeerBean(peer);
         assertFalse(localPeerBean.isLeader());
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java
index 67bb673..6284746 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java
@@ -29,7 +29,7 @@ public class QuorumBeanTest {
     @Test
     public void testGetNameProperty() {
         QuorumPeer qpMock = mock(QuorumPeer.class);
-        when(qpMock.getId()).thenReturn(1L);
+        when(qpMock.getMyId()).thenReturn(1L);
         QuorumBean qb = new QuorumBean(qpMock);
 
         assertThat("getName property should return Bean name in the right format", qb.getName(), equalTo("ReplicatedServer_id1"));
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Zab1_0Test.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Zab1_0Test.java
index 3bdbcd9..107ae6a 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Zab1_0Test.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Zab1_0Test.java
@@ -162,7 +162,7 @@ public class Zab1_0Test extends ZKTestCase {
             // epoch were accounted for, so the leader should not block and since it started with
             // accepted epoch = 5 it should now have 6
             try {
-                long epoch = leader.getEpochToPropose(leader.self.getId(), leader.self.getAcceptedEpoch());
+                long epoch = leader.getEpochToPropose(leader.self.getMyId(), leader.self.getAcceptedEpoch());
                 assertEquals(6, epoch, "leader got wrong epoch from getEpochToPropose");
             } catch (Exception e) {
                 fail("leader timed out in getEpochToPropose");
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/KerberosTestUtils.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/KerberosTestUtils.java
index 755712b..db95d8d 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/KerberosTestUtils.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/KerberosTestUtils.java
@@ -19,11 +19,17 @@
 package org.apache.zookeeper.server.quorum.auth;
 
 import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.UUID;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
 import org.apache.zookeeper.util.SecurityUtils;
 
 public class KerberosTestUtils {
 
+    private static final boolean IBM_JAVA = System.getProperty("java.vendor").contains("IBM");
+
     private static String keytabFile = new File(System.getProperty("build.test.dir", "build"), UUID.randomUUID().toString()).getAbsolutePath();
 
     public static String getRealm() {
@@ -81,4 +87,59 @@ public class KerberosTestUtils {
         }
     }
 
+    public static class KerberosConfiguration extends Configuration {
+
+        private String principal;
+        private String keytab;
+        private boolean isInitiator;
+
+        private KerberosConfiguration(String principal, File keytab, boolean client) {
+            this.principal = principal;
+            this.keytab = keytab.getAbsolutePath();
+            this.isInitiator = client;
+        }
+
+        public static Configuration createClientConfig(String principal, File keytab) {
+            return new KerberosConfiguration(principal, keytab, true);
+        }
+
+        public static Configuration createServerConfig(String principal, File keytab) {
+            return new KerberosConfiguration(principal, keytab, false);
+        }
+
+        private static String getKrb5LoginModuleName() {
+            return System.getProperty("java.vendor").contains("IBM")
+              ? "com.ibm.security.auth.module.Krb5LoginModule"
+              : "com.sun.security.auth.module.Krb5LoginModule";
+        }
+
+        @Override
+        public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
+            Map<String, String> options = new HashMap<String, String>();
+            options.put("principal", principal);
+            options.put("refreshKrb5Config", "true");
+            if (IBM_JAVA) {
+                options.put("useKeytab", keytab);
+                options.put("credsType", "both");
+            } else {
+                options.put("keyTab", keytab);
+                options.put("useKeyTab", "true");
+                options.put("storeKey", "true");
+                options.put("doNotPrompt", "true");
+                options.put("useTicketCache", "true");
+                options.put("renewTGT", "true");
+                options.put("isInitiator", Boolean.toString(isInitiator));
+            }
+            String ticketCache = System.getenv("KRB5CCNAME");
+            if (ticketCache != null) {
+                options.put("ticketCache", ticketCache);
+            }
+            options.put("debug", "true");
+
+            return new AppConfigurationEntry[]{new AppConfigurationEntry(getKrb5LoginModuleName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options)};
+        }
+
+    }
+
+
 }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdc.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdc.java
index 4adcc0b..fdd68b5 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdc.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdc.java
@@ -63,6 +63,7 @@ import org.slf4j.LoggerFactory;
  *   <li>kdc.port=0 (ephemeral port)</li>
  *   <li>instance=DefaultKrbServer</li>
  *   <li>max.ticket.lifetime=86400000 (1 day)</li>
+ *   <li>min.ticket.lifetime=3600000 (1 hour)</li>
  *   <li>max.renewable.lifetime=604800000 (7 days)</li>
  *   <li>transport=TCP</li>
  *   <li>debug=false</li>
@@ -148,6 +149,7 @@ public class MiniKdc {
     public static final String KDC_PORT = "kdc.port";
     public static final String INSTANCE = "instance";
     public static final String MAX_TICKET_LIFETIME = "max.ticket.lifetime";
+    public static final String MIN_TICKET_LIFETIME = "min.ticket.lifetime";
     public static final String MAX_RENEWABLE_LIFETIME = "max.renewable.lifetime";
     public static final String TRANSPORT = "transport";
     public static final String DEBUG = "debug";
@@ -159,11 +161,11 @@ public class MiniKdc {
         PROPERTIES.add(ORG_NAME);
         PROPERTIES.add(ORG_DOMAIN);
         PROPERTIES.add(KDC_BIND_ADDRESS);
-        PROPERTIES.add(KDC_BIND_ADDRESS);
         PROPERTIES.add(KDC_PORT);
         PROPERTIES.add(INSTANCE);
         PROPERTIES.add(TRANSPORT);
         PROPERTIES.add(MAX_TICKET_LIFETIME);
+        PROPERTIES.add(MIN_TICKET_LIFETIME);
         PROPERTIES.add(MAX_RENEWABLE_LIFETIME);
 
         DEFAULT_CONFIG.setProperty(KDC_BIND_ADDRESS, "localhost");
@@ -173,6 +175,7 @@ public class MiniKdc {
         DEFAULT_CONFIG.setProperty(ORG_DOMAIN, "COM");
         DEFAULT_CONFIG.setProperty(TRANSPORT, "TCP");
         DEFAULT_CONFIG.setProperty(MAX_TICKET_LIFETIME, "86400000");
+        DEFAULT_CONFIG.setProperty(MIN_TICKET_LIFETIME, "3600000");
         DEFAULT_CONFIG.setProperty(MAX_RENEWABLE_LIFETIME, "604800000");
         DEFAULT_CONFIG.setProperty(DEBUG, "false");
     }
@@ -313,6 +316,10 @@ public class MiniKdc {
             throw new IllegalArgumentException("Need to set transport!");
         }
         simpleKdc.getKdcConfig().setString(KdcConfigKey.KDC_SERVICE_NAME, conf.getProperty(INSTANCE));
+        long minTicketLifetimeConf = Long.parseLong(conf.getProperty(MIN_TICKET_LIFETIME)) / 1000;
+        simpleKdc.getKdcConfig().setLong(KdcConfigKey.MINIMUM_TICKET_LIFETIME, minTicketLifetimeConf);
+        long maxTicketLifetimeConf = Long.parseLong(conf.getProperty(MAX_TICKET_LIFETIME)) / 1000;
+        simpleKdc.getKdcConfig().setLong(KdcConfigKey.MAXIMUM_TICKET_LIFETIME, maxTicketLifetimeConf);
         if (conf.getProperty(DEBUG) != null) {
             krb5Debug = getAndSet(SUN_SECURITY_KRB5_DEBUG, conf.getProperty(DEBUG));
         }
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
index 4ba6edc..3e57f9a 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/auth/MiniKdcTest.java
@@ -23,18 +23,15 @@ import static org.junit.jupiter.api.Assertions.assertNotSame;
 import java.io.File;
 import java.security.Principal;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import javax.security.auth.Subject;
 import javax.security.auth.kerberos.KerberosPrincipal;
-import javax.security.auth.login.AppConfigurationEntry;
-import javax.security.auth.login.Configuration;
 import javax.security.auth.login.LoginContext;
 import org.apache.kerby.kerberos.kerb.keytab.Keytab;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.zookeeper.server.quorum.auth.KerberosTestUtils.KerberosConfiguration;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
 
@@ -47,7 +44,6 @@ import org.junit.jupiter.api.Timeout;
  */
 public class MiniKdcTest extends KerberosSecurityTestcase {
 
-    private static final boolean IBM_JAVA = System.getProperty("java.vendor").contains("IBM");
 
     @Test
     @Timeout(value = 60)
@@ -74,59 +70,6 @@ public class MiniKdcTest extends KerberosSecurityTestcase {
             principals);
     }
 
-    private static class KerberosConfiguration extends Configuration {
-
-        private String principal;
-        private String keytab;
-        private boolean isInitiator;
-
-        private KerberosConfiguration(String principal, File keytab, boolean client) {
-            this.principal = principal;
-            this.keytab = keytab.getAbsolutePath();
-            this.isInitiator = client;
-        }
-
-        public static Configuration createClientConfig(String principal, File keytab) {
-            return new KerberosConfiguration(principal, keytab, true);
-        }
-
-        public static Configuration createServerConfig(String principal, File keytab) {
-            return new KerberosConfiguration(principal, keytab, false);
-        }
-
-        private static String getKrb5LoginModuleName() {
-            return System.getProperty("java.vendor").contains("IBM")
-                ? "com.ibm.security.auth.module.Krb5LoginModule"
-                : "com.sun.security.auth.module.Krb5LoginModule";
-        }
-
-        @Override
-        public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
-            Map<String, String> options = new HashMap<String, String>();
-            options.put("principal", principal);
-            options.put("refreshKrb5Config", "true");
-            if (IBM_JAVA) {
-                options.put("useKeytab", keytab);
-                options.put("credsType", "both");
-            } else {
-                options.put("keyTab", keytab);
-                options.put("useKeyTab", "true");
-                options.put("storeKey", "true");
-                options.put("doNotPrompt", "true");
-                options.put("useTicketCache", "true");
-                options.put("renewTGT", "true");
-                options.put("isInitiator", Boolean.toString(isInitiator));
-            }
-            String ticketCache = System.getenv("KRB5CCNAME");
-            if (ticketCache != null) {
-                options.put("ticketCache", ticketCache);
-            }
-            options.put("debug", "true");
-
-            return new AppConfigurationEntry[]{new AppConfigurationEntry(getKrb5LoginModuleName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options)};
-        }
-
-    }
 
     @Test
     @Timeout(value = 60)
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ChrootTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ChrootTest.java
index 0b15615..fca48c7 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ChrootTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ChrootTest.java
@@ -25,12 +25,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.junit.jupiter.api.Test;
@@ -60,6 +63,25 @@ public class ChrootTest extends ClientBase {
 
     }
 
+    @Test
+    public void testChrootWithZooKeeperPathWatcher() throws Exception {
+        ZooKeeper zk1 = createClient(hostPort + "/chroot");
+        BlockingQueue<WatchedEvent> events = new LinkedBlockingQueue<>();
+        byte[] config = zk1.getConfig(events::add, null);
+
+        ZooKeeper zk2 = createClient();
+        zk2.addAuthInfo("digest", "super:test".getBytes());
+        zk2.setData(ZooDefs.CONFIG_NODE, config, -1);
+
+        waitFor("config watcher receive no event", () -> !events.isEmpty(), 10);
+
+        WatchedEvent event = events.poll();
+        assertNotNull(event);
+        assertEquals(Watcher.Event.KeeperState.SyncConnected, event.getState());
+        assertEquals(Watcher.Event.EventType.NodeDataChanged, event.getType());
+        assertEquals(ZooDefs.CONFIG_NODE, event.getPath());
+    }
+
     @Test
     public void testChrootSynchronous() throws IOException, InterruptedException, KeeperException {
         ZooKeeper zk1 = createClient();
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLETest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLETest.java
index 15713e4..0f679b2 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLETest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLETest.java
@@ -368,7 +368,7 @@ public class FLETest extends ZKTestCase {
             this.peer = peer;
         }
         public void run() {
-            setName("VerifyState-" + peer.getId());
+            setName("VerifyState-" + peer.getMyId());
             while (true) {
                 if (peer.getPeerState() == ServerState.FOLLOWING) {
                     LOG.info("I am following");
@@ -410,7 +410,7 @@ public class FLETest extends ZKTestCase {
         // start 2 peers and verify if they form the cluster
         for (sid = 0; sid < 2; sid++) {
             peer = new QuorumPeer(peers, tmpdir[sid], tmpdir[sid], port[sid], 3, sid, 2000, 2, 2, 2);
-            LOG.info("Starting peer {}", peer.getId());
+            LOG.info("Starting peer {}", peer.getMyId());
             peer.start();
             peerList.add(sid, peer);
         }
@@ -421,16 +421,16 @@ public class FLETest extends ZKTestCase {
         assertFalse(!v1.isSuccess(), "Unable to form cluster in " + waitTime + " ms");
         // Start 3rd peer and check if it goes in LEADING state
         peer = new QuorumPeer(peers, tmpdir[sid], tmpdir[sid], port[sid], 3, sid, 2000, 2, 2, 2);
-        LOG.info("Starting peer {}", peer.getId());
+        LOG.info("Starting peer {}", peer.getMyId());
         peer.start();
         peerList.add(sid, peer);
         v1 = new VerifyState(peer);
         v1.start();
         v1.join(waitTime);
         if (v1.isAlive()) {
-            fail("Peer " + peer.getId() + " failed to join the cluster " + "within " + waitTime + " ms");
+            fail("Peer " + peer.getMyId() + " failed to join the cluster " + "within " + waitTime + " ms");
         } else if (!v1.isSuccess()) {
-            fail("Incorrect LEADING state for peer " + peer.getId());
+            fail("Incorrect LEADING state for peer " + peer.getMyId());
         }
         // cleanup
         for (int id = 0; id < 3; id++) {
@@ -459,7 +459,7 @@ public class FLETest extends ZKTestCase {
         // start 2 peers and verify if they form the cluster
         for (sid = 0; sid < 2; sid++) {
             peer = new QuorumPeer(peers, tmpdir[sid], tmpdir[sid], port[sid], 3, sid, 2000, 2, 2, 2);
-            LOG.info("Starting peer {}", peer.getId());
+            LOG.info("Starting peer {}", peer.getMyId());
             peer.start();
             peerList.add(sid, peer);
         }
@@ -478,14 +478,14 @@ public class FLETest extends ZKTestCase {
         peer.setCurrentVote(newVote);
         // Start 3rd peer and check if it joins the quorum
         peer = new QuorumPeer(peers, tmpdir[2], tmpdir[2], port[2], 3, 2, 2000, 2, 2, 2);
-        LOG.info("Starting peer {}", peer.getId());
+        LOG.info("Starting peer {}", peer.getMyId());
         peer.start();
         peerList.add(sid, peer);
         v1 = new VerifyState(peer);
         v1.start();
         v1.join(waitTime);
         if (v1.isAlive()) {
-            fail("Peer " + peer.getId() + " failed to join the cluster " + "within " + waitTime + " ms");
+            fail("Peer " + peer.getMyId() + " failed to join the cluster " + "within " + waitTime + " ms");
         }
         // cleanup
         for (int id = 0; id < 3; id++) {
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLEZeroWeightTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLEZeroWeightTest.java
index 0fdac45..59ed266 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLEZeroWeightTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FLEZeroWeightTest.java
@@ -128,7 +128,7 @@ public class FLEZeroWeightTest extends ZKTestCase {
                     LOG.info("Finished election: {}, {}", i, v.getId());
                     votes[i] = v;
 
-                    if ((peer.getPeerState() == ServerState.LEADING) && (peer.getId() > 2)) {
+                    if ((peer.getPeerState() == ServerState.LEADING) && (peer.getMyId() > 2)) {
                         fail = true;
                     }
 
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
index 4ba33c7..ffd6599 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverMasterTest.java
@@ -330,7 +330,7 @@ public class ObserverMasterTest extends ObserverMasterTestBase {
         ObjectName connBean = null;
         for (ObjectName bean : JMXEnv.conn().queryNames(new ObjectName(MBeanRegistry.DOMAIN + ":*"), null)) {
             if (bean.getCanonicalName().contains("Learner_Connections") && bean.getCanonicalName().contains("id:"
-                                                                                                                    + q3.getQuorumPeer().getId())) {
+                                                                                                                    + q3.getQuorumPeer().getMyId())) {
                 connBean = bean;
                 break;
             }
@@ -344,7 +344,7 @@ public class ObserverMasterTest extends ObserverMasterTestBase {
         assertTrue(ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT_OBS, CONNECTION_TIMEOUT),
                 "waiting for server 3 being up");
 
-        final String obsBeanName = String.format("org.apache.ZooKeeperService:name0=ReplicatedServer_id%d,name1=replica.%d,name2=Observer", q3.getQuorumPeer().getId(), q3.getQuorumPeer().getId());
+        final String obsBeanName = String.format("org.apache.ZooKeeperService:name0=ReplicatedServer_id%d,name1=replica.%d,name2=Observer", q3.getQuorumPeer().getMyId(), q3.getQuorumPeer().getMyId());
         Set<ObjectName> names = JMXEnv.conn().queryNames(new ObjectName(obsBeanName), null);
         assertEquals(1, names.size(), "expecting singular observer bean");
         ObjectName obsBean = names.iterator().next();
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumBase.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumBase.java
index 8f5f17d..4f723f2 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumBase.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumBase.java
@@ -47,7 +47,7 @@ public class QuorumBase extends ClientBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(QuorumBase.class);
 
-    private static final String LOCALADDR = "127.0.0.1";
+    protected static final String LOCALADDR = "127.0.0.1";
 
     private File oracleDir;
     private static final String oraclePath_0 = "/oraclePath/0/mastership/";
diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java
index 760d9a4..72a5f14 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java
@@ -115,10 +115,10 @@ public class QuorumTest extends ZKTestCase {
     @Test
     public void testViewContains() {
         // Test view contains self
-        assertTrue(qb.s1.viewContains(qb.s1.getId()));
+        assertTrue(qb.s1.viewContains(qb.s1.getMyId()));
 
         // Test view contains other servers
-        assertTrue(qb.s1.viewContains(qb.s2.getId()));
+        assertTrue(qb.s1.viewContains(qb.s2.getMyId()));
 
         // Test view does not contain non-existant servers
         assertFalse(qb.s1.viewContains(-1L));

More details

Full run details

Historical runs