use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFMirrorRollbackCompleter in project coprhd-controller by CoprHD.
the class SRDFDeviceController method rollbackAddSyncVolumePairStep.
public boolean rollbackAddSyncVolumePairStep(final URI systemURI, final List<URI> sourceURIs, final List<URI> targetURIs, final boolean isGroupRollback, final String opId) {
log.info("START rollback srdf volume pair");
TaskCompleter completer = new SRDFMirrorRollbackCompleter(sourceURIs, opId);
try {
StorageSystem system = getStorageSystem(systemURI);
List<Volume> sources = dbClient.queryObject(Volume.class, sourceURIs);
for (Volume source : sources) {
StringSet targets = source.getSrdfTargets();
for (String targetStr : targets) {
URI targetURI = URI.create(targetStr);
if (!targetURIs.contains(targetURI)) {
continue;
}
Volume target = dbClient.queryObject(Volume.class, targetURI);
rollbackAddSyncVolumePair(system, source, target);
}
}
} catch (Exception e) {
log.warn("Error during rollback for adding sync pairs", e);
} finally {
return completeAsReady(completer, opId);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFMirrorRollbackCompleter in project coprhd-controller by CoprHD.
the class SRDFDeviceController method rollbackSRDFLinksStep.
public boolean rollbackSRDFLinksStep(URI systemURI, List<URI> sourceURIs, List<URI> targetURIs, boolean isGroupRollback, boolean isVpoolChange, String opId) {
log.info("START rollback multiple SRDF links");
SRDFMirrorRollbackCompleter completer = null;
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem system = getStorageSystem(systemURI);
completer = new SRDFMirrorRollbackCompleter(sourceURIs, opId);
InvokeTestFailure.internalOnlyInvokeTestFailure(InvokeTestFailure.ARTIFICIAL_FAILURE_076);
getRemoteMirrorDevice().doRollbackLinks(system, sourceURIs, targetURIs, isGroupRollback, isVpoolChange, completer);
InvokeTestFailure.internalOnlyInvokeTestFailure(InvokeTestFailure.ARTIFICIAL_FAILURE_077);
} catch (Exception e) {
log.error("Exception while rolling back SRDF sources: {}", sourceURIs, e);
// Succeed here, to allow other rollbacks to run
cleanupCGsOnRollbackError(sourceURIs, targetURIs, systemURI, isVpoolChange);
return completeAsError(completer, DeviceControllerException.errors.jobFailed(e), opId);
} finally {
if (completer.hasRollbackFailures()) {
return completeAsError(completer, DeviceControllerException.errors.unforeseen(), opId);
} else {
return completeAsReady(completer, opId);
}
}
}
Aggregations