Skip to content

Commit c777925

Browse files
authored
Become candidate on publication failure (#96490)
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
1 parent 8b1cd47 commit c777925

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/changelog/96490.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 96490
2+
summary: Become candidate on publication failure
3+
area: Cluster Coordination
4+
type: bug
5+
issues:
6+
- 96273

server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,9 @@ assert getLocalNode().equals(clusterState.getNodes().get(getLocalNode().getId())
15481548
followersChecker.setCurrentNodes(publishNodes);
15491549
lagDetector.setTrackedNodes(publishNodes);
15501550
publication.start(followersChecker.getFaultyNodes());
1551+
} catch (Exception e) {
1552+
assert currentPublication.isEmpty() : e; // should not fail after setting currentPublication
1553+
becomeCandidate("publish");
15511554
} finally {
15521555
publicationContext.decRef();
15531556
}

0 commit comments

Comments
 (0)