Source:
public void executeCommand() { Boolean tranRetVal = TransactionSupport.executeInNewTransaction(new TransactionMethod<Boolean>() { @Override public Boolean runInTransaction() { if (!stopGeoReplicationSessions(georepSessions)) { return false; } if (!stopSlaveVolumes(georepSessions)) { return false; } if (!restoreSlaveVolumesToSnapshot(georepSessions, getParameters().getSnapshotName())) { return false; } return true; } }); if (!tranRetVal) { return; } if (!stopVolume(getGlusterVolumeId())) { if (!georepSessions.isEmpty()) { handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE, "Failed to stop the master volume while restoring the snapshot, " + "whereas slave volume(s) are restored to older state. " + "Admin should manually inetrevene and set the stime in master to proper value and resume the geo-replication session"); } return; } if (!restoreVolumeToSnapshot(upServer.getId(), getGlusterVolumeId(), getParameters().getSnapshotName())) { if (!georepSessions.isEmpty()) { handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED, "Failed to restore the master volume, whereas slave volume(s) are restored to older state. " + "Admin should manually inetrevene and set the stime in master to proper value and resume the geo-replication session"); } return; } List<GlusterGeoRepSession> updatedGeoRepSessions = getDbFacade().getGlusterGeoRepDao().getGeoRepSessions(getGlusterVolumeId()); if (!startSlaveVolumes(updatedGeoRepSessions)) { return; } if (!startVolume(getGlusterVolumeId())) { return; } if (!startGeoRepSessions(updatedGeoRepSessions)) { return; } if (!resumeGeoRepSessions(updatedGeoRepSessions)) { return; } setSucceeded(true); }

Target:
public void executeCommand() { Boolean tranRetVal = TransactionSupport.executeInNewTransaction(new TransactionMethod<Boolean>() { @Override public Boolean runInTransaction() { if (georepSessions != null) { if (!stopGeoReplicationSessions(georepSessions)) { return false; } if (!stopSlaveVolumes(georepSessions)) { return false; } if (!restoreSlaveVolumesToSnapshot(georepSessions, getParameters().getSnapshotName())) { return false; } } return true; } }); if (!tranRetVal) { return; } if (!stopVolume(getGlusterVolumeId())) { if (!georepSessions.isEmpty()) { handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_STOP_FAILED_DURING_SNAPSHOT_RESTORE, VdcBllErrors.FailedToStopMasterVolumeDuringVolumeSnapshotRestore.name()); } return; } if (!restoreVolumeToSnapshot(upServer.getId(), getGlusterVolumeId(), getParameters().getSnapshotName())) { if (!georepSessions.isEmpty()) { handleVdsError(AuditLogType.GLUSTER_MASTER_VOLUME_SNAPSHOT_RESTORE_FAILED, VdcBllErrors.FailedToRestoreMasterVolumeDuringVolumeSnapshotRestore.name()); } return; } List<GlusterGeoRepSession> updatedGeoRepSessions = getDbFacade().getGlusterGeoRepDao().getGeoRepSessions(getGlusterVolumeId()); if (updatedGeoRepSessions != null && !startSlaveVolumes(updatedGeoRepSessions)) { return; } if (!startVolume(getGlusterVolumeId())) { return; } if (updatedGeoRepSessions != null) { if (!startGeoRepSessions(updatedGeoRepSessions)) { return; } if (!resumeGeoRepSessions(updatedGeoRepSessions)) { return; } } setSucceeded(true); }