Search in sources :

Example 1 with SRDFMirrorRollbackCompleter

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);
    }
}
Also used : Volume(com.emc.storageos.db.client.model.Volume) StringSet(com.emc.storageos.db.client.model.StringSet) SRDFChangeCopyModeTaskCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFChangeCopyModeTaskCompleter) TaskCompleter(com.emc.storageos.volumecontroller.TaskCompleter) NullTaskCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.NullTaskCompleter) SRDFTaskCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFTaskCompleter) SRDFMirrorRollbackCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFMirrorRollbackCompleter) NamedURI(com.emc.storageos.db.client.model.NamedURI) URI(java.net.URI) FCTN_STRING_TO_URI(com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_STRING_TO_URI) WorkflowException(com.emc.storageos.workflow.WorkflowException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) LockRetryException(com.emc.storageos.locking.LockRetryException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 2 with SRDFMirrorRollbackCompleter

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);
        }
    }
}
Also used : SRDFMirrorRollbackCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFMirrorRollbackCompleter) WorkflowException(com.emc.storageos.workflow.WorkflowException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) LockRetryException(com.emc.storageos.locking.LockRetryException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Aggregations

StorageSystem (com.emc.storageos.db.client.model.StorageSystem)2 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)2 LockRetryException (com.emc.storageos.locking.LockRetryException)2 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)2 SRDFMirrorRollbackCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFMirrorRollbackCompleter)2 WorkflowException (com.emc.storageos.workflow.WorkflowException)2 NamedURI (com.emc.storageos.db.client.model.NamedURI)1 StringSet (com.emc.storageos.db.client.model.StringSet)1 Volume (com.emc.storageos.db.client.model.Volume)1 FCTN_STRING_TO_URI (com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_STRING_TO_URI)1 TaskCompleter (com.emc.storageos.volumecontroller.TaskCompleter)1 NullTaskCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.NullTaskCompleter)1 SRDFChangeCopyModeTaskCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFChangeCopyModeTaskCompleter)1 SRDFTaskCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFTaskCompleter)1 URI (java.net.URI)1