You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2021/10/26 01:18:03 UTC

[bookkeeper] branch branch-4.14 updated (5924d91 -> 9158bb9)

This is an automated email from the ASF dual-hosted git repository.

yong pushed a change to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git.


    from 5924d91  A empty implement in EtcdLedgerManagerFactory to let the project can compile (#2845)
     new 1455250  Add metrics and internal command for QueryAutoRecoveryStatus, including underReplicatedSize metrics,read/write latency, internal command for querying recovering ledgersInfo (#2768)
     new 6041ded  fix-npe-when-pulsar-ZkBookieRackAffinityMapping-getBookieAddressResolver (#2788)
     new 356fe03  Upgrade httpclient from 4.5.5 to 4.5.13 (#2793)
     new 7724e12  Heap memory leak problem when ledger replication failed (#2794)
     new 1da014e  Add auditor get ledger throttle to avoid auto recovery zk session expire (#2802)
     new b903f64  Add ensemble check to over-replicated ledger GC (#2813)
     new 911c2e9  Upgraded dependencies with CVEs (#2792)
     new dae5171  [security] Upgrade Netty to 4.1.68.Final (#2811)
     new 82c4e1c  Release semaphore when addEntry accepts the same entries (#2832)
     new e86635c  Add error handling to readLedgerMetadata in over-replicated ledger GC (#2844)
     new 9158bb9  Fix the compilation issue introduced by #2802 ---

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bookkeeper-dist/all/build.gradle                   |   4 +-
 bookkeeper-dist/bkctl/build.gradle                 |   4 +-
 bookkeeper-dist/server/build.gradle                |   4 +-
 bookkeeper-dist/src/assemble/bin-all.xml           |   4 +-
 bookkeeper-dist/src/assemble/bin-server.xml        |   4 +-
 bookkeeper-dist/src/assemble/bkctl.xml             |   4 +-
 .../src/main/resources/LICENSE-all.bin.txt         | 173 ++++++++++----------
 .../src/main/resources/LICENSE-bkctl.bin.txt       | 154 +++++++++---------
 .../src/main/resources/LICENSE-server.bin.txt      | 173 ++++++++++----------
 .../src/main/resources/NOTICE-all.bin.txt          |  45 +++---
 .../src/main/resources/NOTICE-bkctl.bin.txt        |  26 +--
 .../src/main/resources/NOTICE-server.bin.txt       |  45 +++---
 .../LICENSE.aalto-xml.txt                          |   0
 .../LICENSE.base64.txt                             |   0
 .../LICENSE.bouncycastle.txt                       |   0
 .../LICENSE.caliper.txt                            |   0
 .../LICENSE.commons-lang.txt                       |   0
 .../LICENSE.commons-logging.txt                    |   0
 .../LICENSE.compress-lzf.txt                       |   0
 .../LICENSE.dnsinfo.txt                            |   0
 .../LICENSE.harmony.txt                            |   0
 .../LICENSE.hpack.txt                              |   0
 .../LICENSE.hyper-hpack.txt                        |   0
 .../LICENSE.jboss-marshalling.txt                  |   0
 .../LICENSE.jbzip2.txt                             |   0
 .../LICENSE.jctools.txt                            |   0
 .../LICENSE.jfastlz.txt                            |   0
 .../LICENSE.jsr166y.txt                            |   0
 .../LICENSE.jzlib.txt                              |   0
 .../LICENSE.libdivsufsort.txt                      |   0
 .../LICENSE.log4j.txt                              |   0
 .../LICENSE.lz4.txt                                |   0
 .../LICENSE.lzma-java.txt                          |   0
 .../LICENSE.mvn-wrapper.txt                        |   0
 .../LICENSE.nghttp2-hpack.txt                      |   0
 .../LICENSE.protobuf.txt                           |   0
 .../LICENSE.slf4j.txt                              |   0
 .../LICENSE.snappy.txt                             |   0
 .../LICENSE.webbit.txt                             |   0
 .../NOTICE.harmony.txt                             |   0
 .../{slf4j-1.7.25 => slf4j-1.7.32}/LICENSE.txt     |   0
 .../org/apache/bookkeeper/bookie/BookieShell.java  |  40 +++++
 .../apache/bookkeeper/bookie/EntryMemTable.java    |   3 +
 .../bookie/ScanAndCompareGarbageCollector.java     |  53 ++++--
 .../client/LedgerFragmentReplicator.java           |  31 +++-
 .../org/apache/bookkeeper/client/LedgerOpenOp.java |  16 ++
 .../RackawareEnsemblePlacementPolicyImpl.java      |   9 +-
 .../ZoneawareEnsemblePlacementPolicyImpl.java      |   1 +
 .../bookkeeper/conf/ServerConfiguration.java       |  39 +++++
 .../bookkeeper/meta/AbstractZkLedgerManager.java   |   8 +-
 .../org/apache/bookkeeper/replication/Auditor.java |  76 ++++++++-
 .../bookkeeper/replication/ReplicationStats.java   |   3 +
 .../QueryAutoRecoveryStatusCommand.java            | 151 +++++++++++++++++
 .../bookkeeper/bookie/EntryMemTableTest.java       |  20 +++
 .../TestRackawareEnsemblePlacementPolicy.java      |  14 ++
 .../replication/AuditorPeriodicCheckTest.java      |  54 +++++++
 conf/bk_server.conf                                |   7 +
 dependencies.gradle                                |  12 +-
 pom.xml                                            |  12 +-
 .../QueryAutoRecoveryStatusCommandTest.java        | 179 +++++++++++++++++++++
 60 files changed, 1008 insertions(+), 360 deletions(-)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.aalto-xml.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.base64.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.bouncycastle.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.caliper.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.commons-lang.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.commons-logging.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.compress-lzf.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.dnsinfo.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.harmony.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.hpack.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.hyper-hpack.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jboss-marshalling.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jbzip2.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jctools.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jfastlz.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jsr166y.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.jzlib.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.libdivsufsort.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.log4j.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.lz4.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.lzma-java.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.mvn-wrapper.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.nghttp2-hpack.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.protobuf.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.slf4j.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.snappy.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/LICENSE.webbit.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{netty-4.1.63.Final => netty-4.1.68.Final}/NOTICE.harmony.txt (100%)
 rename bookkeeper-dist/src/main/resources/deps/{slf4j-1.7.25 => slf4j-1.7.32}/LICENSE.txt (100%)
 create mode 100644 bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommand.java
 create mode 100644 tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommandTest.java

[bookkeeper] 04/11: Heap memory leak problem when ledger replication failed (#2794)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 7724e1249a14af772f9441b231c31d9a19c344a7
Author: gaozhangmin <ga...@qq.com>
AuthorDate: Fri Oct 15 08:23:22 2021 +0800

    Heap memory leak problem when ledger replication failed (#2794)
    
    ### Motivation
    
    production environment, memory leak always happened, and there were ledger cannot be replicated successfully.
    
    This cause by when `openLedgerNoRecovery` with `BKNotEnoughBookiesException`,  the LedgerHandler won't  closed properly, caused memory leak
    
    https://github.com/apache/bookkeeper/blob/c7236adc3cb659e65ae5ce53b7156569d7f50ebd/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java#L364-L424
    
    ### Changes
    
    close LedgerHandler when openComplete with exception
    
    (cherry picked from commit 4dc426000d35a93ee0681c0c0124d4b1d3c53ad8)
---
 .../java/org/apache/bookkeeper/client/LedgerOpenOp.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
index 2193b3e..e74fcb6 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
@@ -129,6 +129,19 @@ class LedgerOpenOp {
         initiate();
     }
 
+    private void closeLedgerHandle() {
+        try {
+            if (lh != null) {
+                lh.close();
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            LOG.info("InterruptedException while closing ledger {}", ledgerId, e);
+        } catch (BKException e) {
+            LOG.warn("BKException while closing ledger {} ", ledgerId, e);
+        }
+    }
+
     private void openWithMetadata(Versioned<LedgerMetadata> versionedMetadata) {
         LedgerMetadata metadata = versionedMetadata.getValue();
 
@@ -196,8 +209,10 @@ class LedgerOpenOp {
                     if (rc == BKException.Code.OK) {
                         openComplete(BKException.Code.OK, lh);
                     } else if (rc == BKException.Code.UnauthorizedAccessException) {
+                        closeLedgerHandle();
                         openComplete(BKException.Code.UnauthorizedAccessException, null);
                     } else {
+                        closeLedgerHandle();
                         openComplete(bk.getReturnRc(BKException.Code.LedgerRecoveryException), null);
                     }
                 }
@@ -212,6 +227,7 @@ class LedgerOpenOp {
                 public void readLastConfirmedComplete(int rc,
                         long lastConfirmed, Object ctx) {
                     if (rc != BKException.Code.OK) {
+                        closeLedgerHandle();
                         openComplete(bk.getReturnRc(BKException.Code.ReadException), null);
                     } else {
                         lh.lastAddConfirmed = lh.lastAddPushed = lastConfirmed;

[bookkeeper] 08/11: [security] Upgrade Netty to 4.1.68.Final (#2811)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit dae5171a776caff617eea4f929e76765897c3eec
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Mon Oct 4 23:58:00 2021 +0200

    [security] Upgrade Netty to 4.1.68.Final (#2811)
    
    (cherry picked from commit 510439d1c703270ca7b7166a435476ce9ce39eb2)
---
 bookkeeper-dist/all/build.gradle                   |   2 +-
 bookkeeper-dist/bkctl/build.gradle                 |   2 +-
 bookkeeper-dist/server/build.gradle                |   2 +-
 bookkeeper-dist/src/assemble/bin-all.xml           |   2 +-
 bookkeeper-dist/src/assemble/bin-server.xml        |   2 +-
 bookkeeper-dist/src/assemble/bkctl.xml             |   2 +-
 .../src/main/resources/LICENSE-all.bin.txt         | 144 ++++++++++-----------
 .../src/main/resources/LICENSE-bkctl.bin.txt       | 140 ++++++++++----------
 .../src/main/resources/LICENSE-server.bin.txt      | 144 ++++++++++-----------
 .../src/main/resources/NOTICE-all.bin.txt          |  30 ++---
 .../src/main/resources/NOTICE-bkctl.bin.txt        |  26 ++--
 .../src/main/resources/NOTICE-server.bin.txt       |  30 ++---
 .../LICENSE.aalto-xml.txt                          |   0
 .../LICENSE.base64.txt                             |   0
 .../LICENSE.bouncycastle.txt                       |   0
 .../LICENSE.caliper.txt                            |   0
 .../LICENSE.commons-lang.txt                       |   0
 .../LICENSE.commons-logging.txt                    |   0
 .../LICENSE.compress-lzf.txt                       |   0
 .../LICENSE.dnsinfo.txt                            |   0
 .../LICENSE.harmony.txt                            |   0
 .../LICENSE.hpack.txt                              |   0
 .../LICENSE.hyper-hpack.txt                        |   0
 .../LICENSE.jboss-marshalling.txt                  |   0
 .../LICENSE.jbzip2.txt                             |   0
 .../LICENSE.jctools.txt                            |   0
 .../LICENSE.jfastlz.txt                            |   0
 .../LICENSE.jsr166y.txt                            |   0
 .../LICENSE.jzlib.txt                              |   0
 .../LICENSE.libdivsufsort.txt                      |   0
 .../LICENSE.log4j.txt                              |   0
 .../LICENSE.lz4.txt                                |   0
 .../LICENSE.lzma-java.txt                          |   0
 .../LICENSE.mvn-wrapper.txt                        |   0
 .../LICENSE.nghttp2-hpack.txt                      |   0
 .../LICENSE.protobuf.txt                           |   0
 .../LICENSE.slf4j.txt                              |   0
 .../LICENSE.snappy.txt                             |   0
 .../LICENSE.webbit.txt                             |   0
 .../NOTICE.harmony.txt                             |   0
 dependencies.gradle                                |   4 +-
 pom.xml                                            |   4 +-
 42 files changed, 267 insertions(+), 267 deletions(-)

diff --git a/bookkeeper-dist/all/build.gradle b/bookkeeper-dist/all/build.gradle
index 54f44d3..2ad3719 100644
--- a/bookkeeper-dist/all/build.gradle
+++ b/bookkeeper-dist/all/build.gradle
@@ -64,7 +64,7 @@ def depLicences = [
         "javax.servlet-api-4.0.0/CDDL+GPL-1.1",
         "bouncycastle-1.0.2/LICENSE.html",
         "jsr-305/LICENSE",
-        "netty-4.1.63.Final/*",
+        "netty-4.1.68.Final/*",
         "paranamer-2.8/LICENSE.txt",
         "protobuf-3.14.0/LICENSE",
         "protobuf-3.12.0/LICENSE",
diff --git a/bookkeeper-dist/bkctl/build.gradle b/bookkeeper-dist/bkctl/build.gradle
index d31e3de..691f09b 100644
--- a/bookkeeper-dist/bkctl/build.gradle
+++ b/bookkeeper-dist/bkctl/build.gradle
@@ -36,7 +36,7 @@ def depLicences = [
         "checker-qual-3.5.0/LICENSE",
         "google-auth-library-credentials-0.20.0/LICENSE",
         "javax.servlet-api-4.0.0/CDDL+GPL-1.1",
-        "netty-4.1.63.Final/*",
+        "netty-4.1.68.Final/*",
         "bouncycastle-1.0.2/LICENSE.html",
         "protobuf-3.14.0/LICENSE",
         "protobuf-3.12.0/LICENSE",
diff --git a/bookkeeper-dist/server/build.gradle b/bookkeeper-dist/server/build.gradle
index ccdbb7f..a3264f7 100644
--- a/bookkeeper-dist/server/build.gradle
+++ b/bookkeeper-dist/server/build.gradle
@@ -60,7 +60,7 @@ def depLicences = [
         "checker-qual-3.5.0/LICENSE",
         "google-auth-library-credentials-0.20.0/LICENSE",
         "javax.servlet-api-4.0.0/CDDL+GPL-1.1",
-        "netty-4.1.63.Final/*",
+        "netty-4.1.68.Final/*",
         "bouncycastle-1.0.2/LICENSE.html",
         "protobuf-3.14.0/LICENSE",
         "protobuf-3.12.0/LICENSE",
diff --git a/bookkeeper-dist/src/assemble/bin-all.xml b/bookkeeper-dist/src/assemble/bin-all.xml
index 24a242f..9a72935 100644
--- a/bookkeeper-dist/src/assemble/bin-all.xml
+++ b/bookkeeper-dist/src/assemble/bin-all.xml
@@ -59,7 +59,7 @@
         <include>javax.servlet-api-4.0.0/CDDL+GPL-1.1</include>
         <include>bouncycastle-1.0.2/LICENSE.html</include>
         <include>jsr-305/LICENSE</include>
-        <include>netty-4.1.63.Final/*</include>
+        <include>netty-4.1.68.Final/*</include>
         <include>paranamer-2.8/LICENSE.txt</include>
         <include>protobuf-3.14.0/LICENSE</include>
         <include>protobuf-3.12.0/LICENSE</include>
diff --git a/bookkeeper-dist/src/assemble/bin-server.xml b/bookkeeper-dist/src/assemble/bin-server.xml
index 7157f39..fa73418 100644
--- a/bookkeeper-dist/src/assemble/bin-server.xml
+++ b/bookkeeper-dist/src/assemble/bin-server.xml
@@ -52,7 +52,7 @@
         <include>checker-qual-3.5.0/LICENSE</include>
         <include>google-auth-library-credentials-0.20.0/LICENSE</include>
         <include>javax.servlet-api-4.0.0/CDDL+GPL-1.1</include>
-        <include>netty-4.1.63.Final/*</include>
+        <include>netty-4.1.68.Final/*</include>
         <include>bouncycastle-1.0.2/LICENSE.html</include>
         <include>protobuf-3.14.0/LICENSE</include>
         <include>protobuf-3.12.0/LICENSE</include>
diff --git a/bookkeeper-dist/src/assemble/bkctl.xml b/bookkeeper-dist/src/assemble/bkctl.xml
index 73fffc5..e9cea87 100644
--- a/bookkeeper-dist/src/assemble/bkctl.xml
+++ b/bookkeeper-dist/src/assemble/bkctl.xml
@@ -66,7 +66,7 @@
       <includes>
         <include>checker-qual-3.5.0/LICENSE</include>
         <include>google-auth-library-credentials-0.20.0/LICENSE</include>
-        <include>netty-4.1.63.Final/*</include>
+        <include>netty-4.1.68.Final/*</include>
         <include>bouncycastle-1.0.2/LICENSE.html</include>
         <include>protobuf-3.14.0/LICENSE</include>
         <include>protobuf-3.12.0/LICENSE</include>
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
index 104bd44..65087f4 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
@@ -217,21 +217,21 @@ Apache Software License, Version 2.
 - lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
-- lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-dns-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar [11]
-- lib/io.netty-netty-common-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar [11]
-- lib/io.netty-netty-resolver-4.1.63.Final.jar [11]
-- lib/io.netty-netty-resolver-dns-4.1.63.Final.jar [11]
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar [11]
-- lib/io.netty-netty-transport-4.1.63.Final.jar [11]
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar [11]
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar [11]
+- lib/io.netty-netty-buffer-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-dns-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar [11]
+- lib/io.netty-netty-common-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar [11]
+- lib/io.netty-netty-resolver-4.1.68.Final.jar [11]
+- lib/io.netty-netty-resolver-dns-4.1.68.Final.jar [11]
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar [11]
+- lib/io.netty-netty-transport-4.1.68.Final.jar [11]
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar [11]
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar [11]
 - lib/io.prometheus-simpleclient-0.8.1.jar [12]
 - lib/io.prometheus-simpleclient_common-0.8.1.jar [12]
 - lib/io.prometheus-simpleclient_hotspot-0.8.1.jar [12]
@@ -312,7 +312,7 @@ Apache Software License, Version 2.
 [8] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-io.git;a=tag;h=603579
 [9] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=tag;h=375459
 [10] Source available at http://svn.apache.org/viewvc/commons/proper/logging/tags/commons-logging-1.1.1/
-[11] Source available at https://github.com/netty/netty/tree/netty-4.1.63.Final
+[11] Source available at https://github.com/netty/netty/tree/netty-4.1.68.Final
 [12] Source available at https://github.com/prometheus/client_java/tree/parent-0.8.1
 [13] Source available at https://github.com/vert-x3/vertx-auth/tree/3.9.8
 [14] Source available at https://github.com/vert-x3/vertx-bridge-common/tree/3.9.8
@@ -351,229 +351,229 @@ Apache Software License, Version 2.
 [50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
 
 ------------------------------------------------------------------------------------
-lib/io.netty-netty-codec-4.1.63.Final.jar bundles some 3rd party dependencies
+lib/io.netty-netty-codec-4.1.68.Final.jar bundles some 3rd party dependencies
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the extensions to Java Collections Framework which has
+lib/io.netty-netty-codec-4.1.68.Final.jar contains the extensions to Java Collections Framework which has
 been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jsr166y.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.jsr166y.txt (Public Domain)
   * HOMEPAGE:
     * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
     * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of Robert Harder's Public Domain
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of Robert Harder's Public Domain
 Base64 Encoder and Decoder, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.base64.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.base64.txt (Public Domain)
   * HOMEPAGE:
     * http://iharder.sourceforge.net/current/java/base64/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Webbit', an event based
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Webbit', an event based
 WebSocket and HTTP server, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.webbit.txt (BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.webbit.txt (BSD License)
   * HOMEPAGE:
     * https://github.com/joewalnes/webbit
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'SLF4J', a simple logging
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'SLF4J', a simple logging
 facade for Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.slf4j.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.slf4j.txt (MIT License)
   * HOMEPAGE:
     * http://www.slf4j.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Harmony', an open source
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Harmony', an open source
 Java SE, which can be obtained at:
 
   * NOTICE:
-    * deps/netty-4.1.63.Final/NOTICE.harmony.txt
+    * deps/netty-4.1.68.Final/NOTICE.harmony.txt
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.harmony.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.harmony.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://archive.apache.org/dist/harmony/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
 and decompression library written by Matthew J. Francis. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jbzip2.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jbzip2.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jbzip2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'libdivsufsort', a C API library to construct
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.libdivsufsort.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.libdivsufsort.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/y-256/libdivsufsort
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
 Java Concurrency Tools for the JVM, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jctools.txt (ASL2 License)
+    * deps/netty-4.1.68.Final/LICENSE.jctools.txt (ASL2 License)
   * HOMEPAGE:
     * https://github.com/JCTools/JCTools
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
 pure Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jzlib.txt (BSD style License)
+    * deps/netty-4.1.68.Final/LICENSE.jzlib.txt (BSD style License)
   * HOMEPAGE:
     * http://www.jcraft.com/jzlib/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Compress-LZF', a Java library for encoding and
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/ning/compress
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lz4', a LZ4 Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lz4', a LZ4 Java compression
 and decompression library written by Adrien Grand. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lz4.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lz4.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jpountz/lz4-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
 and decompression library, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lzma-java.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lzma-java.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jponge/lzma-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jfastlz', a Java port of FastLZ compression
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.jfastlz.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jfastlz.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jfastlz/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
 Google's data interchange format, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.protobuf.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.protobuf.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/protobuf
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
 a temporary self-signed X.509 certificate when the JVM does not provide the
 equivalent functionality.  It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.bouncycastle.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.bouncycastle.txt (MIT License)
   * HOMEPAGE:
     * http://www.bouncycastle.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Snappy', a compression library produced
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Snappy', a compression library produced
 by Google Inc, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.snappy.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.snappy.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/snappy
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
 serialization API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jboss-remoting/jboss-marshalling
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Caliper', Google's micro-
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Caliper', Google's micro-
 benchmarking framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.caliper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.caliper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/google/caliper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Commons Logging', a logging
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Commons Logging', a logging
 framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-logging.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-logging.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://commons.apache.org/logging/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
 can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.log4j.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.log4j.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://logging.apache.org/log4j/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
 non-blocking XML processor, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://wiki.fasterxml.com/AaltoHome
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hpack.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.hpack.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/twitter/hpack
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hyper-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.hyper-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/python-hyper/hpack/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.nghttp2-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.nghttp2-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/nghttp2/nghttp2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
 provides utilities for the java.lang API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-lang.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-lang.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://commons.apache.org/proper/commons-lang/
 
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the Maven wrapper scripts from 'Maven Wrapper',
+lib/io.netty-netty-codec-4.1.68.Final.jar 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.
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/takari/maven-wrapper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the dnsinfo.h header file,
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h
 
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
index 7189cc0..b02283b 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
@@ -217,19 +217,19 @@ Apache Software License, Version 2.
 - lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
-- lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar [11]
-- lib/io.netty-netty-common-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar [11]
-- lib/io.netty-netty-resolver-4.1.63.Final.jar [11]
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar [11]
-- lib/io.netty-netty-transport-4.1.63.Final.jar [11]
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar [11]
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar [11]
+- lib/io.netty-netty-buffer-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar [11]
+- lib/io.netty-netty-common-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar [11]
+- lib/io.netty-netty-resolver-4.1.68.Final.jar [11]
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar [11]
+- lib/io.netty-netty-transport-4.1.68.Final.jar [11]
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar [11]
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar [11]
 - lib/log4j-log4j-1.2.17.jar [16]
 - lib/net.java.dev.jna-jna-3.2.7.jar [17]
 - lib/org.apache.commons-commons-collections4-4.1.jar [18]
@@ -289,7 +289,7 @@ Apache Software License, Version 2.
 [8] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-io.git;a=tag;h=603579
 [9] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=tag;h=375459
 [10] Source available at http://svn.apache.org/viewvc/commons/proper/logging/tags/commons-logging-1.1.1/
-[11] Source available at https://github.com/netty/netty/tree/netty-4.1.63.Final
+[11] Source available at https://github.com/netty/netty/tree/netty-4.1.68.Final
 [16] Source available at http://logging.apache.org/log4j/1.2/download.html
 [17] Source available at https://github.com/java-native-access/jna/tree/3.2.7
 [18] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-collections.git;a=tag;h=a3a5ad
@@ -320,229 +320,229 @@ Apache Software License, Version 2.
 [50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
 
 ------------------------------------------------------------------------------------
-lib/io.netty-netty-codec-4.1.63.Final.jar bundles some 3rd party dependencies
+lib/io.netty-netty-codec-4.1.68.Final.jar bundles some 3rd party dependencies
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the extensions to Java Collections Framework which has
+lib/io.netty-netty-codec-4.1.68.Final.jar contains the extensions to Java Collections Framework which has
 been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jsr166y.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.jsr166y.txt (Public Domain)
   * HOMEPAGE:
     * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
     * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of Robert Harder's Public Domain
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of Robert Harder's Public Domain
 Base64 Encoder and Decoder, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.base64.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.base64.txt (Public Domain)
   * HOMEPAGE:
     * http://iharder.sourceforge.net/current/java/base64/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Webbit', an event based
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Webbit', an event based
 WebSocket and HTTP server, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.webbit.txt (BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.webbit.txt (BSD License)
   * HOMEPAGE:
     * https://github.com/joewalnes/webbit
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'SLF4J', a simple logging
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'SLF4J', a simple logging
 facade for Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.slf4j.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.slf4j.txt (MIT License)
   * HOMEPAGE:
     * http://www.slf4j.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Harmony', an open source
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Harmony', an open source
 Java SE, which can be obtained at:
 
   * NOTICE:
-    * deps/netty-4.1.63.Final/NOTICE.harmony.txt
+    * deps/netty-4.1.68.Final/NOTICE.harmony.txt
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.harmony.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.harmony.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://archive.apache.org/dist/harmony/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
 and decompression library written by Matthew J. Francis. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jbzip2.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jbzip2.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jbzip2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'libdivsufsort', a C API library to construct
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.libdivsufsort.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.libdivsufsort.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/y-256/libdivsufsort
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
 Java Concurrency Tools for the JVM, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jctools.txt (ASL2 License)
+    * deps/netty-4.1.68.Final/LICENSE.jctools.txt (ASL2 License)
   * HOMEPAGE:
     * https://github.com/JCTools/JCTools
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
 pure Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jzlib.txt (BSD style License)
+    * deps/netty-4.1.68.Final/LICENSE.jzlib.txt (BSD style License)
   * HOMEPAGE:
     * http://www.jcraft.com/jzlib/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Compress-LZF', a Java library for encoding and
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/ning/compress
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lz4', a LZ4 Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lz4', a LZ4 Java compression
 and decompression library written by Adrien Grand. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lz4.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lz4.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jpountz/lz4-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
 and decompression library, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lzma-java.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lzma-java.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jponge/lzma-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jfastlz', a Java port of FastLZ compression
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.jfastlz.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jfastlz.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jfastlz/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
 Google's data interchange format, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.protobuf.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.protobuf.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/protobuf
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
 a temporary self-signed X.509 certificate when the JVM does not provide the
 equivalent functionality.  It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.bouncycastle.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.bouncycastle.txt (MIT License)
   * HOMEPAGE:
     * http://www.bouncycastle.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Snappy', a compression library produced
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Snappy', a compression library produced
 by Google Inc, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.snappy.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.snappy.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/snappy
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
 serialization API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jboss-remoting/jboss-marshalling
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Caliper', Google's micro-
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Caliper', Google's micro-
 benchmarking framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.caliper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.caliper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/google/caliper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Commons Logging', a logging
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Commons Logging', a logging
 framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-logging.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-logging.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://commons.apache.org/logging/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
 can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.log4j.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.log4j.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://logging.apache.org/log4j/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
 non-blocking XML processor, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://wiki.fasterxml.com/AaltoHome
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hpack.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.hpack.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/twitter/hpack
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hyper-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.hyper-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/python-hyper/hpack/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.nghttp2-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.nghttp2-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/nghttp2/nghttp2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
 provides utilities for the java.lang API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-lang.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-lang.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://commons.apache.org/proper/commons-lang/
 
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the Maven wrapper scripts from 'Maven Wrapper',
+lib/io.netty-netty-codec-4.1.68.Final.jar 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.
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/takari/maven-wrapper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the dnsinfo.h header file,
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h
 
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
index 290d937..207bf34 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
@@ -217,21 +217,21 @@ Apache Software License, Version 2.
 - lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
-- lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-dns-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar [11]
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar [11]
-- lib/io.netty-netty-common-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-4.1.63.Final.jar [11]
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar [11]
-- lib/io.netty-netty-resolver-4.1.63.Final.jar [11]
-- lib/io.netty-netty-resolver-dns-4.1.63.Final.jar [11]
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar [11]
-- lib/io.netty-netty-transport-4.1.63.Final.jar [11]
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar [11]
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar [11]
+- lib/io.netty-netty-buffer-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-dns-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar [11]
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar [11]
+- lib/io.netty-netty-common-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-4.1.68.Final.jar [11]
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar [11]
+- lib/io.netty-netty-resolver-4.1.68.Final.jar [11]
+- lib/io.netty-netty-resolver-dns-4.1.68.Final.jar [11]
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar [11]
+- lib/io.netty-netty-transport-4.1.68.Final.jar [11]
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar [11]
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar [11]
 - lib/io.prometheus-simpleclient-0.8.1.jar [12]
 - lib/io.prometheus-simpleclient_common-0.8.1.jar [12]
 - lib/io.prometheus-simpleclient_hotspot-0.8.1.jar [12]
@@ -310,7 +310,7 @@ Apache Software License, Version 2.
 [8] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-io.git;a=tag;h=603579
 [9] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=tag;h=375459
 [10] Source available at http://svn.apache.org/viewvc/commons/proper/logging/tags/commons-logging-1.1.1/
-[11] Source available at https://github.com/netty/netty/tree/netty-4.1.63.Final
+[11] Source available at https://github.com/netty/netty/tree/netty-4.1.68.Final
 [12] Source available at https://github.com/prometheus/client_java/tree/parent-0.8.1
 [13] Source available at https://github.com/vert-x3/vertx-auth/tree/3.9.8
 [14] Source available at https://github.com/vert-x3/vertx-bridge-common/tree/3.9.8
@@ -349,229 +349,229 @@ Apache Software License, Version 2.
 [50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
 
 ------------------------------------------------------------------------------------
-lib/io.netty-netty-codec-4.1.63.Final.jar bundles some 3rd party dependencies
+lib/io.netty-netty-codec-4.1.68.Final.jar bundles some 3rd party dependencies
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the extensions to Java Collections Framework which has
+lib/io.netty-netty-codec-4.1.68.Final.jar contains the extensions to Java Collections Framework which has
 been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jsr166y.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.jsr166y.txt (Public Domain)
   * HOMEPAGE:
     * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
     * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of Robert Harder's Public Domain
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of Robert Harder's Public Domain
 Base64 Encoder and Decoder, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.base64.txt (Public Domain)
+    * deps/netty-4.1.68.Final/LICENSE.base64.txt (Public Domain)
   * HOMEPAGE:
     * http://iharder.sourceforge.net/current/java/base64/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Webbit', an event based
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Webbit', an event based
 WebSocket and HTTP server, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.webbit.txt (BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.webbit.txt (BSD License)
   * HOMEPAGE:
     * https://github.com/joewalnes/webbit
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'SLF4J', a simple logging
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'SLF4J', a simple logging
 facade for Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.slf4j.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.slf4j.txt (MIT License)
   * HOMEPAGE:
     * http://www.slf4j.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Harmony', an open source
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Harmony', an open source
 Java SE, which can be obtained at:
 
   * NOTICE:
-    * deps/netty-4.1.63.Final/NOTICE.harmony.txt
+    * deps/netty-4.1.68.Final/NOTICE.harmony.txt
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.harmony.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.harmony.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://archive.apache.org/dist/harmony/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'jbzip2', a Java bzip2 compression
 and decompression library written by Matthew J. Francis. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jbzip2.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jbzip2.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jbzip2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'libdivsufsort', a C API library to construct
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.libdivsufsort.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.libdivsufsort.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/y-256/libdivsufsort
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of Nitsan Wakart's 'JCTools',
 Java Concurrency Tools for the JVM, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jctools.txt (ASL2 License)
+    * deps/netty-4.1.68.Final/LICENSE.jctools.txt (ASL2 License)
   * HOMEPAGE:
     * https://github.com/JCTools/JCTools
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JZlib', a re-implementation of zlib in
 pure Java, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jzlib.txt (BSD style License)
+    * deps/netty-4.1.68.Final/LICENSE.jzlib.txt (BSD style License)
   * HOMEPAGE:
     * http://www.jcraft.com/jzlib/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Compress-LZF', a Java library for encoding and
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.compress-lzf.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/ning/compress
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lz4', a LZ4 Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lz4', a LZ4 Java compression
 and decompression library written by Adrien Grand. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lz4.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lz4.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jpountz/lz4-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
 and decompression library, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.lzma-java.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.lzma-java.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jponge/lzma-java
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'jfastlz', a Java port of FastLZ compression
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.jfastlz.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.jfastlz.txt (MIT License)
   * HOMEPAGE:
     * https://code.google.com/p/jfastlz/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of and optionally depends on 'Protocol Buffers',
 Google's data interchange format, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.protobuf.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.protobuf.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/protobuf
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Bouncy Castle Crypto APIs' to generate
 a temporary self-signed X.509 certificate when the JVM does not provide the
 equivalent functionality.  It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.bouncycastle.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.bouncycastle.txt (MIT License)
   * HOMEPAGE:
     * http://www.bouncycastle.org/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Snappy', a compression library produced
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Snappy', a compression library produced
 by Google Inc, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.snappy.txt (New BSD License)
+    * deps/netty-4.1.68.Final/LICENSE.snappy.txt (New BSD License)
   * HOMEPAGE:
     * https://github.com/google/snappy
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'JBoss Marshalling', an alternative Java
 serialization API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.jboss-marshalling.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/jboss-remoting/jboss-marshalling
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Caliper', Google's micro-
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Caliper', Google's micro-
 benchmarking framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.caliper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.caliper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/google/caliper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Commons Logging', a logging
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Commons Logging', a logging
 framework, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-logging.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-logging.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://commons.apache.org/logging/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Apache Log4J', a logging framework, which
 can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.log4j.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.log4j.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://logging.apache.org/log4j/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
+lib/io.netty-netty-codec-4.1.68.Final.jar optionally depends on 'Aalto XML', an ultra-high performance
 non-blocking XML processor, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.aalto-xml.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://wiki.fasterxml.com/AaltoHome
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hpack.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.hpack.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/twitter/hpack
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.hyper-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.hyper-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/python-hyper/hpack/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified version of 'HPACK', a Java implementation of
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified version of 'HPACK', a Java implementation of
 the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.nghttp2-hpack.txt (MIT License)
+    * deps/netty-4.1.68.Final/LICENSE.nghttp2-hpack.txt (MIT License)
   * HOMEPAGE:
     * https://github.com/nghttp2/nghttp2/
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
+lib/io.netty-netty-codec-4.1.68.Final.jar contains a modified portion of 'Apache Commons Lang', a Java library
 provides utilities for the java.lang API, which can be obtained at:
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.commons-lang.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.commons-lang.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://commons.apache.org/proper/commons-lang/
 
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the Maven wrapper scripts from 'Maven Wrapper',
+lib/io.netty-netty-codec-4.1.68.Final.jar 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.
 
   * LICENSE:
-    * deps/netty-4.1.63.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.mvn-wrapper.txt (Apache License 2.0)
   * HOMEPAGE:
     * https://github.com/takari/maven-wrapper
 
-lib/io.netty-netty-codec-4.1.63.Final.jar contains the dnsinfo.h header file,
+lib/io.netty-netty-codec-4.1.68.Final.jar 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:
-    * deps/netty-4.1.63.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
+    * deps/netty-4.1.68.Final/LICENSE.dnsinfo.txt (Apache License 2.0)
   * HOMEPAGE:
     * http://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h
 
diff --git a/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt b/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
index 043c371..76e5637 100644
--- a/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
@@ -22,21 +22,21 @@ LongAdder), which was released with the following comments:
     http://creativecommons.org/publicdomain/zero/1.0/
 
 ------------------------------------------------------------------------------------
-- lib/io.netty-netty-buffer-4.1.63.Final.jar
-- lib/io.netty-netty-codec-4.1.63.Final.jar
-- lib/io.netty-netty-codec-dns-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar
-- lib/io.netty-netty-common-4.1.63.Final.jar
-- lib/io.netty-netty-handler-4.1.63.Final.jar
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar
-- lib/io.netty-netty-resolver-4.1.63.Final.jar
-- lib/io.netty-netty-resolver-dns-4.1.63.Final.jar
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar
-- lib/io.netty-netty-transport-4.1.63.Final.jar
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar
+- lib/io.netty-netty-buffer-4.1.68.Final.jar
+- lib/io.netty-netty-codec-4.1.68.Final.jar
+- lib/io.netty-netty-codec-dns-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar
+- lib/io.netty-netty-common-4.1.68.Final.jar
+- lib/io.netty-netty-handler-4.1.68.Final.jar
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar
+- lib/io.netty-netty-resolver-4.1.68.Final.jar
+- lib/io.netty-netty-resolver-dns-4.1.68.Final.jar
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar
+- lib/io.netty-netty-transport-4.1.68.Final.jar
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar
 
 
                             The Netty Project
diff --git a/bookkeeper-dist/src/main/resources/NOTICE-bkctl.bin.txt b/bookkeeper-dist/src/main/resources/NOTICE-bkctl.bin.txt
index d4bf93c..93aa17f 100644
--- a/bookkeeper-dist/src/main/resources/NOTICE-bkctl.bin.txt
+++ b/bookkeeper-dist/src/main/resources/NOTICE-bkctl.bin.txt
@@ -5,19 +5,19 @@ This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
 ------------------------------------------------------------------------------------
-- lib/io.netty-netty-buffer-4.1.63.Final.jar
-- lib/io.netty-netty-codec-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar
-- lib/io.netty-netty-common-4.1.63.Final.jar
-- lib/io.netty-netty-handler-4.1.63.Final.jar
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar
-- lib/io.netty-netty-resolver-4.1.63.Final.jar
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar
-- lib/io.netty-netty-transport-4.1.63.Final.jar
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar
+- lib/io.netty-netty-buffer-4.1.68.Final.jar
+- lib/io.netty-netty-codec-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar
+- lib/io.netty-netty-common-4.1.68.Final.jar
+- lib/io.netty-netty-handler-4.1.68.Final.jar
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar
+- lib/io.netty-netty-resolver-4.1.68.Final.jar
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar
+- lib/io.netty-netty-transport-4.1.68.Final.jar
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar
 
 
                             The Netty Project
diff --git a/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt b/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
index 0ede3b7..56e37cd 100644
--- a/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
@@ -5,21 +5,21 @@ This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
 ------------------------------------------------------------------------------------
-- lib/io.netty-netty-buffer-4.1.63.Final.jar
-- lib/io.netty-netty-codec-4.1.63.Final.jar
-- lib/io.netty-netty-codec-dns-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http-4.1.63.Final.jar
-- lib/io.netty-netty-codec-http2-4.1.63.Final.jar
-- lib/io.netty-netty-codec-socks-4.1.63.Final.jar
-- lib/io.netty-netty-common-4.1.63.Final.jar
-- lib/io.netty-netty-handler-4.1.63.Final.jar
-- lib/io.netty-netty-handler-proxy-4.1.63.Final.jar
-- lib/io.netty-netty-resolver-4.1.63.Final.jar
-- lib/io.netty-netty-resolver-dns-4.1.63.Final.jar
-- lib/io.netty-netty-tcnative-boringssl-static-2.0.38.Final.jar
-- lib/io.netty-netty-transport-4.1.63.Final.jar
-- lib/io.netty-netty-transport-native-epoll-4.1.63.Final-linux-x86_64.jar
-- lib/io.netty-netty-transport-native-unix-common-4.1.63.Final.jar
+- lib/io.netty-netty-buffer-4.1.68.Final.jar
+- lib/io.netty-netty-codec-4.1.68.Final.jar
+- lib/io.netty-netty-codec-dns-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http-4.1.68.Final.jar
+- lib/io.netty-netty-codec-http2-4.1.68.Final.jar
+- lib/io.netty-netty-codec-socks-4.1.68.Final.jar
+- lib/io.netty-netty-common-4.1.68.Final.jar
+- lib/io.netty-netty-handler-4.1.68.Final.jar
+- lib/io.netty-netty-handler-proxy-4.1.68.Final.jar
+- lib/io.netty-netty-resolver-4.1.68.Final.jar
+- lib/io.netty-netty-resolver-dns-4.1.68.Final.jar
+- lib/io.netty-netty-tcnative-boringssl-static-2.0.42.Final.jar
+- lib/io.netty-netty-transport-4.1.68.Final.jar
+- lib/io.netty-netty-transport-native-epoll-4.1.68.Final-linux-x86_64.jar
+- lib/io.netty-netty-transport-native-unix-common-4.1.68.Final.jar
 
 
                             The Netty Project
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.aalto-xml.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.aalto-xml.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.aalto-xml.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.aalto-xml.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.base64.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.base64.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.base64.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.base64.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.bouncycastle.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.bouncycastle.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.bouncycastle.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.bouncycastle.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.caliper.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.caliper.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.caliper.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.caliper.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.commons-lang.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.commons-lang.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.commons-lang.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.commons-lang.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.commons-logging.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.commons-logging.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.commons-logging.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.commons-logging.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.compress-lzf.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.compress-lzf.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.compress-lzf.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.compress-lzf.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.dnsinfo.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.dnsinfo.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.dnsinfo.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.dnsinfo.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.harmony.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.harmony.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.harmony.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.harmony.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.hpack.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.hpack.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.hpack.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.hpack.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.hyper-hpack.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.hyper-hpack.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.hyper-hpack.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.hyper-hpack.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jboss-marshalling.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jboss-marshalling.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jboss-marshalling.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jboss-marshalling.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jbzip2.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jbzip2.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jbzip2.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jbzip2.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jctools.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jctools.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jctools.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jctools.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jfastlz.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jfastlz.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jfastlz.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jfastlz.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jsr166y.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jsr166y.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jsr166y.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jsr166y.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jzlib.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jzlib.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.jzlib.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.jzlib.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.libdivsufsort.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.libdivsufsort.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.libdivsufsort.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.libdivsufsort.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.log4j.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.log4j.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.log4j.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.log4j.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.lz4.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.lz4.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.lz4.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.lz4.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.lzma-java.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.lzma-java.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.lzma-java.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.lzma-java.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.mvn-wrapper.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.mvn-wrapper.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.mvn-wrapper.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.mvn-wrapper.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.nghttp2-hpack.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.nghttp2-hpack.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.nghttp2-hpack.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.nghttp2-hpack.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.protobuf.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.protobuf.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.protobuf.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.protobuf.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.slf4j.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.slf4j.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.slf4j.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.slf4j.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.snappy.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.snappy.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.snappy.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.snappy.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.webbit.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.webbit.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/LICENSE.webbit.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/LICENSE.webbit.txt
diff --git a/bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/NOTICE.harmony.txt b/bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/NOTICE.harmony.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/netty-4.1.63.Final/NOTICE.harmony.txt
rename to bookkeeper-dist/src/main/resources/deps/netty-4.1.68.Final/NOTICE.harmony.txt
diff --git a/dependencies.gradle b/dependencies.gradle
index 1e12e79..0cc5f94 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -62,8 +62,8 @@ depVersions = [
     lombok: "1.18.20",
     lz4: "1.3.0",
     mockito: "3.0.0",
-    netty: "4.1.63.Final",
-    nettyTcnativeBoringSsl: "2.0.38.Final",
+    netty: "4.1.68.Final",
+    nettyTcnativeBoringSsl: "2.0.42.Final",
     powermock: "2.0.2",
     prometheus: "0.0.21",
     protobuf: "3.14.0",
diff --git a/pom.xml b/pom.xml
index a1cd50f..f9d01f3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -147,8 +147,8 @@
     <lombok.version>1.18.20</lombok.version>
     <lz4.version>1.3.0</lz4.version>
     <mockito.version>3.0.0</mockito.version>
-    <netty.version>4.1.63.Final</netty.version>
-    <netty-boringssl.version>2.0.38.Final</netty-boringssl.version>
+    <netty.version>4.1.68.Final</netty.version>
+    <netty-boringssl.version>2.0.42.Final</netty-boringssl.version>
     <ostrich.version>9.1.3</ostrich.version>
     <powermock.version>2.0.2</powermock.version>
     <prometheus.version>0.8.1</prometheus.version>

[bookkeeper] 09/11: Release semaphore when addEntry accepts the same entries (#2832)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 82c4e1ceb6b3f48a17a44a8afea2c39e2eb34e99
Author: Yunze Xu <xy...@163.com>
AuthorDate: Sun Oct 17 06:00:04 2021 +0800

    Release semaphore when addEntry accepts the same entries (#2832)
    
    (cherry picked from commit a9b576da2f7f974ce46789dd8308240d18765754)
---
 .../org/apache/bookkeeper/bookie/EntryMemTable.java  |  3 +++
 .../apache/bookkeeper/bookie/EntryMemTableTest.java  | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
index f54d73a..840f681 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryMemTable.java
@@ -320,6 +320,9 @@ public class EntryMemTable implements AutoCloseable{
             try {
                 EntryKeyValue toAdd = cloneWithAllocator(ledgerId, entryId, entry);
                 size = internalAdd(toAdd);
+                if (size == 0) {
+                    skipListSemaphore.release(len);
+                }
             } finally {
                 this.lock.readLock().unlock();
             }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryMemTableTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryMemTableTest.java
index 946af02..f067f11 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryMemTableTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryMemTableTest.java
@@ -451,5 +451,25 @@ public class EntryMemTableTest implements CacheCallback, SkipListFlusher, Checkp
             assertEquals("listOfEntries should be sorted", Long.valueOf(i + 1), listOfEntries.get(i));
         }
     }
+
+    @Test
+    public void testAddSameEntries() throws IOException {
+        final long ledgerId = 1;
+        final long entryId = 1;
+        final int size = 10;
+        final byte[] bytes = new byte[size];
+        final int initialPermits = memTable.skipListSemaphore.availablePermits();
+
+        for (int i = 0; i < 5; i++) {
+            memTable.addEntry(ledgerId, entryId, ByteBuffer.wrap(bytes), this);
+            assertEquals(memTable.kvmap.size(), 1);
+            assertEquals(memTable.skipListSemaphore.availablePermits(), initialPermits - size);
+        }
+
+        memTable.snapshot(Checkpoint.MAX);
+        memTable.flush(this);
+        assertEquals(memTable.kvmap.size(), 0);
+        assertEquals(memTable.skipListSemaphore.availablePermits(), initialPermits);
+    }
 }
 

[bookkeeper] 06/11: Add ensemble check to over-replicated ledger GC (#2813)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit b903f6494bb58c07cc6ad9724e63541d67e7a88f
Author: shustsud <51...@users.noreply.github.com>
AuthorDate: Fri Oct 22 11:43:23 2021 +0900

    Add ensemble check to over-replicated ledger GC (#2813)
    
    ### Motivation
    - Issue is as described in [PR#2797](https://github.com/apache/bookkeeper/pull/2797).
    > In one day, zookeepers became high cpu usage and disk full.
    > The cause of this is bookie's gc of overreplicated ledgers.
    > Gc created/deleted zk nodes under /ledgers/underreplication/locks very frequently and some bookies ran gc at same time.
    > As a result, zookeepers created a lot of snapshots and became disk full.
    
    - I want to reduce the number of lock node creations and deletions in ZK.
    
    ### Changes
    - Add an ensemble check before creating the lock node.
    This is to reduce the number of lock node creations and deletions in ZK.
    
    - ~~If [PR#2797](https://github.com/apache/bookkeeper/pull/2797) was merged, this PR needs to be fixed.~~
    
    (cherry picked from commit 53954caae3a4f40cf0a45718d306b6a8555c54e2)
---
 .../bookie/ScanAndCompareGarbageCollector.java     | 47 +++++++++++++---------
 1 file changed, 29 insertions(+), 18 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
index 82f8924..72fd797 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
@@ -231,8 +231,12 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector {
 
         for (final Long ledgerId : bkActiveledgers) {
             try {
-                // check if the ledger is being replicated already by the replication worker
-                if (lum.isLedgerBeingReplicated(ledgerId)) {
+                // check ledger ensembles before creating lock nodes.
+                // this is to reduce the number of lock node creations and deletions in ZK.
+                // the ensemble check is done again after the lock node is created.
+                // also, check if the ledger is being replicated already by the replication worker
+                Versioned<LedgerMetadata> preCheckMetadata = ledgerManager.readLedgerMetadata(ledgerId).get();
+                if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata) || lum.isLedgerBeingReplicated(ledgerId)) {
                     latch.countDown();
                     continue;
                 }
@@ -245,23 +249,12 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector {
                     .whenComplete((metadata, exception) -> {
                             try {
                                 if (exception == null) {
-                                    // do not delete a ledger that is not closed, since the ensemble might
-                                    // change again and include the current bookie while we are deleting it
-                                    if (!metadata.getValue().isClosed()) {
-                                        return;
+                                    if (isNotBookieIncludedInLedgerEnsembles(metadata)) {
+                                        // this bookie is not supposed to have this ledger,
+                                        // thus we can delete this ledger now
+                                        overReplicatedLedgers.add(ledgerId);
+                                        garbageCleaner.clean(ledgerId);
                                     }
-                                    SortedMap<Long, ? extends List<BookieId>> ensembles =
-                                        metadata.getValue().getAllEnsembles();
-                                    for (List<BookieId> ensemble : ensembles.values()) {
-                                        // check if this bookie is supposed to have this ledger
-                                        if (ensemble.contains(selfBookieAddress)) {
-                                            return;
-                                        }
-                                    }
-                                    // this bookie is not supposed to have this ledger,
-                                    // thus we can delete this ledger now
-                                    overReplicatedLedgers.add(ledgerId);
-                                    garbageCleaner.clean(ledgerId);
                                 }
                             } finally {
                                 semaphore.release();
@@ -302,4 +295,22 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector {
         }
     }
 
+    private boolean isNotBookieIncludedInLedgerEnsembles(Versioned<LedgerMetadata> metadata) {
+        // do not delete a ledger that is not closed, since the ensemble might
+        // change again and include the current bookie while we are deleting it
+        if (!metadata.getValue().isClosed()) {
+            return false;
+        }
+
+        SortedMap<Long, ? extends List<BookieId>> ensembles =
+                metadata.getValue().getAllEnsembles();
+        for (List<BookieId> ensemble : ensembles.values()) {
+            // check if this bookie is supposed to have this ledger
+            if (ensemble.contains(selfBookieAddress)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
 }

[bookkeeper] 02/11: fix-npe-when-pulsar-ZkBookieRackAffinityMapping-getBookieAddressResolver (#2788)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 6041ded98f44fe6bcc8edd3eed14be4a41358112
Author: gaozhangmin <ga...@qq.com>
AuthorDate: Thu Oct 21 20:48:47 2021 +0800

    fix-npe-when-pulsar-ZkBookieRackAffinityMapping-getBookieAddressResolver (#2788)
    
    Error log:
    
    `16:21:20.140 [main] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Failed to initialize DNS Resolver org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping, used default subnet resolver : java.lang.RuntimeException: java.lang.NullPointerException java.lang.NullPointerException`
    
    `BookieAddressResolver` should be set before  `((Configurable) dnsResolver).setConf(conf);`
    
    It will throw npe. when pulsar `ZkBookieRackAffinityMapping` invoke getBookieAddressResolver
    
    (cherry picked from commit 031d168abdeedb6acbee7839c902a184f083da4c)
---
 .../client/RackawareEnsemblePlacementPolicyImpl.java       |  9 ++++-----
 .../client/ZoneawareEnsemblePlacementPolicyImpl.java       |  1 +
 .../client/TestRackawareEnsemblePlacementPolicy.java       | 14 ++++++++++++++
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
index 679aec3..a4e3c80 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
@@ -260,6 +260,7 @@ public class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
             String dnsResolverName = conf.getString(REPP_DNS_RESOLVER_CLASS, ScriptBasedMapping.class.getName());
             try {
                 dnsResolver = ReflectionUtils.newInstance(dnsResolverName, DNSToSwitchMapping.class);
+                dnsResolver.setBookieAddressResolver(bookieAddressResolver);
                 if (dnsResolver instanceof Configurable) {
                     ((Configurable) dnsResolver).setConf(conf);
                 }
@@ -269,9 +270,10 @@ public class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
                 }
             } catch (RuntimeException re) {
                 if (!conf.getEnforceMinNumRacksPerWriteQuorum()) {
-                    LOG.error("Failed to initialize DNS Resolver {}, used default subnet resolver : {} {}",
-                            dnsResolverName, re, re.getMessage());
+                    LOG.error("Failed to initialize DNS Resolver {}, used default subnet resolver ",
+                            dnsResolverName, re);
                     dnsResolver = new DefaultResolver(this::getDefaultRack);
+                    dnsResolver.setBookieAddressResolver(bookieAddressResolver);
                 } else {
                     /*
                      * if minNumRacksPerWriteQuorum is enforced, then it
@@ -282,9 +284,6 @@ public class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
                 }
             }
         }
-        if (dnsResolver != null) {
-            dnsResolver.setBookieAddressResolver(bookieAddressResolver);
-        }
         slowBookies = CacheBuilder.newBuilder()
             .expireAfterWrite(conf.getBookieFailureHistoryExpirationMSec(), TimeUnit.MILLISECONDS)
             .build(new CacheLoader<BookieId, Long>() {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ZoneawareEnsemblePlacementPolicyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ZoneawareEnsemblePlacementPolicyImpl.java
index 990d60f..61b81ed 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ZoneawareEnsemblePlacementPolicyImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ZoneawareEnsemblePlacementPolicyImpl.java
@@ -233,6 +233,7 @@ public class ZoneawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsembleP
         } else {
             String dnsResolverName = conf.getString(REPP_DNS_RESOLVER_CLASS, ScriptBasedMapping.class.getName());
             actualDNSResolver = ReflectionUtils.newInstance(dnsResolverName, DNSToSwitchMapping.class);
+            actualDNSResolver.setBookieAddressResolver(bookieAddressResolver);
             if (actualDNSResolver instanceof Configurable) {
                 ((Configurable) actualDNSResolver).setConf(conf);
             }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java
index f0520d4..28a27ee 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java
@@ -43,13 +43,16 @@ import org.apache.bookkeeper.client.EnsemblePlacementPolicy.PlacementPolicyAdher
 import org.apache.bookkeeper.client.ITopologyAwareEnsemblePlacementPolicy.Ensemble;
 import org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.EnsembleForReplacementWithNoConstraints;
 import org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.TruePredicate;
+import org.apache.bookkeeper.common.util.ReflectionUtils;
 import org.apache.bookkeeper.conf.ClientConfiguration;
+import org.apache.bookkeeper.net.AbstractDNSToSwitchMapping;
 import org.apache.bookkeeper.net.BookieId;
 import org.apache.bookkeeper.net.BookieNode;
 import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.net.DNSToSwitchMapping;
 import org.apache.bookkeeper.net.NetworkTopology;
 import org.apache.bookkeeper.net.Node;
+import org.apache.bookkeeper.net.ScriptBasedMapping;
 import org.apache.bookkeeper.proto.BookieAddressResolver;
 import org.apache.bookkeeper.stats.Gauge;
 import org.apache.bookkeeper.stats.NullStatsLogger;
@@ -147,6 +150,17 @@ public class TestRackawareEnsemblePlacementPolicy extends TestCase {
     }
 
     @Test
+    public void testInitalize() throws Exception{
+        String dnsResolverName = conf.getString(REPP_DNS_RESOLVER_CLASS, ScriptBasedMapping.class.getName());
+        DNSToSwitchMapping dnsResolver = ReflectionUtils.newInstance(dnsResolverName, DNSToSwitchMapping.class);
+        AbstractDNSToSwitchMapping tmp = (AbstractDNSToSwitchMapping) dnsResolver;
+        assertNull(tmp.getBookieAddressResolver());
+
+        dnsResolver.setBookieAddressResolver(repp.bookieAddressResolver);
+        assertNotNull(tmp.getBookieAddressResolver());
+    }
+
+    @Test
     public void testNodeDown() throws Exception {
         repp.uninitalize();
         updateMyRack(NetworkTopology.DEFAULT_REGION_AND_RACK);

[bookkeeper] 11/11: Fix the compilation issue introduced by #2802 ---

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 9158bb910f2ecfb41dbcb091d7f23a9832ef16c9
Author: Yong Zhang <zh...@gmail.com>
AuthorDate: Tue Oct 26 09:13:11 2021 +0800

    Fix the compilation issue introduced by #2802
    ---
---
 .../org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
index d60451d..a977d20 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
@@ -397,10 +397,10 @@ public class AuditorPeriodicCheckTest extends BookKeeperClusterTestCase {
         }
 
         // create auditor and call `checkAllLedgers`
-        ServerConfiguration configuration = confByIndex(0);
+        ServerConfiguration configuration = bsConfs.get(0);
         configuration.setAuditorMaxNumberOfConcurrentOpenLedgerOperations(10);
 
-        Auditor auditor1 = new Auditor(BookieImpl.getBookieId(configuration).toString(),
+        Auditor auditor1 = new Auditor(Bookie.getBookieId(configuration).toString(),
             configuration, NullStatsLogger.INSTANCE);
         Auditor auditor = Mockito.spy(auditor1);
 

[bookkeeper] 07/11: Upgraded dependencies with CVEs (#2792)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 911c2e9f51301a9c87689b12065ef259b0655bf0
Author: Raúl Gracia <ra...@emc.com>
AuthorDate: Wed Oct 13 17:51:57 2021 +0200

    Upgraded dependencies with CVEs (#2792)
    
    (cherry picked from commit 354cf37c919d756a47691cc710a6e8d2f1933f2b)
---
 bookkeeper-dist/all/build.gradle                   |  2 +-
 bookkeeper-dist/bkctl/build.gradle                 |  2 +-
 bookkeeper-dist/server/build.gradle                |  2 +-
 bookkeeper-dist/src/assemble/bin-all.xml           |  2 +-
 bookkeeper-dist/src/assemble/bin-server.xml        |  2 +-
 bookkeeper-dist/src/assemble/bkctl.xml             |  2 +-
 .../src/main/resources/LICENSE-all.bin.txt         | 25 +++++++++++-----------
 .../src/main/resources/LICENSE-bkctl.bin.txt       | 10 ++++-----
 .../src/main/resources/LICENSE-server.bin.txt      | 25 +++++++++++-----------
 .../src/main/resources/NOTICE-all.bin.txt          | 15 +++++++------
 .../src/main/resources/NOTICE-server.bin.txt       | 15 +++++++------
 .../{slf4j-1.7.25 => slf4j-1.7.32}/LICENSE.txt     |  0
 dependencies.gradle                                |  8 +++----
 pom.xml                                            |  6 +++---
 14 files changed, 60 insertions(+), 56 deletions(-)

diff --git a/bookkeeper-dist/all/build.gradle b/bookkeeper-dist/all/build.gradle
index 9252105..54f44d3 100644
--- a/bookkeeper-dist/all/build.gradle
+++ b/bookkeeper-dist/all/build.gradle
@@ -71,7 +71,7 @@ def depLicences = [
         "scala-library-2.11.7/LICENSE.md",
         "scala-parser-combinators_2.11-1.0.4/LICENSE.md",
         "scala-reflect-2.11.8/LICENSE.md",
-        "slf4j-1.7.25/LICENSE.txt",
+        "slf4j-1.7.32/LICENSE.txt",
 ]
 
 distributions {
diff --git a/bookkeeper-dist/bkctl/build.gradle b/bookkeeper-dist/bkctl/build.gradle
index 23605ca..d31e3de 100644
--- a/bookkeeper-dist/bkctl/build.gradle
+++ b/bookkeeper-dist/bkctl/build.gradle
@@ -40,7 +40,7 @@ def depLicences = [
         "bouncycastle-1.0.2/LICENSE.html",
         "protobuf-3.14.0/LICENSE",
         "protobuf-3.12.0/LICENSE",
-        "slf4j-1.7.25/LICENSE.txt",
+        "slf4j-1.7.32/LICENSE.txt",
 ]
 
 distributions {
diff --git a/bookkeeper-dist/server/build.gradle b/bookkeeper-dist/server/build.gradle
index 6b32e3d..ccdbb7f 100644
--- a/bookkeeper-dist/server/build.gradle
+++ b/bookkeeper-dist/server/build.gradle
@@ -64,7 +64,7 @@ def depLicences = [
         "bouncycastle-1.0.2/LICENSE.html",
         "protobuf-3.14.0/LICENSE",
         "protobuf-3.12.0/LICENSE",
-        "slf4j-1.7.25/LICENSE.txt",
+        "slf4j-1.7.32/LICENSE.txt",
 ]
 distributions {
     main {
diff --git a/bookkeeper-dist/src/assemble/bin-all.xml b/bookkeeper-dist/src/assemble/bin-all.xml
index af03d6d..24a242f 100644
--- a/bookkeeper-dist/src/assemble/bin-all.xml
+++ b/bookkeeper-dist/src/assemble/bin-all.xml
@@ -66,7 +66,7 @@
         <include>scala-library-2.11.7/LICENSE.md</include>
         <include>scala-parser-combinators_2.11-1.0.4/LICENSE.md</include>
         <include>scala-reflect-2.11.8/LICENSE.md</include>
-        <include>slf4j-1.7.25/LICENSE.txt</include>
+        <include>slf4j-1.7.32/LICENSE.txt</include>
       </includes>
       <fileMode>644</fileMode>
     </fileSet>
diff --git a/bookkeeper-dist/src/assemble/bin-server.xml b/bookkeeper-dist/src/assemble/bin-server.xml
index 3e39afb..7157f39 100644
--- a/bookkeeper-dist/src/assemble/bin-server.xml
+++ b/bookkeeper-dist/src/assemble/bin-server.xml
@@ -56,7 +56,7 @@
         <include>bouncycastle-1.0.2/LICENSE.html</include>
         <include>protobuf-3.14.0/LICENSE</include>
         <include>protobuf-3.12.0/LICENSE</include>
-        <include>slf4j-1.7.25/LICENSE.txt</include>
+        <include>slf4j-1.7.32/LICENSE.txt</include>
       </includes>
       <fileMode>644</fileMode>
     </fileSet>
diff --git a/bookkeeper-dist/src/assemble/bkctl.xml b/bookkeeper-dist/src/assemble/bkctl.xml
index 5e67dd3..73fffc5 100644
--- a/bookkeeper-dist/src/assemble/bkctl.xml
+++ b/bookkeeper-dist/src/assemble/bkctl.xml
@@ -70,7 +70,7 @@
         <include>bouncycastle-1.0.2/LICENSE.html</include>
         <include>protobuf-3.14.0/LICENSE</include>
         <include>protobuf-3.12.0/LICENSE</include>
-        <include>slf4j-1.7.25/LICENSE.txt</include>
+        <include>slf4j-1.7.32/LICENSE.txt</include>
       </includes>
       <fileMode>644</fileMode>
     </fileSet>
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
index 1100a4f..104bd44 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
@@ -214,7 +214,7 @@ Apache Software License, Version 2.
 - lib/commons-cli-commons-cli-1.2.jar [5]
 - lib/commons-codec-commons-codec-1.6.jar [6]
 - lib/commons-configuration-commons-configuration-1.10.jar [7]
-- lib/commons-io-commons-io-2.4.jar [8]
+- lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
 - lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
@@ -248,12 +248,13 @@ Apache Software License, Version 2.
 - lib/org.apache.zookeeper-zookeeper-3.6.2.jar [21]
 - lib/org.apache.zookeeper-zookeeper-jute-3.6.2.jar [21]
 - lib/org.apache.zookeeper-zookeeper-3.6.2-tests.jar [21]
-- lib/org.eclipse.jetty-jetty-http-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-io-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-security-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-server-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-servlet-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar [22]
+- lib/org.eclipse.jetty-jetty-http-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-io-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-security-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-server-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-servlet-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-util-ajax-9.4.43.v20210629.jar [22]
 - lib/org.rocksdb-rocksdbjni-6.16.4.jar [23]
 - lib/com.beust-jcommander-1.78.jar [24]
 - lib/com.yahoo.datasketches-memory-0.8.3.jar [25]
@@ -322,7 +323,7 @@ Apache Software License, Version 2.
 [19] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-collections.git;a=tag;h=a3a5ad
 [20] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=shortlog;h=refs/tags/LANG_3_6
 [21] Source available at https://github.com/apache/zookeeper/tree/release-3.6.2
-[22] Source available at https://github.com/eclipse/jetty.project/tree/jetty-9.4.33.v20201020
+[22] Source available at https://github.com/eclipse/jetty.project/tree/jetty-9.4.43.v20210629
 [23] Source available at https://github.com/facebook/rocksdb/tree/v6.16.4
 [24] Source available at https://github.com/cbeust/jcommander/tree/1.78
 [25] Source available at https://github.com/DataSketches/sketches-core/tree/sketches-0.8.3
@@ -634,12 +635,12 @@ Bundled as lib/javax.servlet-javax.servlet-api-4.0.0.jar
 Source available at https://github.com/javaee/servlet-spec/tree/4.0.0
 ------------------------------------------------------------------------------------
 This product bundles Simple Logging Facade for Java, which is available under a
-MIT license. For details, see deps/slf4j-1.7.25/LICENSE.txt.
+MIT license. For details, see deps/slf4j-1.7.32/LICENSE.txt.
 
 Bundled as
-  - lib/org.slf4j-slf4j-api-1.7.25.jar
-  - lib/org.slf4j-slf4j-log4j12-1.7.25.jar
-Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.25
+  - lib/org.slf4j-slf4j-api-1.7.32.jar
+  - lib/org.slf4j-slf4j-log4j12-1.7.32.jar
+Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.32
 ------------------------------------------------------------------------------------
 This product bundles the Google Auth Library, which is available under a "3-clause BSD"
 license. For details, see deps/google-auth-library-credentials-0.20.0/LICENSE
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
index 5a89cab..7189cc0 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
@@ -214,7 +214,7 @@ Apache Software License, Version 2.
 - lib/commons-cli-commons-cli-1.2.jar [5]
 - lib/commons-codec-commons-codec-1.6.jar [6]
 - lib/commons-configuration-commons-configuration-1.10.jar [7]
-- lib/commons-io-commons-io-2.4.jar [8]
+- lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
 - lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
@@ -561,12 +561,12 @@ Source available at https://github.com/protocolbuffers/protobuf/tree/v3.12.0
 For details, see deps/protobuf-3.12.0/LICENSE.
 ------------------------------------------------------------------------------------
 This product bundles Simple Logging Facade for Java, which is available under a
-MIT license. For details, see deps/slf4j-1.7.25/LICENSE.txt.
+MIT license. For details, see deps/slf4j-1.7.32/LICENSE.txt.
 
 Bundled as
-  - lib/org.slf4j-slf4j-api-1.7.25.jar
-  - lib/org.slf4j-slf4j-log4j12-1.7.25.jar
-Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.25
+  - lib/org.slf4j-slf4j-api-1.7.32.jar
+  - lib/org.slf4j-slf4j-log4j12-1.7.32.jar
+Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.32
 ------------------------------------------------------------------------------------
 This product bundles the Google Auth Library, which is available under a "3-clause BSD"
 license. For details, see deps/google-auth-library-credentials-0.20.0/LICENSE
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
index e2474f7..290d937 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
@@ -214,7 +214,7 @@ Apache Software License, Version 2.
 - lib/commons-cli-commons-cli-1.2.jar [5]
 - lib/commons-codec-commons-codec-1.6.jar [6]
 - lib/commons-configuration-commons-configuration-1.10.jar [7]
-- lib/commons-io-commons-io-2.4.jar [8]
+- lib/commons-io-commons-io-2.7.jar [8]
 - lib/commons-lang-commons-lang-2.6.jar [9]
 - lib/commons-logging-commons-logging-1.1.1.jar [10]
 - lib/io.netty-netty-buffer-4.1.63.Final.jar [11]
@@ -248,12 +248,13 @@ Apache Software License, Version 2.
 - lib/org.apache.zookeeper-zookeeper-3.6.2.jar [21]
 - lib/org.apache.zookeeper-zookeeper-jute-3.6.2.jar [21]
 - lib/org.apache.zookeeper-zookeeper-3.6.2-tests.jar [21]
-- lib/org.eclipse.jetty-jetty-http-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-io-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-security-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-server-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-servlet-9.4.33.v20201020.jar [22]
-- lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar [22]
+- lib/org.eclipse.jetty-jetty-http-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-io-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-security-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-server-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-servlet-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar [22]
+- lib/org.eclipse.jetty-jetty-util-ajax-9.4.43.v20210629.jar [22]
 - lib/org.rocksdb-rocksdbjni-6.16.4.jar [23]
 - lib/com.beust-jcommander-1.78.jar [24]
 - lib/com.yahoo.datasketches-memory-0.8.3.jar [25]
@@ -320,7 +321,7 @@ Apache Software License, Version 2.
 [19] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-collections.git;a=tag;h=a3a5ad
 [20] Source available at https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=shortlog;h=refs/tags/LANG_3_6
 [21] Source available at https://github.com/apache/zookeeper/tree/release-3.6.2
-[22] Source available at https://github.com/eclipse/jetty.project/tree/jetty-9.4.33.v20201020
+[22] Source available at https://github.com/eclipse/jetty.project/tree/jetty-9.4.43.v20210629
 [23] Source available at https://github.com/facebook/rocksdb/tree/v6.16.4
 [24] Source available at https://github.com/cbeust/jcommander/tree/1.78
 [25] Source available at https://github.com/DataSketches/sketches-core/tree/sketches-0.8.3
@@ -626,12 +627,12 @@ Bundled as lib/javax.servlet-javax.servlet-api-4.0.0.jar
 Source available at https://github.com/javaee/servlet-spec/tree/4.0.0
 ------------------------------------------------------------------------------------
 This product bundles Simple Logging Facade for Java, which is available under a
-MIT license. For details, see deps/slf4j-1.7.25/LICENSE.txt.
+MIT license. For details, see deps/slf4j-1.7.32/LICENSE.txt.
 
 Bundled as
-  - lib/org.slf4j-slf4j-api-1.7.25.jar
-  - lib/org.slf4j-slf4j-log4j12-1.7.25.jar
-Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.25
+  - lib/org.slf4j-slf4j-api-1.7.32.jar
+  - lib/org.slf4j-slf4j-log4j12-1.7.32.jar
+Source available at https://github.com/qos-ch/slf4j/tree/v_1.7.32
 ------------------------------------------------------------------------------------
 This product bundles the Google Auth Library, which is available under a "3-clause BSD"
 license. For details, see deps/google-auth-library-credentials-0.20.0/LICENSE
diff --git a/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt b/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
index cefcd83..043c371 100644
--- a/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/NOTICE-all.bin.txt
@@ -78,12 +78,13 @@ SoundCloud Ltd. (http://soundcloud.com/).
 This product includes software developed as part of the
 Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
 ------------------------------------------------------------------------------------
-- lib/org.eclipse.jetty-jetty-http-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-io-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-security-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-server-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-servlet-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar
+- lib/org.eclipse.jetty-jetty-http-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-io-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-security-9.4.43.v20210629jar
+- lib/org.eclipse.jetty-jetty-server-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-servlet-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-util-ajax-9.4.43.v20210629.jar
 
 ==============================================================
  Jetty Web Container
@@ -105,7 +106,7 @@ Jetty is dual licensed under both
 
 Jetty may be distributed under either license.
 
-lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar bundles UnixCrypt
+lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar bundles UnixCrypt
 
 The UnixCrypt.java code implements the one way cryptography used by
 Unix systems for simple password protection.  Copyright 1996 Aki Yoshida,
diff --git a/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt b/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
index 962bd11..0ede3b7 100644
--- a/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/NOTICE-server.bin.txt
@@ -61,12 +61,13 @@ SoundCloud Ltd. (http://soundcloud.com/).
 This product includes software developed as part of the
 Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
 ------------------------------------------------------------------------------------
-- lib/org.eclipse.jetty-jetty-http-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-io-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-security-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-server-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-servlet-9.4.33.v20201020.jar
-- lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar
+- lib/org.eclipse.jetty-jetty-http-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-io-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-security-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-server-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-servlet-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar
+- lib/org.eclipse.jetty-jetty-util-ajax-9.4.43.v20210629.jar
 
 ==============================================================
  Jetty Web Container
@@ -88,7 +89,7 @@ Jetty is dual licensed under both
 
 Jetty may be distributed under either license.
 
-lib/org.eclipse.jetty-jetty-util-9.4.33.v20201020.jar bundles UnixCrypt
+lib/org.eclipse.jetty-jetty-util-9.4.43.v20210629.jar bundles UnixCrypt
 
 The UnixCrypt.java code implements the one way cryptography used by
 Unix systems for simple password protection.  Copyright 1996 Aki Yoshida,
diff --git a/bookkeeper-dist/src/main/resources/deps/slf4j-1.7.25/LICENSE.txt b/bookkeeper-dist/src/main/resources/deps/slf4j-1.7.32/LICENSE.txt
similarity index 100%
rename from bookkeeper-dist/src/main/resources/deps/slf4j-1.7.25/LICENSE.txt
rename to bookkeeper-dist/src/main/resources/deps/slf4j-1.7.32/LICENSE.txt
diff --git a/dependencies.gradle b/dependencies.gradle
index b0861df..1e12e79 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -25,13 +25,13 @@ depVersions = [
     arquillianCubeDocker: "1.18.2",
     arquillianJunit: "1.6.0.Final",
     bcFips: "1.0.2",
-    bouncycastle: "1.56",
+    bouncycastle: "1.69",
     commonsCli: "1.4",
     commonsCodec: "1.14",
     commonsCollections4: "4.1",
     commonsCompress: "1.19",
     commonsConfiguration: "1.10",
-    commonsIO: "2.4",
+    commonsIO: "2.7",
     commonsLang2: "2.6",
     commonsLang3: "3.6",
     commonsBeanutils: "1.9.3",
@@ -50,7 +50,7 @@ depVersions = [
     jackson: "2.11.1",
     jcommander: "1.78",
     jctools: "2.1.2",
-    jetty: "9.4.31.v20200723",
+    jetty: "9.4.43.v20210629",
     jmh: "1.19",
     jmock: "2.8.2",
     jna: "3.2.7",
@@ -58,7 +58,7 @@ depVersions = [
     junit: "4.12",
     junitFoundation: "11.0.0",
     kerby: "1.1.1",
-    log4j: "1.2.17",
+    log4j: "1.2.27",
     lombok: "1.18.20",
     lz4: "1.3.0",
     mockito: "3.0.0",
diff --git a/pom.xml b/pom.xml
index de52ae6..a1cd50f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -122,7 +122,7 @@
     <commons-compress.version>1.19</commons-compress.version>
     <commons-lang.version>2.6</commons-lang.version>
     <commons-lang3.version>3.6</commons-lang3.version>
-    <commons-io.version>2.4</commons-io.version>
+    <commons-io.version>2.7</commons-io.version>
     <bouncycastle.version>1.0.2</bouncycastle.version>
     <curator.version>5.1.0</curator.version>
     <dropwizard.version>3.2.5</dropwizard.version>
@@ -138,7 +138,7 @@
     <hdrhistogram.version>2.1.10</hdrhistogram.version>
     <jackson.version>2.11.0</jackson.version>
     <jcommander.version>1.78</jcommander.version>
-    <jetty.version>9.4.33.v20201020</jetty.version>
+    <jetty.version>9.4.43.v20210629</jetty.version>
     <jmh.version>1.19</jmh.version>
     <jmock.version>2.8.2</jmock.version>
     <jna.version>3.2.7</jna.version>
@@ -160,7 +160,7 @@
     <reflections.version>0.9.11</reflections.version>
     <rocksdb.version>6.16.4</rocksdb.version>
     <shrinkwrap.version>3.0.1</shrinkwrap.version>
-    <slf4j.version>1.7.25</slf4j.version>
+    <slf4j.version>1.7.32</slf4j.version>
     <snakeyaml.version>1.19</snakeyaml.version>
     <spotbugs-annotations.version>3.1.8</spotbugs-annotations.version>
     <javax-annotations-api.version>1.3.2</javax-annotations-api.version>

[bookkeeper] 01/11: Add metrics and internal command for QueryAutoRecoveryStatus, including underReplicatedSize metrics, read/write latency, internal command for querying recovering ledgersInfo (#2768)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 1455250eeb0a74d18be68699ce1832e2345d900a
Author: frankxieke <kx...@streamnative.io>
AuthorDate: Mon Sep 6 09:07:47 2021 +0800

    Add metrics and internal command for QueryAutoRecoveryStatus, including underReplicatedSize metrics,read/write latency, internal command for querying recovering ledgersInfo (#2768)
    
    Motivation:
    
    Current AutoRecovery does not have enough metrics or stat command that would help to monitor and debug. So we need to add metrics and admin stat interface to monitor the process of AutoRecovery.  For example, current recovering ledgerInfo and under replicated size, read/write latency in recovering.
    
    Changes:
    
    And QueryAutoRecoveryStatus command and under replicated size metric , read/write latency metric in recovering
    
    Documentation:
    
    Need doc.
    
    (cherry picked from commit 97818f5123999396e66f5246420d3c7e3d25f53d)
---
 .../org/apache/bookkeeper/bookie/BookieShell.java  |  40 +++++
 .../client/LedgerFragmentReplicator.java           |  31 +++-
 .../org/apache/bookkeeper/replication/Auditor.java |  20 +++
 .../bookkeeper/replication/ReplicationStats.java   |   3 +
 .../QueryAutoRecoveryStatusCommand.java            | 151 +++++++++++++++++
 .../QueryAutoRecoveryStatusCommandTest.java        | 179 +++++++++++++++++++++
 6 files changed, 420 insertions(+), 4 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
index 0da44a7..6bfbbaa 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
@@ -47,6 +47,7 @@ import org.apache.bookkeeper.net.BookieId;
 import org.apache.bookkeeper.replication.ReplicationException;
 import org.apache.bookkeeper.tools.cli.commands.autorecovery.ListUnderReplicatedCommand;
 import org.apache.bookkeeper.tools.cli.commands.autorecovery.LostBookieRecoveryDelayCommand;
+import org.apache.bookkeeper.tools.cli.commands.autorecovery.QueryAutoRecoveryStatusCommand;
 import org.apache.bookkeeper.tools.cli.commands.autorecovery.ToggleCommand;
 import org.apache.bookkeeper.tools.cli.commands.autorecovery.TriggerAuditCommand;
 import org.apache.bookkeeper.tools.cli.commands.autorecovery.WhoIsAuditorCommand;
@@ -155,6 +156,7 @@ public class BookieShell implements Tool {
     static final String CMD_CONVERT_TO_INTERLEAVED_STORAGE = "convert-to-interleaved-storage";
     static final String CMD_REBUILD_DB_LEDGER_LOCATIONS_INDEX = "rebuild-db-ledger-locations-index";
     static final String CMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE = "regenerate-interleaved-storage-index-file";
+    static final String CMD_QUERY_AUTORECOVERY_STATUS = "queryrecoverystatus";
 
     // cookie commands
     static final String CMD_CREATE_COOKIE = "cookie_create";
@@ -1344,6 +1346,43 @@ public class BookieShell implements Tool {
         }
     }
 
+
+    /**
+     * Command to query autorecovery status.
+     */
+    class QueryAutoRecoveryStatusCmd extends MyCommand {
+        Options opts = new Options();
+
+        public QueryAutoRecoveryStatusCmd() {
+            super(CMD_QUERY_AUTORECOVERY_STATUS);
+        }
+
+        @Override
+        Options getOptions() {
+            return opts;
+        }
+
+        @Override
+        String getDescription() {
+            return "Query the autorecovery status";
+        }
+
+        @Override
+        String getUsage() {
+            return "queryautorecoverystatus";
+        }
+
+        @Override
+        int runCmd(CommandLine cmdLine) throws Exception {
+            final boolean verbose = cmdLine.hasOption("verbose");
+            QueryAutoRecoveryStatusCommand.QFlags flags = new QueryAutoRecoveryStatusCommand.QFlags()
+                                                            .verbose(verbose);
+            QueryAutoRecoveryStatusCommand cmd = new QueryAutoRecoveryStatusCommand();
+            cmd.apply(bkConf, flags);
+            return 0;
+        }
+    }
+
     /**
      * Setter and Getter for LostBookieRecoveryDelay value (in seconds) in metadata store.
      */
@@ -2153,6 +2192,7 @@ public class BookieShell implements Tool {
         commands.put(CMD_READJOURNAL, new ReadJournalCmd());
         commands.put(CMD_LASTMARK, new LastMarkCmd());
         commands.put(CMD_AUTORECOVERY, new AutoRecoveryCmd());
+        commands.put(CMD_QUERY_AUTORECOVERY_STATUS, new QueryAutoRecoveryStatusCmd());
         commands.put(CMD_LISTBOOKIES, new ListBookiesCmd());
         commands.put(CMD_LISTFILESONDISC, new ListDiskFilesCmd());
         commands.put(CMD_UPDATECOOKIE, new UpdateCookieCmd());
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java
index cd8b508..fb6259d 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java
@@ -24,10 +24,10 @@ import static org.apache.bookkeeper.replication.ReplicationStats.NUM_BYTES_READ;
 import static org.apache.bookkeeper.replication.ReplicationStats.NUM_BYTES_WRITTEN;
 import static org.apache.bookkeeper.replication.ReplicationStats.NUM_ENTRIES_READ;
 import static org.apache.bookkeeper.replication.ReplicationStats.NUM_ENTRIES_WRITTEN;
-import static org.apache.bookkeeper.replication.ReplicationStats.REPLICATION_WORKER_SCOPE;
-
+import static org.apache.bookkeeper.replication.ReplicationStats.READ_DATA_LATENCY;;
+import static org.apache.bookkeeper.replication.ReplicationStats.REPLICATION_WORKER_SCOPE;;
+import static org.apache.bookkeeper.replication.ReplicationStats.WRITE_DATA_LATENCY;
 import io.netty.buffer.Unpooled;
-
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -35,11 +35,11 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.BiConsumer;
 import java.util.stream.Collectors;
-
 import org.apache.bookkeeper.client.AsyncCallback.ReadCallback;
 import org.apache.bookkeeper.client.api.WriteFlag;
 import org.apache.bookkeeper.meta.LedgerManager;
@@ -53,6 +53,7 @@ import org.apache.bookkeeper.stats.OpStatsLogger;
 import org.apache.bookkeeper.stats.StatsLogger;
 import org.apache.bookkeeper.stats.annotations.StatsDoc;
 import org.apache.bookkeeper.util.ByteBufList;
+import org.apache.bookkeeper.util.MathUtils;
 import org.apache.zookeeper.AsyncCallback;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -90,6 +91,17 @@ public class LedgerFragmentReplicator {
         help = "The distribution of size of entries written by the replicator"
     )
     private final OpStatsLogger numBytesWritten;
+    @StatsDoc(
+            name = READ_DATA_LATENCY,
+            help = "The distribution of latency of read entries by the replicator"
+    )
+    private final OpStatsLogger readDataLatency;
+    @StatsDoc(
+            name = WRITE_DATA_LATENCY,
+            help = "The distribution of latency of write entries by the replicator"
+    )
+    private final OpStatsLogger writeDataLatency;
+
 
     public LedgerFragmentReplicator(BookKeeper bkc, StatsLogger statsLogger) {
         this.bkc = bkc;
@@ -98,6 +110,8 @@ public class LedgerFragmentReplicator {
         numBytesRead = this.statsLogger.getOpStatsLogger(NUM_BYTES_READ);
         numEntriesWritten = this.statsLogger.getCounter(NUM_ENTRIES_WRITTEN);
         numBytesWritten = this.statsLogger.getOpStatsLogger(NUM_BYTES_WRITTEN);
+        readDataLatency = this.statsLogger.getOpStatsLogger(READ_DATA_LATENCY);
+        writeDataLatency = this.statsLogger.getOpStatsLogger(WRITE_DATA_LATENCY);
     }
 
     public LedgerFragmentReplicator(BookKeeper bkc) {
@@ -334,6 +348,8 @@ public class LedgerFragmentReplicator {
                 }
             }
         };
+
+        long startReadEntryTime = MathUtils.nowInNano();
         /*
          * Read the ledger entry using the LedgerHandle. This will allow us to
          * read the entry from one of the other replicated bookies other than
@@ -350,6 +366,10 @@ public class LedgerFragmentReplicator {
                     ledgerFragmentEntryMcb.processResult(rc, null, null);
                     return;
                 }
+
+                readDataLatency.registerSuccessfulEvent(MathUtils.elapsedNanos(startReadEntryTime),
+                        TimeUnit.NANOSECONDS);
+
                 /*
                  * Now that we've read the ledger entry, write it to the new
                  * bookie we've selected.
@@ -364,10 +384,13 @@ public class LedgerFragmentReplicator {
                                 lh.getLastAddConfirmed(), entry.getLength(),
                                 Unpooled.wrappedBuffer(data, 0, data.length));
                 for (BookieId newBookie : newBookies) {
+                    long startWriteEntryTime = MathUtils.nowInNano();
                     bkc.getBookieClient().addEntry(newBookie, lh.getId(),
                             lh.getLedgerKey(), entryId, ByteBufList.clone(toSend),
                             multiWriteCallback, dataLength, BookieProtocol.FLAG_RECOVERY_ADD,
                             false, WriteFlag.NONE);
+                    writeDataLatency.registerSuccessfulEvent(
+                           MathUtils.elapsedNanos(startWriteEntryTime), TimeUnit.NANOSECONDS);
                 }
                 toSend.release();
             }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
index 48f5101..e4cf394 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
@@ -38,6 +38,7 @@ import static org.apache.bookkeeper.replication.ReplicationStats.NUM_UNDERREPLIC
 import static org.apache.bookkeeper.replication.ReplicationStats.NUM_UNDER_REPLICATED_LEDGERS;
 import static org.apache.bookkeeper.replication.ReplicationStats.PLACEMENT_POLICY_CHECK_TIME;
 import static org.apache.bookkeeper.replication.ReplicationStats.REPLICAS_CHECK_TIME;
+import static org.apache.bookkeeper.replication.ReplicationStats.UNDER_REPLICATED_LEDGERS_TOTAL_SIZE;
 import static org.apache.bookkeeper.replication.ReplicationStats.URL_PUBLISH_TIME_FOR_LOST_BOOKIE;
 import static org.apache.bookkeeper.util.SafeRunnable.safeRun;
 
@@ -71,6 +72,7 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.LongAdder;
 import java.util.function.BiConsumer;
 import java.util.stream.Collectors;
 
@@ -170,6 +172,12 @@ public class Auditor implements AutoCloseable {
         help = "the distribution of num under_replicated ledgers on each auditor run"
     )
     private final OpStatsLogger numUnderReplicatedLedger;
+
+    @StatsDoc(
+            name = UNDER_REPLICATED_LEDGERS_TOTAL_SIZE,
+            help = "the distribution of under_replicated ledgers total size on each auditor run"
+    )
+    private final OpStatsLogger underReplicatedLedgerTotalSize;
     @StatsDoc(
         name = URL_PUBLISH_TIME_FOR_LOST_BOOKIE,
         help = "the latency distribution of publishing under replicated ledgers for lost bookies"
@@ -341,6 +349,7 @@ public class Auditor implements AutoCloseable {
         this.numLedgersFoundHavingLessThanWQReplicasOfAnEntry = new AtomicInteger(0);
 
         numUnderReplicatedLedger = this.statsLogger.getOpStatsLogger(ReplicationStats.NUM_UNDER_REPLICATED_LEDGERS);
+        underReplicatedLedgerTotalSize = this.statsLogger.getOpStatsLogger(UNDER_REPLICATED_LEDGERS_TOTAL_SIZE);
         uRLPublishTimeForLostBookies = this.statsLogger
                 .getOpStatsLogger(ReplicationStats.URL_PUBLISH_TIME_FOR_LOST_BOOKIE);
         bookieToLedgersMapCreationTime = this.statsLogger
@@ -1131,6 +1140,17 @@ public class Auditor implements AutoCloseable {
         }
         LOG.info("Following ledgers: {} of bookie: {} are identified as underreplicated", ledgers, missingBookies);
         numUnderReplicatedLedger.registerSuccessfulValue(ledgers.size());
+        LongAdder underReplicatedSize = new LongAdder();
+        FutureUtils.processList(
+                Lists.newArrayList(ledgers),
+                ledgerId ->
+                    ledgerManager.readLedgerMetadata(ledgerId).whenComplete((metadata, exception) -> {
+                        if (exception == null) {
+                            underReplicatedSize.add(metadata.getValue().getLength());
+                        }
+                    }), null);
+        underReplicatedLedgerTotalSize.registerSuccessfulValue(underReplicatedSize.longValue());
+
         return FutureUtils.processList(
             Lists.newArrayList(ledgers),
             ledgerId -> ledgerUnderreplicationManager.markLedgerUnderreplicatedAsync(ledgerId, missingBookies),
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationStats.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationStats.java
index 6ec9f49..b0bbe47 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationStats.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationStats.java
@@ -30,6 +30,7 @@ public interface ReplicationStats {
     String AUDITOR_SCOPE = "auditor";
     String ELECTION_ATTEMPTS = "election_attempts";
     String NUM_UNDER_REPLICATED_LEDGERS = "NUM_UNDER_REPLICATED_LEDGERS";
+    String UNDER_REPLICATED_LEDGERS_TOTAL_SIZE = "UNDER_REPLICATED_LEDGERS_TOTAL_SIZE";
     String URL_PUBLISH_TIME_FOR_LOST_BOOKIE = "URL_PUBLISH_TIME_FOR_LOST_BOOKIE";
     String BOOKIE_TO_LEDGERS_MAP_CREATION_TIME = "BOOKIE_TO_LEDGERS_MAP_CREATION_TIME";
     String CHECK_ALL_LEDGERS_TIME = "CHECK_ALL_LEDGERS_TIME";
@@ -58,6 +59,8 @@ public interface ReplicationStats {
     String NUM_BYTES_READ = "NUM_BYTES_READ";
     String NUM_ENTRIES_WRITTEN = "NUM_ENTRIES_WRITTEN";
     String NUM_BYTES_WRITTEN = "NUM_BYTES_WRITTEN";
+    String READ_DATA_LATENCY = "READ_DATA_LATENCY";
+    String WRITE_DATA_LATENCY = "WRITE_DATA_LATENCY";
     String REPLICATE_EXCEPTION = "exceptions";
     String NUM_DEFER_LEDGER_LOCK_RELEASE_OF_FAILED_LEDGER = "NUM_DEFER_LEDGER_LOCK_RELEASE_OF_FAILED_LEDGER";
     String NUM_ENTRIES_UNABLE_TO_READ_FOR_REPLICATION = "NUM_ENTRIES_UNABLE_TO_READ_FOR_REPLICATION";
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommand.java
new file mode 100644
index 0000000..0f86a2d
--- /dev/null
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommand.java
@@ -0,0 +1,151 @@
+/*
+ * 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.bookkeeper.tools.cli.commands.autorecovery;
+
+import static org.apache.bookkeeper.meta.MetadataDrivers.runFunctionWithLedgerManagerFactory;
+import com.beust.jcommander.Parameter;
+import com.google.common.util.concurrent.UncheckedExecutionException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import lombok.Setter;
+import lombok.experimental.Accessors;
+import org.apache.bookkeeper.conf.ServerConfiguration;
+import org.apache.bookkeeper.meta.LedgerManager;
+import org.apache.bookkeeper.meta.LedgerUnderreplicationManager;
+import org.apache.bookkeeper.meta.UnderreplicatedLedger;
+import org.apache.bookkeeper.replication.ReplicationException;
+import org.apache.bookkeeper.tools.cli.helpers.BookieCommand;
+import org.apache.bookkeeper.tools.framework.CliFlags;
+import org.apache.bookkeeper.tools.framework.CliSpec;
+import org.apache.zookeeper.KeeperException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Command to Query current auto recovery status.
+ */
+public class QueryAutoRecoveryStatusCommand
+        extends BookieCommand<QueryAutoRecoveryStatusCommand.QFlags> {
+    static final Logger LOG = LoggerFactory.
+            getLogger(QueryAutoRecoveryStatusCommand.class);
+    private static final String NAME = "queryautorecoverystatus";
+    private static final String DESC = "Query autorecovery status.";
+
+    public QueryAutoRecoveryStatusCommand() {
+        super(CliSpec.<QFlags>newBuilder()
+                .withName(NAME)
+                .withDescription(DESC)
+                .withFlags(new QFlags())
+                .build());
+    }
+
+    @Override
+    public boolean apply(ServerConfiguration conf, QFlags cmdFlags) {
+        try {
+            return handler(conf, cmdFlags);
+        } catch (Exception e) {
+            throw new UncheckedExecutionException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Flags for list under replicated command.
+     */
+    @Accessors(fluent = true)
+    @Setter
+    public static class QFlags extends CliFlags{
+        @Parameter(names =  {"-v", "--verbose"}, description = "list recovering detailed ledger info")
+        private Boolean verbose = false;
+    }
+
+    private static class LedgerRecoverInfo {
+        Long ledgerId;
+        String bookieId;
+        LedgerRecoverInfo(Long ledgerId, String bookieId) {
+            this.ledgerId = ledgerId;
+            this.bookieId = bookieId;
+        }
+    }
+
+    /*
+    Print Message format is like this:
+
+     CurrentRecoverLedgerInfo:
+        LedgerId:   BookieId:     LedgerSize:(detail)
+        LedgerId:   BookieId:     LedgerSize:(detail)
+     */
+    public boolean handler(ServerConfiguration conf, QFlags flag) throws Exception {
+        runFunctionWithLedgerManagerFactory(conf, mFactory -> {
+            LedgerUnderreplicationManager underreplicationManager;
+            LedgerManager ledgerManager = mFactory.newLedgerManager();
+            List<LedgerRecoverInfo> ledgerList = new LinkedList<>();
+            try {
+                underreplicationManager = mFactory.newLedgerUnderreplicationManager();
+            } catch (KeeperException | ReplicationException.CompatibilityException e) {
+                throw new UncheckedExecutionException("Failed to new ledger underreplicated manager", e);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                throw new UncheckedExecutionException("Interrupted on newing ledger underreplicated manager", e);
+            }
+            Iterator<UnderreplicatedLedger> iter = underreplicationManager.listLedgersToRereplicate(null);
+            while (iter.hasNext()) {
+                UnderreplicatedLedger underreplicatedLedger = iter.next();
+                long urLedgerId = underreplicatedLedger.getLedgerId();
+                try {
+                    String replicationWorkerId = underreplicationManager
+                            .getReplicationWorkerIdRereplicatingLedger(urLedgerId);
+                    if (replicationWorkerId != null) {
+                        ledgerList.add(new LedgerRecoverInfo(urLedgerId, replicationWorkerId));
+                    }
+                } catch (ReplicationException.UnavailableException e) {
+                    LOG.error("Failed to get ReplicationWorkerId rereplicating ledger {} -- {}", urLedgerId,
+                            e.getMessage());
+                }
+            }
+
+            LOG.info("CurrentRecoverLedgerInfo:");
+            if (!flag.verbose) {
+                for (int i = 0; i < ledgerList.size(); i++) {
+                    LOG.info("\tLedgerId:{}\tBookieId:{}", ledgerList.get(i).ledgerId, ledgerList.get(i).bookieId);
+                }
+            } else {
+                for (int i = 0; i < ledgerList.size(); i++) {
+                    LedgerRecoverInfo info = ledgerList.get(i);
+                    ledgerManager.readLedgerMetadata(info.ledgerId).whenComplete((metadata, exception) -> {
+                        if (exception == null) {
+                            LOG.info("\tLedgerId:{}\tBookieId:{}\tLedgerSize:{}",
+                                    info.ledgerId, info.bookieId, metadata.getValue().getLength());
+                        } else {
+                            LOG.error("Unable to read the ledger: {} information", info.ledgerId);
+                            throw new UncheckedExecutionException(exception);
+                        }
+                    });
+                }
+            }
+            if (ledgerList.size() == 0) {
+                // NO ledger is being auto recovering
+                LOG.info("\t No Ledger is being recovered.");
+            }
+            return null;
+        });
+        return true;
+    }
+}
diff --git a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommandTest.java b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommandTest.java
new file mode 100644
index 0000000..ba92c8b
--- /dev/null
+++ b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/autorecovery/QueryAutoRecoveryStatusCommandTest.java
@@ -0,0 +1,179 @@
+/*
+ * 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.bookkeeper.tools.cli.commands.autorecovery;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+import com.google.common.collect.Lists;
+import java.lang.reflect.Constructor;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Function;
+import org.apache.bookkeeper.client.BookKeeper;
+import org.apache.bookkeeper.client.LedgerMetadataBuilder;
+import org.apache.bookkeeper.client.api.LedgerMetadata;
+import org.apache.bookkeeper.conf.ServerConfiguration;
+import org.apache.bookkeeper.meta.LedgerManager;
+import org.apache.bookkeeper.meta.LedgerManagerFactory;
+import org.apache.bookkeeper.meta.LedgerUnderreplicationManager;
+import org.apache.bookkeeper.meta.MetadataDrivers;
+import org.apache.bookkeeper.meta.UnderreplicatedLedger;
+import org.apache.bookkeeper.meta.zk.ZKMetadataDriverBase;
+import org.apache.bookkeeper.net.BookieId;
+import org.apache.bookkeeper.net.BookieSocketAddress;
+import org.apache.bookkeeper.proto.BookieAddressResolver;
+import org.apache.bookkeeper.tools.cli.helpers.BookieCommandTestBase;
+import org.apache.bookkeeper.tools.cli.helpers.CommandHelpers;
+import org.apache.bookkeeper.versioning.LongVersion;
+import org.apache.bookkeeper.versioning.Versioned;
+import org.apache.bookkeeper.zookeeper.ZooKeeperClient;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+
+
+/**
+ * Unit test for {@link QueryAutoRecoveryStatusCommand}.
+ */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ QueryAutoRecoveryStatusCommand.class, ZKMetadataDriverBase.class, ZooKeeperClient.class,
+        CommandHelpers.class, MetadataDrivers.class
+})
+public class QueryAutoRecoveryStatusCommandTest extends BookieCommandTestBase {
+    public QueryAutoRecoveryStatusCommandTest() {
+        super(3, 0);
+    }
+    LedgerUnderreplicationManager underreplicationManager;
+
+    @Override
+    public void setup() throws Exception {
+        super.setup();
+        BookieId bookieId = BookieId.parse(UUID.randomUUID().toString());
+        LedgerManagerFactory ledgerManagerFactory = mock(LedgerManagerFactory.class);
+
+        PowerMockito.mockStatic(MetadataDrivers.class);
+        PowerMockito.doAnswer(invocationOnMock -> {
+            Function<LedgerManagerFactory, ?> function = invocationOnMock.getArgument(1);
+            function.apply(ledgerManagerFactory);
+            return true;
+        }).when(MetadataDrivers.class, "runFunctionWithLedgerManagerFactory", any(ServerConfiguration.class),
+                any(Function.class));
+
+        LedgerManager ledgerManager = mock(LedgerManager.class);
+        underreplicationManager = mock(LedgerUnderreplicationManager.class);
+
+        when(ledgerManagerFactory.newLedgerManager()).thenReturn(ledgerManager);
+        when(ledgerManagerFactory.newLedgerUnderreplicationManager()).thenReturn(underreplicationManager);
+
+        List<BookieId> ensemble = Lists.newArrayList(new BookieSocketAddress("192.0.2.1", 1234).toBookieId(),
+                new BookieSocketAddress("192.0.2.2", 1234).toBookieId(),
+                new BookieSocketAddress("192.0.2.3", 1234).toBookieId());
+        LedgerMetadata metadata = LedgerMetadataBuilder.create()
+                .withId(11112233)
+                .withClosedState()
+                .withLength(100000999)
+                .withLastEntryId(2000011)
+                .withEnsembleSize(3).withWriteQuorumSize(2).withAckQuorumSize(2)
+                .withPassword("passwd".getBytes())
+                .withDigestType(BookKeeper.DigestType.CRC32.toApiDigestType())
+                .newEnsembleEntry(0L, ensemble).build();
+        CompletableFuture<Versioned<LedgerMetadata>> promise = new CompletableFuture<>();
+        Versioned<LedgerMetadata> vmeta = new Versioned<LedgerMetadata>(metadata, new LongVersion(1000));
+        promise.complete(vmeta);
+
+        when(ledgerManager.readLedgerMetadata(1)).thenReturn(promise);
+        when(ledgerManager.readLedgerMetadata(33232)).thenReturn(promise);
+
+        Constructor<? extends UnderreplicatedLedger> constructor = UnderreplicatedLedger.class.
+                getDeclaredConstructor(long.class);
+        constructor.setAccessible(true);
+        final Queue<String> queue = new LinkedList<String>();
+        queue.add("1111");
+        Iterator<UnderreplicatedLedger> iter =  new Iterator<UnderreplicatedLedger>() {
+            @Override
+            public boolean hasNext() {
+                if (queue.size() > 0) {
+                    queue.remove();
+                    try {
+                        curBatch.add(constructor.newInstance(1));
+                        curBatch.add(constructor.newInstance(33232));
+                    } catch (Exception e) {
+                    }
+                }
+
+                if (curBatch.size() > 0) {
+                    return true;
+                }
+                return false;
+            }
+
+            @Override
+            public UnderreplicatedLedger next() {
+                return curBatch.remove();
+            }
+
+            final Queue<UnderreplicatedLedger> curBatch = new LinkedList<UnderreplicatedLedger>();
+        };
+
+        when(underreplicationManager.listLedgersToRereplicate(any())).thenReturn(iter);
+
+        PowerMockito.mockStatic(CommandHelpers.class);
+        PowerMockito.when(CommandHelpers
+                .getBookieSocketAddrStringRepresentation(
+                        eq(bookieId), any(BookieAddressResolver.class))).thenReturn("");
+    }
+
+    @Test(timeout = 30000)
+    public void testQueryRecoverStatusCommand() {
+        try {
+            when(underreplicationManager.getReplicationWorkerIdRereplicatingLedger(1)).thenReturn("192.168.0.103");
+            when(underreplicationManager.getReplicationWorkerIdRereplicatingLedger(33232)).thenReturn("192.168.0.103");
+        } catch (Exception e) {
+        }
+        QueryAutoRecoveryStatusCommand cmd = new QueryAutoRecoveryStatusCommand();
+        Assert.assertTrue(cmd.apply(bkFlags, new String[] { "" }));
+    }
+
+    @Test(timeout = 30000)
+    public void testQueryRecoverStatusCommandWithDetail() {
+        try {
+            when(underreplicationManager.getReplicationWorkerIdRereplicatingLedger(1)).thenReturn("192.168.0.103");
+            when(underreplicationManager.getReplicationWorkerIdRereplicatingLedger(33232)).thenReturn("192.168.0.103");
+        } catch (Exception e) {
+        }
+        QueryAutoRecoveryStatusCommand cmd = new QueryAutoRecoveryStatusCommand();
+        Assert.assertTrue(cmd.apply(bkFlags, new String[] { "-v" }));
+    }
+
+    @Test(timeout = 3000)
+    public void testNoLedgerIsBeingRecovered() {
+        QueryAutoRecoveryStatusCommand cmd = new QueryAutoRecoveryStatusCommand();
+        Assert.assertTrue(cmd.apply(bkFlags, new String[] { "-v" }));
+    }
+}

[bookkeeper] 05/11: Add auditor get ledger throttle to avoid auto recovery zk session expire (#2802)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 1da014eb5f1f81e0be03536ff7b2dab293518e8f
Author: Hang Chen <ch...@apache.org>
AuthorDate: Tue Oct 5 17:07:29 2021 +0800

    Add auditor get ledger throttle to avoid auto recovery zk session expire (#2802)
    
    (cherry picked from commit 29829a4cc3b47928ca8c894474f046bd9deb088d)
---
 .../bookkeeper/conf/ServerConfiguration.java       | 39 +++++++++++++++
 .../bookkeeper/meta/AbstractZkLedgerManager.java   |  8 ++--
 .../org/apache/bookkeeper/replication/Auditor.java | 56 +++++++++++++++++++++-
 .../replication/AuditorPeriodicCheckTest.java      | 54 +++++++++++++++++++++
 conf/bk_server.conf                                |  7 +++
 5 files changed, 159 insertions(+), 5 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
index 00ef028..1a50d02 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
@@ -202,6 +202,10 @@ public class ServerConfiguration extends AbstractConfiguration<ServerConfigurati
     protected static final String UNDERREPLICATED_LEDGER_RECOVERY_GRACE_PERIOD =
             "underreplicatedLedgerRecoveryGracePeriod";
     protected static final String AUDITOR_REPLICAS_CHECK_INTERVAL = "auditorReplicasCheckInterval";
+    protected static final String AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS =
+        "auditorMaxNumberOfConcurrentOpenLedgerOperations";
+    protected static final String AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC =
+        "auditorAcquireConcurrentOpenLedgerOperationsTimeOutMSec";
 
     // Worker Thread parameters.
     protected static final String NUM_ADD_WORKER_THREADS = "numAddWorkerThreads";
@@ -2503,6 +2507,41 @@ public class ServerConfiguration extends AbstractConfiguration<ServerConfigurati
     }
 
     /**
+     * Get the semaphore limit value of getting ledger from zookeeper in auto recovery.
+     *
+     * @return The semaphore value. By default it is 500.
+     */
+    public int getAuditorMaxNumberOfConcurrentOpenLedgerOperations() {
+        return getInt(AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS, 500);
+    }
+
+    /**
+     * Set the semaphore limit value for getting ledger from zookeeper in auto recovery.
+     * @param semaphore
+     */
+    public void setAuditorMaxNumberOfConcurrentOpenLedgerOperations(int semaphore) {
+        setProperty(AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS, semaphore);
+    }
+
+    /**
+     * Get the acquire concurrent open ledger operations timeout.
+     *
+     * @return The timeout values. By default it is 120000ms
+     */
+    public int getAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec() {
+        return getInt(AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC, 120000);
+    }
+
+    /**
+     * Set the acquire concurrent open ledger operations timeout.
+     * @param timeoutMs
+     */
+    public void setAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec(int timeoutMs) {
+        setProperty(AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC, timeoutMs);
+    }
+
+
+    /**
      * Set what percentage of a ledger (fragment)'s entries will be verified.
      * 0 - only the first and last entry of each ledger fragment would be verified
      * 100 - the entire ledger fragment would be verified
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
index 0e16d69..cda9370 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
@@ -568,9 +568,11 @@ public abstract class AbstractZkLedgerManager implements LedgerManager, Watcher
                 MultiCallback mcb = new MultiCallback(zkActiveLedgers.size(), finalCb, ctx,
                                                       successRc, failureRc);
                 // start loop over all ledgers
-                for (Long ledger : zkActiveLedgers) {
-                    processor.process(ledger, mcb);
-                }
+                scheduler.submit(() -> {
+                    for (Long ledger : zkActiveLedgers) {
+                        processor.process(ledger, mcb);
+                    }
+                });
             }
         });
     }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
index e4cf394..2c61de3 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
@@ -165,6 +165,8 @@ public class Auditor implements AutoCloseable {
     private final AtomicInteger numLedgersFoundHavingLessThanWQReplicasOfAnEntry;
     private final long underreplicatedLedgerRecoveryGracePeriod;
     private final int zkOpTimeoutMs;
+    private final Semaphore openLedgerNoRecoverySemaphore;
+    private final int openLedgerNoRecoverySemaphoreWaitTimeoutMSec;
 
     private final StatsLogger statsLogger;
     @StatsDoc(
@@ -348,6 +350,20 @@ public class Auditor implements AutoCloseable {
         this.numLedgersHavingLessThanWQReplicasOfAnEntryGuageValue = new AtomicInteger(0);
         this.numLedgersFoundHavingLessThanWQReplicasOfAnEntry = new AtomicInteger(0);
 
+        if (conf.getAuditorMaxNumberOfConcurrentOpenLedgerOperations() <= 0) {
+            LOG.error("auditorMaxNumberOfConcurrentOpenLedgerOperations should be greater than 0");
+            throw new UnavailableException("auditorMaxNumberOfConcurrentOpenLedgerOperations should be greater than 0");
+        }
+        this.openLedgerNoRecoverySemaphore = new Semaphore(conf.getAuditorMaxNumberOfConcurrentOpenLedgerOperations());
+
+        if (conf.getAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec() < 0) {
+            LOG.error("auditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec should be greater than or equal to 0");
+            throw new UnavailableException("auditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec "
+                + "should be greater than or equal to 0");
+        }
+        this.openLedgerNoRecoverySemaphoreWaitTimeoutMSec =
+            conf.getAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec();
+
         numUnderReplicatedLedger = this.statsLogger.getOpStatsLogger(ReplicationStats.NUM_UNDER_REPLICATED_LEDGERS);
         underReplicatedLedgerTotalSize = this.statsLogger.getOpStatsLogger(UNDER_REPLICATED_LEDGERS_TOTAL_SIZE);
         uRLPublishTimeForLostBookies = this.statsLogger
@@ -1205,12 +1221,32 @@ public class Auditor implements AutoCloseable {
     }
 
     /**
+     * Get BookKeeper client according to configuration.
+     * @param conf
+     * @return
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    BookKeeper getBookKeeper(ServerConfiguration conf) throws IOException, InterruptedException {
+        return createBookKeeperClient(conf);
+    }
+
+    /**
+     * Get BookKeeper admin according to bookKeeper client.
+     * @param bookKeeper
+     * @return
+     */
+    BookKeeperAdmin getBookKeeperAdmin(final BookKeeper bookKeeper) {
+        return new BookKeeperAdmin(bookKeeper, statsLogger);
+    }
+
+    /**
      * List all the ledgers and check them individually. This should not
      * be run very often.
      */
     void checkAllLedgers() throws BKException, IOException, InterruptedException, KeeperException {
-        final BookKeeper localClient = createBookKeeperClient(conf);
-        final BookKeeperAdmin localAdmin = new BookKeeperAdmin(localClient, statsLogger);
+        final BookKeeper localClient = getBookKeeper(conf);
+        final BookKeeperAdmin localAdmin = getBookKeeperAdmin(localClient);
 
         try {
             final LedgerChecker checker = new LedgerChecker(localClient);
@@ -1230,7 +1266,23 @@ public class Auditor implements AutoCloseable {
                     return;
                 }
 
+                try {
+                    if (!openLedgerNoRecoverySemaphore.tryAcquire(openLedgerNoRecoverySemaphoreWaitTimeoutMSec,
+                        TimeUnit.MILLISECONDS)) {
+                        LOG.warn("Failed to acquire semaphore for {} ms, ledgerId: {}",
+                            openLedgerNoRecoverySemaphoreWaitTimeoutMSec, ledgerId);
+                        FutureUtils.complete(processFuture, null);
+                        return;
+                    }
+                } catch (InterruptedException e) {
+                    LOG.error("Unable to acquire open ledger operation semaphore ", e);
+                    Thread.currentThread().interrupt();
+                    FutureUtils.complete(processFuture, null);
+                    return;
+                }
+
                 localAdmin.asyncOpenLedgerNoRecovery(ledgerId, (rc, lh, ctx) -> {
+                    openLedgerNoRecoverySemaphore.release();
                     if (Code.OK == rc) {
                         checker.checkLedger(lh,
                                 // the ledger handle will be closed after checkLedger is done.
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
index 8ea6636..d60451d 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
@@ -25,6 +25,13 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import io.netty.buffer.ByteBuf;
 
@@ -50,6 +57,7 @@ import org.apache.bookkeeper.bookie.Bookie;
 import org.apache.bookkeeper.bookie.BookieAccessor;
 import org.apache.bookkeeper.bookie.BookieException;
 import org.apache.bookkeeper.bookie.IndexPersistenceMgr;
+import org.apache.bookkeeper.client.AsyncCallback;
 import org.apache.bookkeeper.client.AsyncCallback.AddCallback;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookKeeper;
@@ -75,6 +83,7 @@ import org.apache.zookeeper.KeeperException;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -366,6 +375,51 @@ public class AuditorPeriodicCheckTest extends BookKeeperClusterTestCase {
     }
 
     @Test
+    public void testGetLedgerFromZookeeperThrottled() throws Exception {
+        final int numberLedgers = 30;
+
+        // write ledgers into bookkeeper cluster
+        try {
+            for (AuditorElector e : auditorElectors.values()) {
+                e.shutdown();
+            }
+
+            for (int i = 0; i < numberLedgers; ++i) {
+                LedgerHandle lh = bkc.createLedger(3, 3, DigestType.CRC32, "passwd".getBytes());
+                for (int j = 0; j < 5; j++) {
+                    lh.addEntry("testdata".getBytes());
+                }
+                lh.close();
+            }
+        } catch (InterruptedException | BKException e) {
+            LOG.error("Failed to shutdown auditor elector or write data to ledgers ", e);
+            fail();
+        }
+
+        // create auditor and call `checkAllLedgers`
+        ServerConfiguration configuration = confByIndex(0);
+        configuration.setAuditorMaxNumberOfConcurrentOpenLedgerOperations(10);
+
+        Auditor auditor1 = new Auditor(BookieImpl.getBookieId(configuration).toString(),
+            configuration, NullStatsLogger.INSTANCE);
+        Auditor auditor = Mockito.spy(auditor1);
+
+        BookKeeper bookKeeper = Mockito.spy(auditor.getBookKeeper(configuration));
+        BookKeeperAdmin admin = Mockito.spy(auditor.getBookKeeperAdmin(bookKeeper));
+        when(auditor.getBookKeeper(configuration)).thenReturn(bookKeeper);
+        when(auditor.getBookKeeperAdmin(bookKeeper)).thenReturn(admin);
+
+        try {
+            auditor.checkAllLedgers();
+            verify(admin, times(numberLedgers)).asyncOpenLedgerNoRecovery(anyLong(),
+                any(AsyncCallback.OpenCallback.class), eq(null));
+        } catch (Exception e) {
+            LOG.error("Caught exception while checking all ledgers ", e);
+            fail();
+        }
+    }
+
+    @Test
     public void testInitialDelayOfCheckAllLedgers() throws Exception {
         for (AuditorElector e : auditorElectors.values()) {
             e.shutdown();
diff --git a/conf/bk_server.conf b/conf/bk_server.conf
index 21712d5..639bda2 100755
--- a/conf/bk_server.conf
+++ b/conf/bk_server.conf
@@ -869,6 +869,13 @@ zkEnableSecurity=false
 # the provided digest type provided at `digestType` and the provided passwd provided at `passwd`.
 # enableDigestTypeAutodetection=true
 
+# Semaphore limit of getting ledger from zookeeper. Used to throttle the zookeeper client request operation
+# sending to Zookeeper server. Default value is 500
+# auditorMaxNumberOfConcurrentOpenLedgerOperations=500
+
+# Wait timeout of acquiring semaphore of concurrent open ledger operations. Default value is 120000ms.
+# auditorAcquireConcurrentOpenLedgerOperationsTimeOutMSec=120000
+
 #############################################################################
 ## Placement settings
 #############################################################################

[bookkeeper] 03/11: Upgrade httpclient from 4.5.5 to 4.5.13 (#2793)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 356fe037d6674f38f5b46f6f7733d4e460c80f7e
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Fri Oct 15 02:10:41 2021 +0200

    Upgrade httpclient from 4.5.5 to 4.5.13 (#2793)
    
    Upgrade httpclient from 4.5.5 to 4.5.13
    (on gradle dependencies it was already on 4.5.13)
    
    ### Motivation
    Resolve security vulnerability, see https://github.com/advisories/GHSA-7r82-7xv7-xcpj
    
    (cherry picked from commit 04650521b3a91e03cf598a647ecd58df106d081b)
---
 bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt    | 4 ++--
 bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt  | 4 ++--
 bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt | 4 ++--
 pom.xml                                                   | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
index 73b6c3a..1100a4f 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
@@ -285,8 +285,8 @@ Apache Software License, Version 2.
 - lib/com.google.errorprone-error_prone_annotations-2.4.0.jar [36]
 - lib/org.apache.yetus-audience-annotations-0.5.0.jar [37]
 - lib/org.jctools-jctools-core-2.1.2.jar [38]
-- lib/org.apache.httpcomponents-httpclient-4.5.5.jar [39]
-- lib/org.apache.httpcomponents-httpcore-4.4.9.jar [40]
+- lib/org.apache.httpcomponents-httpclient-4.5.13.jar [39]
+- lib/org.apache.httpcomponents-httpcore-4.4.13.jar [40]
 - lib/org.apache.thrift-libthrift-0.14.2.jar [41]
 - lib/com.google.android-annotations-4.1.1.4.jar [42]
 - lib/com.google.http-client-google-http-client-1.34.0.jar [43]
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
index 4ace15e..5a89cab 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
@@ -265,8 +265,8 @@ Apache Software License, Version 2.
 - lib/com.google.errorprone-error_prone_annotations-2.4.0.jar [35]
 - lib/org.apache.yetus-audience-annotations-0.5.0.jar [36]
 - lib/org.jctools-jctools-core-2.1.2.jar [37]
-- lib/org.apache.httpcomponents-httpclient-4.5.5.jar [38]
-- lib/org.apache.httpcomponents-httpcore-4.4.9.jar [39]
+- lib/org.apache.httpcomponents-httpclient-4.5.13.jar [38]
+- lib/org.apache.httpcomponents-httpcore-4.4.13.jar [39]
 - lib/org.apache.thrift-libthrift-0.14.2.jar [40]
 - lib/com.google.android-annotations-4.1.1.4.jar [41]
 - lib/com.google.auto.value-auto-value-annotations-1.7.jar [42]
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
index 126a1b2..e2474f7 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
@@ -285,8 +285,8 @@ Apache Software License, Version 2.
 - lib/com.google.errorprone-error_prone_annotations-2.4.0.jar [36]
 - lib/org.apache.yetus-audience-annotations-0.5.0.jar [37]
 - lib/org.jctools-jctools-core-2.1.2.jar [38]
-- lib/org.apache.httpcomponents-httpclient-4.5.5.jar [39]
-- lib/org.apache.httpcomponents-httpcore-4.4.9.jar [40]
+- lib/org.apache.httpcomponents-httpclient-4.5.13.jar [39]
+- lib/org.apache.httpcomponents-httpcore-4.4.13.jar [40]
 - lib/org.apache.thrift-libthrift-0.14.2.jar [41]
 - lib/com.google.android-annotations-4.1.1.4.jar [42]
 - lib/com.google.http-client-google-http-client-1.34.0.jar [43]
diff --git a/pom.xml b/pom.xml
index 003c31e..de52ae6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -153,7 +153,7 @@
     <powermock.version>2.0.2</powermock.version>
     <prometheus.version>0.8.1</prometheus.version>
     <datasketches.version>0.8.3</datasketches.version>
-    <httpclient.version>4.5.5</httpclient.version>
+    <httpclient.version>4.5.13</httpclient.version>
     <protobuf.version>3.14.0</protobuf.version>
     <protoc3.version>3.14.0</protoc3.version>
     <protoc-gen-grpc-java.version>${grpc.version}</protoc-gen-grpc-java.version>

[bookkeeper] 10/11: Add error handling to readLedgerMetadata in over-replicated ledger GC (#2844)

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit e86635c1f26c82e082cfe07f9ff92e52bfeeb541
Author: shustsud <51...@users.noreply.github.com>
AuthorDate: Mon Oct 25 10:40:14 2021 +0900

    Add error handling to readLedgerMetadata in over-replicated ledger GC (#2844)
    
    ### Motivation
    For each ledger whose metadata is not in ZK, following stack trace will be output:
    
    ```
    15:30:17.925 [GarbageCollectorThread-11-1] ERROR o.a.b.b.ScanAndCompareGarbageCollector - Exception when iterating through the ledgers to check for over-replication
    java.util.concurrent.ExecutionException: org.apache.bookkeeper.client.BKException$BKNoSuchLedgerExistsException: No such ledger exists
            at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
            at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
            at org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.removeOverReplicatedledgers(ScanAndCompareGarbageCollector.java:199)
            at org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:120)
            at org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:372)
            at org.apache.bookkeeper.bookie.GarbageCollectorThread.runWithFlags(GarbageCollectorThread.java:323)
            at org.apache.bookkeeper.bookie.GarbageCollectorThread.safeRun(GarbageCollectorThread.java:301)
            at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: org.apache.bookkeeper.client.BKException$BKNoSuchLedgerExistsException: No such ledger exists
            at org.apache.bookkeeper.meta.AbstractZkLedgerManager$3.processResult(AbstractZkLedgerManager.java:397)
            at org.apache.bookkeeper.zookeeper.ZooKeeperClient$19$1.processResult(ZooKeeperClient.java:994)
            at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:575)
            at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:508)
    ```
    
    It is noisy, makes the size of log files large and finally causes OOM during log rotation.
    So we should suppress the stacktrace.
    
    (This problem is due to [#2813](https://github.com/apache/bookkeeper/pull/2813).)
    
    ### Changes
    Add error handling to readLedgerMetadata in over-replicated ledger GC in order to suppress the stacktrace.
    
    (cherry picked from commit bd5c50bf331c28e6a9db2b8d2b186b86342dbd6b)
---
 .../bookkeeper/bookie/ScanAndCompareGarbageCollector.java  | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
index 72fd797..e99a407 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
@@ -234,9 +234,19 @@ public class ScanAndCompareGarbageCollector implements GarbageCollector {
                 // check ledger ensembles before creating lock nodes.
                 // this is to reduce the number of lock node creations and deletions in ZK.
                 // the ensemble check is done again after the lock node is created.
-                // also, check if the ledger is being replicated already by the replication worker
                 Versioned<LedgerMetadata> preCheckMetadata = ledgerManager.readLedgerMetadata(ledgerId).get();
-                if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata) || lum.isLedgerBeingReplicated(ledgerId)) {
+                if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata)) {
+                    latch.countDown();
+                    continue;
+                }
+            } catch (Throwable t) {
+                latch.countDown();
+                continue;
+            }
+
+            try {
+                // check if the ledger is being replicated already by the replication worker
+                if (lum.isLedgerBeingReplicated(ledgerId)) {
                     latch.countDown();
                     continue;
                 }