You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by lh...@apache.org on 2024/06/13 10:36:35 UTC

(bookkeeper) branch branch-4.16 updated (7efcbd2b4a -> e69dc98fb2)

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

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


    from 7efcbd2b4a Upgrade to Netty 4.1.111.Final and switch to use grpc-netty-shaded (#4426)
     new 2923cac93b [fix] fix Auditor ignoring bookies shut down before Auditor start (#4419)
     new a76dab9fe5 Fix TimedRunnable log NPE (#4425)
     new 4c1919aea5 fix: release build image error when user's home dir is under /home (#4432)
     new e69dc98fb2 Optimize Release Script for Docker Builds in BookKeeper (#4428)

The 4 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:
 .../org/apache/bookkeeper/common/util/OrderedExecutor.java   | 10 ++++++----
 .../main/java/org/apache/bookkeeper/replication/Auditor.java |  8 +++++++-
 dev/release/000-run-docker.sh                                | 12 ++++++------
 3 files changed, 19 insertions(+), 11 deletions(-)


(bookkeeper) 02/04: Fix TimedRunnable log NPE (#4425)

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

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

commit a76dab9fe5ce379b7eb43050d72143c22fa7e4f5
Author: houxiaoyu <ho...@apache.org>
AuthorDate: Tue Jun 11 07:41:10 2024 +0800

    Fix TimedRunnable log NPE (#4425)
    
    (cherry picked from commit 43b5ccc5adb3ac2a0f96f22740e745c799095281)
---
 .../org/apache/bookkeeper/common/util/OrderedExecutor.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java
index f856a4ea32..a6f137f4aa 100644
--- a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java
+++ b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java
@@ -187,10 +187,12 @@ public class OrderedExecutor implements ExecutorService {
     protected class TimedRunnable implements Runnable {
         final Runnable runnable;
         final long initNanos;
+        final Class<?> runnableClass;
 
         TimedRunnable(Runnable runnable) {
             this.runnable = runnable;
             this.initNanos = MathUtils.nowInNano();
+            this.runnableClass = runnable.getClass();
          }
 
         @Override
@@ -203,8 +205,7 @@ public class OrderedExecutor implements ExecutorService {
                 long elapsedMicroSec = MathUtils.elapsedMicroSec(startNanos);
                 taskExecutionStats.registerSuccessfulEvent(elapsedMicroSec, TimeUnit.MICROSECONDS);
                 if (elapsedMicroSec >= warnTimeMicroSec) {
-                    log.warn("Runnable {}:{} took too long {} micros to execute.", runnable, runnable.getClass(),
-                            elapsedMicroSec);
+                    log.warn("Runnable {} took too long {} micros to execute.", runnableClass, elapsedMicroSec);
                 }
             }
         }
@@ -216,10 +217,12 @@ public class OrderedExecutor implements ExecutorService {
     protected class TimedCallable<T> implements Callable<T> {
         final Callable<T> callable;
         final long initNanos;
+        final Class<?> callableClass;
 
         TimedCallable(Callable<T> callable) {
             this.callable = callable;
             this.initNanos = MathUtils.nowInNano();
+            this.callableClass = callable.getClass();
         }
 
         @Override
@@ -232,8 +235,7 @@ public class OrderedExecutor implements ExecutorService {
                 long elapsedMicroSec = MathUtils.elapsedMicroSec(startNanos);
                 taskExecutionStats.registerSuccessfulEvent(elapsedMicroSec, TimeUnit.MICROSECONDS);
                 if (elapsedMicroSec >= warnTimeMicroSec) {
-                    log.warn("Callable {}:{} took too long {} micros to execute.", callable, callable.getClass(),
-                            elapsedMicroSec);
+                    log.warn("Callable {} took too long {} micros to execute.", callableClass, elapsedMicroSec);
                 }
             }
         }


(bookkeeper) 03/04: fix: release build image error when user's home dir is under /home (#4432)

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

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

commit 4c1919aea5e558ecc6e12618b995831772aa2ca4
Author: zhiheng123 <90...@qq.com>
AuthorDate: Wed Jun 12 16:13:40 2024 +0800

    fix: release build image error when user's home dir is under /home (#4432)
    
    Signed-off-by: zhiheng123 <90...@qq.com>
    (cherry picked from commit 7c9c42960ad85760fbf0a3d6b30f9faceb16948a)
---
 dev/release/000-run-docker.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/release/000-run-docker.sh b/dev/release/000-run-docker.sh
index 248c2e7fec..495227a7e9 100755
--- a/dev/release/000-run-docker.sh
+++ b/dev/release/000-run-docker.sh
@@ -51,7 +51,7 @@ docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
 FROM --platform=linux/amd64 ${IMAGE_NAME}
 RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
   useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} && \
-  ([ "$(dirname "$HOME")" -eq "/home" ] || ln -s /home $(dirname "$HOME")) && \
+  ([ "$(dirname "$HOME")" = "/home" ] || ln -s /home $(dirname "$HOME")) && \
   mkdir -p /gpg && chown ${USER_ID}:${GROUP_ID} /gpg && chmod 700 /gpg
 ENV  HOME /home/${USER_NAME}
 UserSpecificDocker


(bookkeeper) 04/04: Optimize Release Script for Docker Builds in BookKeeper (#4428)

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

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

commit e69dc98fb221af530c053615ff87e12e87342ecf
Author: ZhangJian He <sh...@gmail.com>
AuthorDate: Wed Jun 12 23:08:31 2024 +0800

    Optimize Release Script for Docker Builds in BookKeeper (#4428)
    
    ### Changes
    
    - Replaced `docker build` with `docker buildx build` to enhance cross-platform compatibility.
    - Modified Dockerfile commands to conditionally create user and group only if they do not already exist, preventing errors during the build process.
    
    (cherry picked from commit 88bcdc981f8daf42a1a011f0e2db72a134b86218)
---
 dev/release/000-run-docker.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dev/release/000-run-docker.sh b/dev/release/000-run-docker.sh
index 495227a7e9..845b17ec7e 100755
--- a/dev/release/000-run-docker.sh
+++ b/dev/release/000-run-docker.sh
@@ -33,7 +33,7 @@ export IMAGE_NAME="bookkeeper-release-build"
 
 pushd ${SCRIPT_DIR}
 
-docker build --rm=true -t ${IMAGE_NAME} .
+docker build --platform linux/amd64 --rm=true -t ${IMAGE_NAME} .
 
 popd
 
@@ -47,10 +47,10 @@ else # boot2docker uid and gid
   GROUP_ID=50
 fi
 
-docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
-FROM --platform=linux/amd64 ${IMAGE_NAME}
-RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
-  useradd -l -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} && \
+docker buildx build --platform linux/amd64 -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
+FROM ${IMAGE_NAME}
+RUN if ! getent group ${GROUP_ID} > /dev/null; then groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}; fi && \
+  if ! getent passwd ${USER_NAME} > /dev/null; then useradd -l -g ${GROUP_ID} -u ${GROUP_ID} -k /root -m ${USER_NAME}; fi && \
   ([ "$(dirname "$HOME")" = "/home" ] || ln -s /home $(dirname "$HOME")) && \
   mkdir -p /gpg && chown ${USER_ID}:${GROUP_ID} /gpg && chmod 700 /gpg
 ENV  HOME /home/${USER_NAME}


(bookkeeper) 01/04: [fix] fix Auditor ignoring bookies shut down before Auditor start (#4419)

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

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

commit 2923cac93b97a2d5949c0bfe7f55fd1ee9329afb
Author: Andrey Yegorov <86...@users.noreply.github.com>
AuthorDate: Wed Jun 5 07:57:32 2024 -0700

    [fix] fix Auditor ignoring bookies shut down before Auditor start (#4419)
    
    (cherry picked from commit 896137d6fbd005d6eaf000af2820f1746d5daf45)
---
 .../src/main/java/org/apache/bookkeeper/replication/Auditor.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 13b10cf927..66328e2597 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
@@ -36,6 +36,7 @@ import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.bookkeeper.client.BookKeeperAdmin;
@@ -386,7 +387,12 @@ public class Auditor implements AutoCloseable {
 
             try {
                 watchBookieChanges();
-                knownBookies = getAvailableBookies();
+                // Start with all available bookies
+                // to handle situations where the auditor
+                // is started after some bookies have already failed
+                knownBookies = admin.getAllBookies().stream()
+                        .map(BookieId::toString)
+                        .collect(Collectors.toList());
                 this.ledgerUnderreplicationManager
                         .notifyLostBookieRecoveryDelayChanged(new LostBookieRecoveryDelayChangedCb());
             } catch (BKException bke) {