@@ -171,6 +171,7 @@ public void propagateMSListToAgents() {
171
171
logger .debug ("Propagating management server list update to agents" );
172
172
final String lbAlgorithm = getLBAlgorithmName ();
173
173
List <DataCenterVO > zones = dataCenterDao .listAll ();
174
+ Long lbCheckInterval = getLBPreferredHostCheckInterval (null );
174
175
for (DataCenterVO zone : zones ) {
175
176
List <Long > zoneHostIds = new ArrayList <>();
176
177
List <Long > nonRoutingHostIds = getAllAgentBasedNonRoutingHostsFromDB (zone .getId ());
@@ -183,23 +184,21 @@ public void propagateMSListToAgents() {
183
184
zoneHostIds .addAll (hostIds );
184
185
}
185
186
zoneHostIds .sort (Comparator .comparingLong (x -> x ));
186
- Long lbCheckInterval = getLBPreferredHostCheckInterval (null );
187
187
for (Long nonRoutingHostId : nonRoutingHostIds ) {
188
- setupMSList (nonRoutingHostId , zone .getId (), zoneHostIds , lbCheckInterval );
188
+ setupMSList (nonRoutingHostId , zone .getId (), zoneHostIds , lbAlgorithm , lbCheckInterval );
189
189
}
190
190
for (Long clusterId : clusterIds ) {
191
191
lbCheckInterval = getLBPreferredHostCheckInterval (clusterId );
192
192
List <Long > hostIds = clusterHostIdsMap .get (clusterId );
193
193
for (Long hostId : hostIds ) {
194
- setupMSList (hostId , zone .getId (), zoneHostIds , lbCheckInterval );
194
+ setupMSList (hostId , zone .getId (), zoneHostIds , lbAlgorithm , lbCheckInterval );
195
195
}
196
196
}
197
197
}
198
198
}
199
199
200
- private void setupMSList (final Long hostId , final Long dcId , final List <Long > orderedHostIdList , final Long lbCheckInterval ) {
200
+ private void setupMSList (final Long hostId , final Long dcId , final List <Long > orderedHostIdList , final String lbAlgorithm , final Long lbCheckInterval ) {
201
201
final List <String > msList = getManagementServerList (hostId , dcId , orderedHostIdList );
202
- final String lbAlgorithm = getLBAlgorithmName ();
203
202
final SetupMSListCommand cmd = new SetupMSListCommand (msList , lbAlgorithm , lbCheckInterval );
204
203
final Answer answer = agentManager .easySend (hostId , cmd );
205
204
if (answer == null || !answer .getResult ()) {
0 commit comments