Only handle exception when there has
This commit is contained in:
parent
847a97c5f5
commit
c1f21e9862
35
0016-handle-exception.patch
Normal file
35
0016-handle-exception.patch
Normal file
@ -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);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
%define pulsar_ver 2.10.4
|
%define pulsar_ver 2.10.4
|
||||||
%define pkg_ver 15
|
%define pkg_ver 16
|
||||||
%define _prefix /opt/pulsar
|
%define _prefix /opt/pulsar
|
||||||
Summary: Cloud-Native, Distributed Messaging and Streaming
|
Summary: Cloud-Native, Distributed Messaging and Streaming
|
||||||
Name: pulsar
|
Name: pulsar
|
||||||
@ -25,6 +25,7 @@ Patch0012: 0012-CVE-2023-2976.patch
|
|||||||
Patch0013: 0013-fix-deadlock.patch
|
Patch0013: 0013-fix-deadlock.patch
|
||||||
Patch0014: 0014-CVE-2023-32732.patch
|
Patch0014: 0014-CVE-2023-32732.patch
|
||||||
Patch0015: 0015-fix-no-messages.patch
|
Patch0015: 0015-fix-no-messages.patch
|
||||||
|
Patch0016: 0016-handle-exception.patch
|
||||||
BuildRoot: /root/rpmbuild/BUILDROOT/
|
BuildRoot: /root/rpmbuild/BUILDROOT/
|
||||||
BuildRequires: java-1.8.0-openjdk-devel,maven,systemd
|
BuildRequires: java-1.8.0-openjdk-devel,maven,systemd
|
||||||
Requires: java-1.8.0-openjdk,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
|
%patch0013 -p1
|
||||||
%patch0014 -p1
|
%patch0014 -p1
|
||||||
%patch0015 -p1
|
%patch0015 -p1
|
||||||
|
%patch0016 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mvn clean install -Pcore-modules,-main -DskipTests
|
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
|
exit 0
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 8 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-16
|
||||||
|
- Only handle exception when there has
|
||||||
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-15
|
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-15
|
||||||
- fix Can not receive any messages after switch to standby cluster
|
- fix Can not receive any messages after switch to standby cluster
|
||||||
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-14
|
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-14
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user