{"record":{"id":"07d95d524c86d3d8","repo":"aeron-io/aeron","slug":"potential-new-election-in-progress","errorCode":null,"errorMessage":"potential new election in progress","messagePattern":"potential new election in progress","errorType":"exception","errorClass":"ClusterEvent","httpStatus":null,"severity":"critical","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/Election.java","lineNumber":325,"sourceCode":"            {\n                if (Cluster.Role.LEADER == consensusModuleAgent.role())\n                {\n                    final long nowNs = nowNs(ctx);\n                    publishNewLeadershipTerm(\n                        follower,\n                        logLeadershipTermId,\n                        consensusModuleAgent.quorumPositionBoundedByLeaderLog(\n                            appendPosition, nowNs),\n                        nanosToTimestamp(ctx, nowNs));\n                }\n            }\n            else if (logLeadershipTermId > this.leadershipTermId)\n            {\n                switch (state)\n                {\n                    case LEADER_LOG_REPLICATION:\n                    case LEADER_READY:\n                        throw new ClusterEvent(\"potential new election in progress\");\n\n                    default:\n                        break;\n                }\n            }\n        }\n    }\n\n    void onRequestVote(\n        final long logLeadershipTermId,\n        final long logPosition,\n        final long candidateTermId,\n        final int candidateId,\n        final int protocolVersion)\n    {\n        if (INIT == state)\n        {\n            return;","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/Election.java#L307-L343","documentation":"During onCanvassPosition, a member in LEADER_LOG_REPLICATION or LEADER_READY state received a canvass position with a leadershipTermId greater than its own. Since it believes it is leader of the current term, a higher term implies a new election started elsewhere — an event the leader-state machine cannot absorb, so it throws ClusterEvent to surface the conflict.","triggerScenarios":"A split-brain or delayed member starts canvassing for a higher term while the current leader is actively serving (LEADER_READY/LEADER_LOG_REPLICATION); typically from clock/timeouts allowing two leaders or a stale member rejoining with a higher recorded term.","commonSituations":"Node rejoined after long downtime with a higher leadershipTermId in its mark file; partitioned member started its own elections; inconsistent cluster mark files after manual restore.","solutions":["Ensure all members' mark files come from the same cluster history — restore mark files + snapshots together from one backup","Restart the whole cluster from a consistent snapshot if term counters diverged","Check for network partitions that let a member elect itself in a higher term","Upgrade Aeron — election term-conflict handling has been hardened in later releases"],"exampleFix":"// before: node restored with mark file from the future (higher leadershipTermId)\nClusterEvent: potential new election in progress\n// after: copy the authoritative mark file from the live cluster leader to the rejoining node, then restart it","handlingStrategy":"try-catch","validationCode":"// Before rejoining a node, compare its mark file leadershipTermId with the cluster leader's\nif (joiningMarkFile.leadershipTermId() > leaderMarkFile.leadershipTermId()) { /* restore correct mark file */ }","typeGuard":null,"tryCatchPattern":"try {\n    cluster.start();\n} catch (ClusterEvent e) {\n    if (e.getMessage().contains(\"potential new election in progress\")) {\n        // stop the node, align mark files with the live cluster, restart\n    } else { throw e; }\n}","preventionTips":["Restore mark files only from the live cluster's authoritative copy","Avoid partitioned nodes auto-rejoining with divergent terms","Monitor for network partitions and quorum loss"],"tags":["aeron","cluster","election","split-brain"],"backgroundTag":"invalid-state-transition","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}