ruanwenjun commented on code in PR #18275:
URL: 
https://github.com/apache/dolphinscheduler/pull/18275#discussion_r3278602740


##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/server/JdbcRegistryServer.java:
##########
@@ -340,7 +340,7 @@ private void refreshClientsHeartbeat() {
                 }
                 JdbcRegistryClientHeartbeatDTO clone = 
jdbcRegistryClientHeartbeatDTO.clone();
                 clone.setLastHeartbeatTime(now);
-                
jdbcRegistryClientRepository.updateById(jdbcRegistryClientHeartbeatDTO);
+                
jdbcRegistryClientRepository.upsert(jdbcRegistryClientHeartbeatDTO);

Review Comment:
   A more recommended approach would be to throw an exception when
   ```
   jdbcRegistryClientRepository.updateById(jdbcRegistryClientHeartbeatDTO);
   ```
   fails, and make refreshClientsHeartbeat return directly when 
jdbcRegistryServerState == JdbcRegistryServerState.DISCONNECTED.



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