Skip to content

Commit

Permalink
fix(broker): do not log transition failure due to term mismatch as error
Browse files Browse the repository at this point in the history
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 713d2ee)
  • Loading branch information
deepthidevaki authored and github-actions[bot] committed Apr 13, 2022
1 parent 4bf32f2 commit 179d0d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ private ActorFuture<Void> leaderTransition(final long newTerm) {
});
onRecoveredInternal();
} else {
LOG.error("Failed to install leader partition {}", context.getPartitionId(), error);
onInstallFailure(error);
}
});
Expand All @@ -274,7 +273,6 @@ private ActorFuture<Void> followerTransition(final long newTerm) {
});
onRecoveredInternal();
} else {
LOG.error("Failed to install follower partition {}", context.getPartitionId(), error);
onInstallFailure(error);
}
});
Expand Down Expand Up @@ -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();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ private void proceedWithTransition(final ActorFuture<Void> future) {

private void onStepCompletion(final ActorFuture<Void> future, final Throwable error) {
if (error != null) {
LOG.error(error.getMessage(), error);
future.completeExceptionally(error);

return;
}

Expand Down

0 comments on commit 179d0d1

Please sign in to comment.