qiuyanjun888 commented on PR #18416:
URL: 
https://github.com/apache/dolphinscheduler/pull/18416#issuecomment-4997789600

   > When `updateById(clone)` returns `false`, the new `RegistryException` is 
caught by the generic error handler. If the server is currently `STARTED`, the 
catch block only moves it to `SUSPENDED`; it does not immediately invoke 
`onDisConnected()`.
   > 
   > This can happen after a long JVM pause or heartbeat scheduler starvation:
   > 
   > 1. Another registry server considers the session expired and removes its 
heartbeat, ephemeral data, and locks.
   > 2. The original server resumes while its local state is still `STARTED`.
   > 3. `updateById()` returns `false`.
   > 4. The original server enters `SUSPENDED` and remains active until at 
least the next heartbeat cycle.
   > 
   > A missing heartbeat row is definitive evidence that the session has 
expired, not a transient database error. Continuing to run after that point can 
overlap with a server that has already taken over, leaving a split-brain window.
   > 
   > Please handle this condition separately and transition directly to 
`DISCONNECTED`, triggering the disconnection callback exactly once.
   > 
   > The new test sets the server state to `SUSPENDED` and 
`lastSuccessHeartbeat` to zero, so it bypasses the problematic `STARTED` 
branch. Please also add a test verifying that a zero-row heartbeat update while 
`STARTED` causes an immediate disconnection.
   
   Thanks for your suggestions! I have already implemented, can you please help 
review? 


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