From fdbcb810032cb4772d9e4d05d7d58fa579914ce2 Mon Sep 17 00:00:00 2001 From: manas-ctds Date: Fri, 24 Oct 2025 16:35:22 +0530 Subject: [PATCH 1/4] Modify log level from error to warn --- .../bookkeeper/proto/PerChannelBookieClient.java | 14 +++----------- .../bookkeeper/replication/ReplicationWorker.java | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java index b163918b893..7ff6b9ff74f 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java @@ -524,7 +524,7 @@ protected ChannelFuture connect() { try { addr = bookieAddressResolver.resolve(bookieId); } catch (BookieAddressResolver.BookieIdNotResolvedException err) { - LOG.error("Cannot connect to {} as endpoint resolution failed (probably bookie is down) err {}", + LOG.warn("Cannot connect to {} as endpoint resolution failed (probably bookie is down) err {}", bookieId, err.toString()); return processBookieNotResolvedError(startTime, err); } @@ -1783,16 +1783,8 @@ public void operationComplete(ChannelFuture future) { return; // pendingOps should have been completed when other channel connected } else { Throwable cause = future.cause(); - if (cause instanceof UnknownHostException || cause instanceof NativeIoException) { - // Don't log stack trace for common errors - logBookieUnavailable(() -> LOG.warn("Could not connect to bookie: {}/{}, current state {} : {}", - future.channel(), bookieId, state, future.cause().getMessage())); - } else { - // Regular exceptions, include stack trace - logBookieUnavailable(() -> LOG.error("Could not connect to bookie: {}/{}, current state {} : ", - future.channel(), bookieId, state, future.cause())); - } - + logBookieUnavailable(() -> LOG.warn("Could not connect to bookie: {}/{}, current state {} : {}", + future.channel(), bookieId, state, future.cause().getMessage())); rc = BKException.Code.BookieHandleNotAvailableException; Channel failedChannel = future.channel(); if (failedChannel != null) { // can be null in case of dummy failed ChannelFuture diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java index 05807455dc4..44636cb277d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java @@ -738,7 +738,7 @@ private void deferLedgerLockReleaseOfFailedLedger(final long ledgerId) { long delayOfLedgerLockReleaseInMSecs = (numOfTimesFailedSoFar >= NUM_OF_EXPONENTIAL_BACKOFF_RETRIALS) ? this.lockReleaseOfFailedLedgerGracePeriod : this.baseBackoffForLockReleaseOfFailedLedger * (int) Math.pow(2, numOfTimesFailedSoFar); - LOG.error( + LOG.warn( "ReplicationWorker failed to replicate Ledger : {} for {} number of times, " + "so deferring the ledger lock release by {} msecs", ledgerId, numOfTimesFailedSoFar, delayOfLedgerLockReleaseInMSecs); From 2c7ea536c92e66ff946894156af64e902a210641 Mon Sep 17 00:00:00 2001 From: manas-ctds Date: Fri, 24 Oct 2025 16:56:30 +0530 Subject: [PATCH 2/4] Remove unused import --- .../java/org/apache/bookkeeper/proto/PerChannelBookieClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java index 7ff6b9ff74f..250fa0a016d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java @@ -63,7 +63,6 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; -import java.net.UnknownHostException; import java.security.cert.Certificate; import java.util.ArrayDeque; import java.util.ArrayList; From 4cfed9cd6b12571742339782aa59e6dfe1931e6b Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Wed, 22 Oct 2025 12:53:14 +0800 Subject: [PATCH 3/4] [fix]compile error of the file native_io_jni.c for the env jdk11 & windows (#4665) Co-authored-by: fengyubiao (cherry picked from commit 5154149936e3f8187ae9e2755f43ea9c0ecb866e) --- .../src/main/native-io-jni/cpp/native_io_jni.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/native-io/src/main/native-io-jni/cpp/native_io_jni.c b/native-io/src/main/native-io-jni/cpp/native_io_jni.c index d3bc164bec9..7be468518b0 100644 --- a/native-io/src/main/native-io-jni/cpp/native_io_jni.c +++ b/native-io/src/main/native-io-jni/cpp/native_io_jni.c @@ -20,11 +20,16 @@ */ #define _GNU_SOURCE +#include #include #include #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include @@ -165,7 +170,14 @@ JNIEXPORT jint JNICALL Java_org_apache_bookkeeper_common_util_nativeio_NativeIOJni_fsync(JNIEnv * env, jclass clazz, jint fd) { - int res = fsync(fd); + int res; + + // Guarantee compatibility for winsows. + #ifdef _WIN32 + res = _commit((int)fd); + #else + res = fsync((int)fd); + #endif if (res == -1) { throwExceptionWithErrno(env, "Failed to fsync"); From 2e9d39044d1b9bb0688fd6463dbd63ba5d19f87a Mon Sep 17 00:00:00 2001 From: manas-ctds Date: Thu, 30 Oct 2025 17:25:54 +0530 Subject: [PATCH 4/4] Update github runner image to ubuntu-latest --- .github/workflows/bk-ci.yml | 12 ++++++------ .github/workflows/bk-streamstorage-python.yml | 4 ++-- .github/workflows/bot.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/dead-link-checker.yaml | 2 +- .github/workflows/website-deploy.yaml | 2 +- .github/workflows/website-pr-validation.yml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml index 5348bc86ff4..a14437c5006 100644 --- a/.github/workflows/bk-ci.yml +++ b/.github/workflows/bk-ci.yml @@ -43,7 +43,7 @@ concurrency: jobs: build-and-license-check: name: PR Validation - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout @@ -98,7 +98,7 @@ jobs: unit-tests: name: ${{ matrix.step_name }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: ${{ matrix.timeout || 60 }} needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -206,7 +206,7 @@ jobs: integration-tests: name: Integration Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 75 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -298,7 +298,7 @@ jobs: backward-compatibility-tests: name: Backward compatibility tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 75 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -449,7 +449,7 @@ jobs: jdk-compatibility-checks: name: ${{ matrix.step_name }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: ${{ matrix.timeout || 60 }} needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -496,7 +496,7 @@ jobs: owasp-dependency-check: name: OWASP Dependency Check - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.need_owasp == 'true' }} diff --git a/.github/workflows/bk-streamstorage-python.yml b/.github/workflows/bk-streamstorage-python.yml index 897c5cfdeab..d785c5cb716 100644 --- a/.github/workflows/bk-streamstorage-python.yml +++ b/.github/workflows/bk-streamstorage-python.yml @@ -39,7 +39,7 @@ on: jobs: stream-storage-python-client-unit-tests: name: StreamStorage Python Client Unit Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: checkout @@ -52,7 +52,7 @@ jobs: Stream-storage-python-client-integration-tests: name: StreamStorage Python Client Integration Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: checkout diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index 26e1f973267..43d61c1179a 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -25,7 +25,7 @@ on: jobs: bot: name: Bot tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: clone repository diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fa459876bd1..19b6393ee5d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,7 +29,7 @@ on: jobs: analyze: name: Analyze - runs-on: 'ubuntu-22.04' + runs-on: 'ubuntu-latest' timeout-minutes: 360 permissions: # required for all workflows diff --git a/.github/workflows/dead-link-checker.yaml b/.github/workflows/dead-link-checker.yaml index 1c87cab6746..944a5bf2032 100644 --- a/.github/workflows/dead-link-checker.yaml +++ b/.github/workflows/dead-link-checker.yaml @@ -33,7 +33,7 @@ concurrency: jobs: check-dead-links: name: Dead link checker - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/website-deploy.yaml b/.github/workflows/website-deploy.yaml index a31140362ed..868b1db0c7b 100644 --- a/.github/workflows/website-deploy.yaml +++ b/.github/workflows/website-deploy.yaml @@ -34,7 +34,7 @@ jobs: build-website: name: Build and deploy the website if: ${{ github.repository == 'apache/bookkeeper' }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 180 steps: - name: Checkout diff --git a/.github/workflows/website-pr-validation.yml b/.github/workflows/website-pr-validation.yml index fe7c40a504b..6b813f7c5e9 100644 --- a/.github/workflows/website-pr-validation.yml +++ b/.github/workflows/website-pr-validation.yml @@ -32,7 +32,7 @@ on: jobs: website-pull-validation: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout