diff --git a/0016-handle-exception.patch b/0016-handle-exception.patch new file mode 100644 index 0000000000000000000000000000000000000000..c67a438e6bf37cecb982732fd4b144a28ff86ebf --- /dev/null +++ b/0016-handle-exception.patch @@ -0,0 +1,35 @@ +diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java +index fe1e60d201..b98a111455 100644 +--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java ++++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java +@@ -470,18 +470,20 @@ public class BookkeeperSchemaStorage implements SchemaStorage { + concat(locator.getIndexList(), newArrayList(info)) + ).build(), locatorEntry.version + ).thenApply(ignore -> nextVersion).whenComplete((__, ex) -> { +- Throwable cause = FutureUtil.unwrapCompletionException(ex); +- log.warn("[{}] Failed to update schema locator with position {}", schemaId, position, cause); +- if (cause instanceof AlreadyExistsException || cause instanceof BadVersionException) { +- bookKeeper.asyncDeleteLedger(position.getLedgerId(), new AsyncCallback.DeleteCallback() { +- @Override +- public void deleteComplete(int rc, Object ctx) { +- if (rc != BKException.Code.OK) { +- log.warn("[{}] Failed to delete ledger {} after updating schema locator failed, rc: {}", ++ if (ex != null) { ++ Throwable cause = FutureUtil.unwrapCompletionException(ex); ++ log.warn("[{}] Failed to update schema locator with position {}", schemaId, position, cause); ++ if (cause instanceof AlreadyExistsException || cause instanceof BadVersionException) { ++ bookKeeper.asyncDeleteLedger(position.getLedgerId(), new AsyncCallback.DeleteCallback() { ++ @Override ++ public void deleteComplete(int rc, Object ctx) { ++ if (rc != BKException.Code.OK) { ++ log.warn("[{}] Failed to delete ledger {} after updating schema locator failed, rc: {}", + schemaId, position.getLedgerId(), rc); ++ } + } +- } +- }, null); ++ }, null); ++ } + } + }); + } diff --git a/pulsar.spec b/pulsar.spec index c2bfccc3c53202b88a1a1cbd866807f29104a5bc..a3d3e4d2969785e50178dfe48c1235cdc58fa614 100644 --- a/pulsar.spec +++ b/pulsar.spec @@ -1,6 +1,6 @@ %define debug_package %{nil} %define pulsar_ver 2.10.4 -%define pkg_ver 15 +%define pkg_ver 16 %define _prefix /opt/pulsar Summary: Cloud-Native, Distributed Messaging and Streaming Name: pulsar @@ -25,6 +25,7 @@ Patch0012: 0012-CVE-2023-2976.patch Patch0013: 0013-fix-deadlock.patch Patch0014: 0014-CVE-2023-32732.patch Patch0015: 0015-fix-no-messages.patch +Patch0016: 0016-handle-exception.patch BuildRoot: /root/rpmbuild/BUILDROOT/ BuildRequires: java-1.8.0-openjdk-devel,maven,systemd Requires: java-1.8.0-openjdk,systemd @@ -52,6 +53,7 @@ Pulsar is a distributed pub-sub messaging platform with a very flexible messagin %patch0013 -p1 %patch0014 -p1 %patch0015 -p1 +%patch0016 -p1 %build mvn clean install -Pcore-modules,-main -DskipTests @@ -77,6 +79,8 @@ getent passwd pulsar >/dev/null || useradd -r -g pulsar -d / -s /sbin/nologin pu exit 0 %changelog +* Fri Dec 8 2023 Dapeng Sun - 2.10.4-16 +- Only handle exception when there has * Thu Dec 7 2023 Dapeng Sun - 2.10.4-15 - fix Can not receive any messages after switch to standby cluster * Thu Dec 7 2023 Dapeng Sun - 2.10.4-14