Skip to content

Commit a7a4fb7

Browse files
committed
core: allow trying to select new SPM when network problems with current SPM
For now there is some cases when SPM can be safely transited to another host when there is network problems with the current SPM. But some checks not allow to start this process. With this change we allow to start process to select new SPM. If this process not safe, selection process will be stopped on next steps. Signed-off-by: Stanislav Melnichuk <[email protected]>
1 parent 926fa0f commit a7a4fb7

File tree

1 file changed

+3
-6
lines changed
  • backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker

1 file changed

+3
-6
lines changed

backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsProxyImpl.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
import org.ovirt.engine.core.vdsbroker.ResourceManager;
9090
import org.ovirt.engine.core.vdsbroker.TransportFactory;
9191
import org.ovirt.engine.core.vdsbroker.storage.StoragePoolDomainHelper;
92-
import org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException;
9392
import org.slf4j.Logger;
9493
import org.slf4j.LoggerFactory;
9594

@@ -299,6 +298,7 @@ private void proceedStoragePoolStats(StoragePool storagePool) {
299298
new SpmStatusVDSCommandParameters(curVdsId, storagePoolId));
300299
}
301300

301+
// if spm status didn't work or not spm then cause failover with attempts
302302
if (result == null
303303
|| !result.getSucceeded()
304304
|| result.getSucceeded() && ((SpmStatusResult) result.getReturnValue()).getSpmStatus() != SpmStatus.SPM) {
@@ -316,10 +316,7 @@ private void proceedStoragePoolStats(StoragePool storagePool) {
316316
}
317317
}
318318

319-
// if spm status didn't work or not spm and NOT NETWORK
320-
// PROBLEM
321-
// then cause failover with attempts
322-
if (result != null && !(result.getExceptionObject() instanceof VDSNetworkException)) {
319+
if (curVdsId != null) { // If there was already SPM host, then we can start failover process
323320
Map<Guid, AsyncTaskStatus> tasksList =
324321
(Map<Guid, AsyncTaskStatus>) resourceManager
325322
.runVdsCommand(VDSCommandType.HSMGetAllTasksStatuses,
@@ -336,7 +333,7 @@ private void proceedStoragePoolStats(StoragePool storagePool) {
336333
if (tasksList == null || allTasksFinished) {
337334
nullifyInternalProxies();
338335
} else {
339-
if (_errorAttempts < Config.<Integer> getValue(ConfigValues.SPMFailOverAttempts)) {
336+
if (_errorAttempts < Config.<Integer>getValue(ConfigValues.SPMFailOverAttempts)) {
340337
_errorAttempts++;
341338
log.warn("failed getting spm status for pool '{}' ({}), attempt number: {}",
342339
storagePoolId, storagePool.getName(), _errorAttempts);

0 commit comments

Comments
 (0)