weizhouapache commented on code in PR #9885:
URL: https://github.com/apache/cloudstack/pull/9885#discussion_r1837999983
##########
server/src/main/java/com/cloud/server/StatsCollector.java:
##########
@@ -1153,6 +1157,17 @@ public String newStatus(ClusterServicePdu pdu) {
try {
hostStatsEntry = gson.fromJson(pdu.getJsonPackage(),new
TypeToken<ManagementServerHostStatsEntry>(){}.getType());
managementServerHostStats.put(hostStatsEntry.getManagementServerHostUuid(),
hostStatsEntry);
+
+ // Update peer state to Up in mshost_peer
+ ManagementServerHostVO mgmtServerVo =
managementServerHostDao.findByMsid(managementServerNodeId);
+ if (mgmtServerVo != null) {
+ msId = mgmtServerVo.getId();
+ if (msId != hostStatsEntry.getManagementServerHostId()) {
+ managementServerHostPeerDao.updatePeerInfo(msId,
hostStatsEntry.getManagementServerHostId(),
hostStatsEntry.getManagementServerRunId(), ManagementServerHost.State.Up);
+ }
+ } else {
+ logger.warn(String.format("Cannot find management server
with msid [%s]. Therefore, do not update peer info.", managementServerNodeId));
+ }
Review Comment:
done
--
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]