michaellx1057 commented on code in PR #18645:
URL: 
https://github.com/apache/dolphinscheduler/pull/18645#discussion_r4027177400


##########
dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/ha/AbstractHAServer.java:
##########
@@ -39,7 +40,11 @@ public abstract class AbstractHAServer implements HAServer {
 
     private final String serverIdentify;
 
-    private ServerStatus serverStatus;
+    private final String electionIdentity;
+
+    private volatile ServerStatus serverStatus;
+
+    private volatile boolean closed;

Review Comment:
   Thanks for the feedback. I agree that the broader lifecycle changes are not 
needed for this fix. In 
[3687df9](https://github.com/apache/dolphinscheduler/pull/18645/commits/3687df9cb819b5acb2bf6099b80f4f4094f36a5f),
 I removed the immediate demotion on election exceptions, the `closed` 
handling, and the related Alert resource-cleanup changes. No new lifecycle 
states are added to `ServerStatus`.
   
   The startup election and Registry callbacks can run on different threads, so 
their election results and role updates are still serialized. The coordinator 
thread handoff protection from 48f3e2a is also retained: subsequent tests 
reproduced overlap during normal loss and reacquisition of leadership, without 
injecting an election exception. I've added the focused test and deployment 
results in [validation 
results](https://github.com/apache/dolphinscheduler/pull/18645#issuecomment-5699157892).
   



-- 
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]

Reply via email to