From 179d0d1c8023af09efda5596d5748437232aafe9 Mon Sep 17 00:00:00 2001 From: Deepthi Devaki Akkoorath Date: Wed, 13 Apr 2022 11:01:56 +0200 Subject: [PATCH] fix(broker): do not log transition failure due to term mismatch as error If a transition failed due to a term mismatch, there will be a new transition following. There is no need to log it as an error because conceptually it is not an error. It is expected to fail to prevent inconsistencies. When this failure happens, it is ignored and ZeebePartition continue with the next transition. (cherry picked from commit 713d2ee29c8e1ee4cce24086ac736ab7063b1fea) --- .../camunda/zeebe/broker/system/partitions/ZeebePartition.java | 3 +-- .../system/partitions/impl/PartitionTransitionProcess.java | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/ZeebePartition.java b/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/ZeebePartition.java index 0ae6adcd9f01..118443901e75 100644 --- a/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/ZeebePartition.java +++ b/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/ZeebePartition.java @@ -250,7 +250,6 @@ private ActorFuture leaderTransition(final long newTerm) { }); onRecoveredInternal(); } else { - LOG.error("Failed to install leader partition {}", context.getPartitionId(), error); onInstallFailure(error); } }); @@ -274,7 +273,6 @@ private ActorFuture followerTransition(final long newTerm) { }); onRecoveredInternal(); } else { - LOG.error("Failed to install follower partition {}", context.getPartitionId(), error); onInstallFailure(error); } }); @@ -340,6 +338,7 @@ private void onInstallFailure(final Throwable error) { context.getPartitionId(), error.getMessage()); } else { + LOG.error("Failed to install partition {}", context.getPartitionId(), error); handleRecoverableFailure(); } } diff --git a/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/impl/PartitionTransitionProcess.java b/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/impl/PartitionTransitionProcess.java index 04181d15946d..67aadd0673d4 100644 --- a/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/impl/PartitionTransitionProcess.java +++ b/broker/src/main/java/io/camunda/zeebe/broker/system/partitions/impl/PartitionTransitionProcess.java @@ -84,9 +84,7 @@ private void proceedWithTransition(final ActorFuture future) { private void onStepCompletion(final ActorFuture future, final Throwable error) { if (error != null) { - LOG.error(error.getMessage(), error); future.completeExceptionally(error); - return; }