Skip to content

Commit

Permalink
Become candidate on publication failure (#96490)
Browse files Browse the repository at this point in the history
If the publication fails before starting (e.g. due to one of the
precondition checks in `CoordinationState#handleClientValue`) then we
must explicitly stand down as leader.

Closes #96273
  • Loading branch information
DaveCTurner committed Jun 1, 2023
1 parent 8b1cd47 commit c777925
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/96490.yaml
@@ -0,0 +1,6 @@
pr: 96490
summary: Become candidate on publication failure
area: Cluster Coordination
type: bug
issues:
- 96273
Expand Up @@ -1548,6 +1548,9 @@ assert getLocalNode().equals(clusterState.getNodes().get(getLocalNode().getId())
followersChecker.setCurrentNodes(publishNodes);
lagDetector.setTrackedNodes(publishNodes);
publication.start(followersChecker.getFaultyNodes());
} catch (Exception e) {
assert currentPublication.isEmpty() : e; // should not fail after setting currentPublication
becomeCandidate("publish");
} finally {
publicationContext.decRef();
}
Expand Down

0 comments on commit c777925

Please sign in to comment.