shwstppr commented on code in PR #10524:
URL: https://github.com/apache/cloudstack/pull/10524#discussion_r1986988175
##########
server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java:
##########
@@ -159,31 +171,41 @@ public void propagateMSListToAgents() {
logger.debug("Propagating management server list update to agents");
final String lbAlgorithm = getLBAlgorithmName();
List<DataCenterVO> zones = dataCenterDao.listAll();
+ Long lbCheckInterval = getLBPreferredHostCheckInterval(null);
for (DataCenterVO zone : zones) {
List<Long> zoneHostIds = new ArrayList<>();
+ List<Long> nonRoutingHostIds =
getAllAgentBasedNonRoutingHostsFromDB(zone.getId());
+ zoneHostIds.addAll(nonRoutingHostIds);
Map<Long, List<Long>> clusterHostIdsMap = new HashMap<>();
List<Long> clusterIds = clusterDao.listAllClusterIds(zone.getId());
for (Long clusterId : clusterIds) {
- List<Long> hostIds = getAllAgentBasedHostsFromDB(zone.getId(),
clusterId);
+ List<Long> hostIds =
getAllAgentBasedRoutingHostsFromDB(zone.getId(), clusterId);
clusterHostIdsMap.put(clusterId, hostIds);
zoneHostIds.addAll(hostIds);
}
zoneHostIds.sort(Comparator.comparingLong(x -> x));
+ for (Long nonRoutingHostId : nonRoutingHostIds) {
+ setupMSList(nonRoutingHostId, zone.getId(), zoneHostIds,
lbAlgorithm, lbCheckInterval);
Review Comment:
```suggestion
setupMSList(nonRoutingHostId, zone.getId(), zoneHostIds,
lbAlgorithm, globalLbCheckInterval);
```
##########
server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java:
##########
@@ -159,31 +171,41 @@ public void propagateMSListToAgents() {
logger.debug("Propagating management server list update to agents");
final String lbAlgorithm = getLBAlgorithmName();
List<DataCenterVO> zones = dataCenterDao.listAll();
+ Long lbCheckInterval = getLBPreferredHostCheckInterval(null);
for (DataCenterVO zone : zones) {
List<Long> zoneHostIds = new ArrayList<>();
+ List<Long> nonRoutingHostIds =
getAllAgentBasedNonRoutingHostsFromDB(zone.getId());
+ zoneHostIds.addAll(nonRoutingHostIds);
Map<Long, List<Long>> clusterHostIdsMap = new HashMap<>();
List<Long> clusterIds = clusterDao.listAllClusterIds(zone.getId());
for (Long clusterId : clusterIds) {
- List<Long> hostIds = getAllAgentBasedHostsFromDB(zone.getId(),
clusterId);
+ List<Long> hostIds =
getAllAgentBasedRoutingHostsFromDB(zone.getId(), clusterId);
clusterHostIdsMap.put(clusterId, hostIds);
zoneHostIds.addAll(hostIds);
}
zoneHostIds.sort(Comparator.comparingLong(x -> x));
+ for (Long nonRoutingHostId : nonRoutingHostIds) {
+ setupMSList(nonRoutingHostId, zone.getId(), zoneHostIds,
lbAlgorithm, lbCheckInterval);
+ }
for (Long clusterId : clusterIds) {
- final Long lbCheckInterval =
getLBPreferredHostCheckInterval(clusterId);
+ lbCheckInterval = getLBPreferredHostCheckInterval(clusterId);
List<Long> hostIds = clusterHostIdsMap.get(clusterId);
for (Long hostId : hostIds) {
- final List<String> msList =
getManagementServerList(hostId, zone.getId(), zoneHostIds);
- final SetupMSListCommand cmd = new
SetupMSListCommand(msList, lbAlgorithm, lbCheckInterval);
- final Answer answer = agentManager.easySend(hostId, cmd);
- if (answer == null || !answer.getResult()) {
- logger.warn("Failed to setup management servers list
to the agent of ID: {}", hostId);
- }
+ setupMSList(hostId, zone.getId(), zoneHostIds,
lbAlgorithm, lbCheckInterval);
Review Comment:
```suggestion
setupMSList(hostId, zone.getId(), zoneHostIds,
lbAlgorithm, clusterLbCheckInterval);
```
##########
server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java:
##########
@@ -159,31 +171,41 @@ public void propagateMSListToAgents() {
logger.debug("Propagating management server list update to agents");
final String lbAlgorithm = getLBAlgorithmName();
List<DataCenterVO> zones = dataCenterDao.listAll();
+ Long lbCheckInterval = getLBPreferredHostCheckInterval(null);
Review Comment:
```suggestion
final Long globalLbCheckInterval =
getLBPreferredHostCheckInterval(null);
```
##########
server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java:
##########
@@ -159,31 +171,41 @@ public void propagateMSListToAgents() {
logger.debug("Propagating management server list update to agents");
final String lbAlgorithm = getLBAlgorithmName();
List<DataCenterVO> zones = dataCenterDao.listAll();
+ Long lbCheckInterval = getLBPreferredHostCheckInterval(null);
for (DataCenterVO zone : zones) {
List<Long> zoneHostIds = new ArrayList<>();
+ List<Long> nonRoutingHostIds =
getAllAgentBasedNonRoutingHostsFromDB(zone.getId());
+ zoneHostIds.addAll(nonRoutingHostIds);
Map<Long, List<Long>> clusterHostIdsMap = new HashMap<>();
List<Long> clusterIds = clusterDao.listAllClusterIds(zone.getId());
for (Long clusterId : clusterIds) {
- List<Long> hostIds = getAllAgentBasedHostsFromDB(zone.getId(),
clusterId);
+ List<Long> hostIds =
getAllAgentBasedRoutingHostsFromDB(zone.getId(), clusterId);
clusterHostIdsMap.put(clusterId, hostIds);
zoneHostIds.addAll(hostIds);
}
zoneHostIds.sort(Comparator.comparingLong(x -> x));
+ for (Long nonRoutingHostId : nonRoutingHostIds) {
+ setupMSList(nonRoutingHostId, zone.getId(), zoneHostIds,
lbAlgorithm, lbCheckInterval);
+ }
for (Long clusterId : clusterIds) {
- final Long lbCheckInterval =
getLBPreferredHostCheckInterval(clusterId);
+ lbCheckInterval = getLBPreferredHostCheckInterval(clusterId);
Review Comment:
```suggestion
final Long clusterLbCheckInterval =
getLBPreferredHostCheckInterval(clusterId);
```
--
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]