pallavithegod commented on code in PR #3358:
URL: https://github.com/apache/hugegraph/pull/3358#discussion_r4306709023
##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftStateMachine.java:
##########
@@ -214,13 +214,10 @@ public void onLeaderStart(final long term) {
@Override
public void onLeaderStop(final Status status) {
this.leaderTerm.set(-1);
- // TODO: keep STATE_ERROR set by onError instead of overwriting it
with STATE_FOLLOWER, so
- // the probe view, and with it /v1/ready, reports a PD that stepped
down for good after a
- // snapshot failure. /v1/health does not read this view; making it
report the state is the
- // separate TODO at StoreAPI.checkHealthy. The Helm chart
(helm/hugegraph) works around both
- // by deriving a single PD's startup and liveness probes to /v1/ready.
- // https://github.com/apache/hugegraph/issues/3222
- this.probeView = new ProbeView(State.STATE_FOLLOWER, false);
+ // JRaft steps down after reporting a fatal error. That callback does
not recover the node.
+ if (this.probeView.state != State.STATE_ERROR) {
Review Comment:
Fixed in 5c302791d, preserving the master merge. Leader-start and
start-following callbacks now ignore terminal error/shutdown states;
leader-stop preserves both terminal states too. StoreAPIReadyTest covers the
requested ERROR/LEADER_STOP/START_FOLLOWING/STOP_FOLLOWING sequence, a queued
leader-start, and shutdown transitions. All nine cases, clean compilation, RAT,
and repository Checkstyle pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]