// Token: 0x0600195D RID: 6493 RVA: 0x00069564 File Offset: 0x00067764 private LocalizedString RunPrereqsForResume(AutoReseedWorkflowState state) { LocalizedString result = LocalizedString.Empty; this.TraceBeginPrereqs(state); if (base.Context.TargetCopyStatus.CopyStatus.ResumeBlocked) { string messageOrNoneString = AmExceptionHelper.GetMessageOrNoneString(base.Context.TargetCopyStatus.CopyStatus.ErrorMessage); result = ReplayStrings.AutoReseedFailedResumeBlocked(messageOrNoneString); base.TraceError("RunPrereqsForResume(): The DatabaseCopy is marked as ResumeBlocked, so Resume stage is being skipped. Workflow will try AssignSpare stage next. DatabaseCopy has ErrorMessage: {0}", new object[] { messageOrNoneString }); ReplayCrimsonEvents.AutoReseedWorkflowDbResumeBlocked.Log <string, Guid, string, string, string>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason, messageOrNoneString); state.UpdateReseedRecoveryAction(ReseedState.AssignSpare); } else if (state.ReseedRecoveryActionRetryCount >= RegistryParameters.AutoReseedDbFailedResumeRetryCountMax) { int autoReseedDbFailedResumeRetryCountMax = RegistryParameters.AutoReseedDbFailedResumeRetryCountMax; result = ReplayStrings.AutoReseedFailedResumeRetryExceeded(autoReseedDbFailedResumeRetryCountMax); base.TraceError("RunPrereqsForResume(): Failing 'Resume' prereqs since ReseedRecoveryActionRetryCount ({0}) exceeds AutoReseedDbFailedResumeRetryCountMax ({1}). Workflow will try AssignSpare stage next.", new object[] { state.ReseedRecoveryActionRetryCount, autoReseedDbFailedResumeRetryCountMax }); ReplayCrimsonEvents.AutoReseedWorkflowDbResumeRetryExceeded.Log <string, Guid, string, string, int>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason, autoReseedDbFailedResumeRetryCountMax); state.UpdateReseedRecoveryAction(ReseedState.AssignSpare); } return(result); }
// Token: 0x06001962 RID: 6498 RVA: 0x00069DC8 File Offset: 0x00067FC8 private Exception ExecuteAssignSpare(AutoReseedWorkflowState state) { Exception ex = null; try { bool flag = true; MountedFolderPath mountedFolderPath; if (!MountedFolderPath.IsNullOrEmpty(this.m_volumeForMissingMountPoint)) { this.LogBeginExecute(state); flag = false; string name = base.Context.Database.Name; DatabaseSpareInfo dbInfo = new DatabaseSpareInfo(name, new MountedFolderPath(Path.Combine(base.Context.Dag.AutoDagDatabasesRootFolderPath.PathName, name))); ExchangeVolume exchangeVolume = base.Context.VolumeManager.FixupMountPointForDatabase(dbInfo, this.m_volumeForMissingMountPoint); this.UpdateVolumeInfoCopyState(base.Context.Database.Guid); ReplayCrimsonEvents.AutoReseedWorkflowDbMountPointMissing.Log <string, Guid, string, string, MountedFolderPath, MountedFolderPath>(name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason, exchangeVolume.ExchangeVolumeMountPoint, exchangeVolume.VolumeName); } else if (this.IsVolumeRecentlyAssigned(this.m_targetDbSet, out mountedFolderPath)) { flag = false; base.TraceDebug("Skipping assigning a new volume since a volume was recently assigned. ReseedRecoveryActionRetryCount: {0}", new object[] { state.ReseedRecoveryActionRetryCount }); state.AssignedVolumeName = mountedFolderPath.Path; } if (flag) { this.LogBeginExecute(state); DatabaseSpareInfo[] dbInfos = (from status in this.m_targetDbSet select new DatabaseSpareInfo(status.CopyStatus.DBName, new MountedFolderPath(Path.Combine(base.Context.Dag.AutoDagDatabasesRootFolderPath.PathName, status.CopyStatus.DBName)))).ToArray <DatabaseSpareInfo>(); ExchangeVolume exchangeVolume2 = base.Context.VolumeManager.AssignSpare(dbInfos); base.TraceDebug("Assigned spare volume: {0}", new object[] { exchangeVolume2.VolumeName.Path }); foreach (CopyStatusClientCachedEntry copyStatusClientCachedEntry in this.m_targetDbSet) { this.UpdateVolumeInfoCopyState(copyStatusClientCachedEntry.DbGuid); } ReplayCrimsonEvents.AutoReseedWorkflowDbFailedAssignSpareSucceeded.Log <string, Guid, string, string, MountedFolderPath, MountedFolderPath>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason, exchangeVolume2.ExchangeVolumeMountPoint, exchangeVolume2.VolumeName); state.AssignedVolumeName = exchangeVolume2.VolumeName.Path; } else { base.TraceDebug("Re-using previously assigned volume: {0}", new object[] { state.AssignedVolumeName }); } state.UpdateReseedRecoveryAction(ReseedState.InPlaceReseed); } catch (DatabaseVolumeInfoException ex2) { ex = ex2; } this.LogExecuteCompleted(state, ex); return(ex); }
// Token: 0x0600194F RID: 6479 RVA: 0x0006886C File Offset: 0x00066A6C protected override LocalizedString RunPrereqs(AutoReseedWorkflowState state) { LocalizedString result = base.RunPrereqs(state); if (!result.IsEmpty) { return(result); } result = FailedSuspendedCopyAutoReseedWorkflow.hookableCheckExVolumes.Value(base.Context); if (!result.IsEmpty) { return(result); } result = FailedSuspendedCopyAutoReseedWorkflow.CheckDatabaseLogPaths(base.Context); if (!result.IsEmpty) { return(result); } if (base.Context.TargetCopyStatus.CopyStatus.ActionInitiator == ActionInitiatorType.Administrator) { base.TraceError("RunPrereqs(): The DatabaseCopy has been suspended by an Administrator so AutoReseed will not be attempted.", new object[0]); return(ReplayStrings.AutoReseedFailedAdminSuspended); } if (base.Context.TargetCopyStatus.CopyStatus.ReseedBlocked) { string messageOrNoneString = AmExceptionHelper.GetMessageOrNoneString(base.Context.TargetCopyStatus.CopyStatus.ErrorMessage); base.TraceError("RunPrereqs(): The DatabaseCopy is marked as ReseedBlocked so AutoReseed will not be attempted. Database copy ErrorMessage: {0}", new object[] { messageOrNoneString }); return(ReplayStrings.AutoReseedFailedReseedBlocked(messageOrNoneString)); } this.ResetWorkflowRecoveryActionIfNecessary(state); if (!state.IsLastReseedRecoveryActionPending()) { base.TraceDebug("RunPrereqs(): Running the workflow for the first time, so starting with the Resume action. LastReseedRecoveryAction = {0}", new object[] { state.LastReseedRecoveryAction }); state.UpdateReseedRecoveryAction(ReseedState.Resume); } if (state.LastReseedRecoveryAction == ReseedState.Resume) { result = this.RunPrereqsForResume(state); } if (state.LastReseedRecoveryAction == ReseedState.AssignSpare) { result = this.RunPrereqsForAssignSpare(state); } if (state.LastReseedRecoveryAction == ReseedState.InPlaceReseed) { result = this.RunPrereqsForInPlaceReseed(state); } return(result); }
// Token: 0x0600191D RID: 6429 RVA: 0x000675E8 File Offset: 0x000657E8 public static Exception TriggerInPlaceReseed(Guid dbGuid, string dbName) { Exception result = null; try { AutoReseedWorkflowState autoReseedWorkflowState = new AutoReseedWorkflowState(dbGuid, AutoReseedWorkflowType.FailedSuspendedCopyAutoReseed); autoReseedWorkflowState.ResetReseedRecoveryAction(); autoReseedWorkflowState.IgnoreInPlaceOverwriteDelay = true; autoReseedWorkflowState.UpdateReseedRecoveryAction(ReseedState.InPlaceReseed); ReplayCrimsonEvents.AutoReseedTriggerInPlaceReseed.LogPeriodic <string, Guid>(dbGuid, DiagCore.DefaultEventSuppressionInterval, dbName, dbGuid); } catch (RegistryParameterException ex) { result = ex; } return(result); }
// Token: 0x06001963 RID: 6499 RVA: 0x0006A044 File Offset: 0x00068244 private Exception ExecuteInPlaceReseed(AutoReseedWorkflowState state) { Exception ex = null; try { state.UpdateReseedRecoveryAction(ReseedState.InPlaceReseed); this.LogBeginExecute(state); FailedSuspendedCopyAutoReseedWorkflow.hookableSeedRpc.Value(this); ReplayCrimsonEvents.AutoReseedWorkflowDbFailedBeginReseedSucceeded.Log <string, Guid, string, string>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason); } catch (SeederServerException ex2) { ex = ex2; } catch (SeederServerTransientException ex3) { ex = ex3; } this.LogExecuteCompleted(state, ex); return(ex); }
// Token: 0x06001961 RID: 6497 RVA: 0x00069D10 File Offset: 0x00067F10 private Exception ExecuteResume(AutoReseedWorkflowState state) { Exception ex = null; try { state.UpdateReseedRecoveryAction(ReseedState.Resume); this.LogBeginExecute(state); DatabaseCopyActionFlags arg = DatabaseCopyActionFlags.Replication | DatabaseCopyActionFlags.Activation | DatabaseCopyActionFlags.SkipSettingResumeAutoReseedState; FailedSuspendedCopyAutoReseedWorkflow.hookableResumeRpc.Value(AmServerName.LocalComputerName.Fqdn, base.Context.Database.Guid, (uint)arg); } catch (TaskServerException ex2) { ex = ex2; } catch (TaskServerTransientException ex3) { ex = ex3; } this.LogExecuteCompleted(state, ex); return(ex); }
// Token: 0x0600195E RID: 6494 RVA: 0x000696C0 File Offset: 0x000678C0 private LocalizedString RunPrereqsForAssignSpare(AutoReseedWorkflowState state) { this.TraceBeginPrereqs(state); if (state.ReseedRecoveryActionRetryCount >= RegistryParameters.AutoReseedDbFailedAssignSpareRetryCountMax) { int autoReseedDbFailedAssignSpareRetryCountMax = RegistryParameters.AutoReseedDbFailedAssignSpareRetryCountMax; base.TraceError("RunPrereqsForAssignSpare(): Failing 'AssignSpare' prereqs since ReseedRecoveryActionRetryCount ({0}) exceeds AutoReseedDbFailedAssignSpareRetryCountMax ({1}). Workflow will try InPlaceReseed stage next.", new object[] { state.ReseedRecoveryActionRetryCount, autoReseedDbFailedAssignSpareRetryCountMax }); ReplayCrimsonEvents.AutoReseedWorkflowDbSpareRetryExceeded.Log <string, Guid, string, string, int>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason, autoReseedDbFailedAssignSpareRetryCountMax); state.UpdateReseedRecoveryAction(ReseedState.InPlaceReseed); return(ReplayStrings.AutoReseedFailedSeedRetryExceeded(autoReseedDbFailedAssignSpareRetryCountMax)); } state.UpdateReseedRecoveryAction(ReseedState.AssignSpare); if (string.IsNullOrEmpty(base.Context.TargetCopyStatus.CopyStatus.DatabaseVolumeName) || string.IsNullOrEmpty(base.Context.TargetCopyStatus.CopyStatus.LogVolumeName)) { return(ReplayStrings.AutoReseedFailedToFindTargetVolumeName(AmExceptionHelper.GetMessageOrNoneString(base.Context.TargetCopyStatus.CopyStatus.VolumeInfoLastError))); } MountedFolderPath mountedFolderPath = new MountedFolderPath(base.Context.TargetCopyStatus.CopyStatus.LogVolumeName); MountedFolderPath other = new MountedFolderPath(base.Context.TargetCopyStatus.CopyStatus.DatabaseVolumeName); if (!mountedFolderPath.Equals(other)) { return(ReplayStrings.AutoReseedLogAndDbNotOnSameVolume); } IEnumerable <CopyStatusClientCachedEntry> enumerable = this.FindTargetDbSetFromDatabaseGroup(base.Context); if (enumerable == null) { enumerable = this.FindTargetDbSetFromNeighbors(base.Context); if (enumerable == null) { return(ReplayStrings.AutoReseedFailedToFindVolumeName); } } MountedFolderPath mountedFolderPath2; if (this.IsVolumeRecentlyAssigned(enumerable, out mountedFolderPath2)) { ReplayCrimsonEvents.AutoReseedWorkflowDbSpareRecentlyAssigned.Log <string, Guid, string, string>(base.Context.Database.Name, base.Context.Database.Guid, base.WorkflowName, base.WorkflowLaunchReason); state.AssignedVolumeName = mountedFolderPath2.Path; state.UpdateReseedRecoveryAction(ReseedState.InPlaceReseed); } else if (this.DoesMountPointNeedToBeFixed(enumerable, out mountedFolderPath2)) { base.TraceDebug("Database copy is missing a mount point, and it will be fixed up to point to volume '{0}'", new object[] { mountedFolderPath2 }); this.m_volumeForMissingMountPoint = mountedFolderPath2; } else { string databaseNames = FailedSuspendedCopyAutoReseedWorkflow.GetDatabaseNames(enumerable); if (!enumerable.All((CopyStatusClientCachedEntry status) => !status.IsActive)) { return(ReplayStrings.AutoReseedNotAllCopiesPassive(databaseNames)); } if (!enumerable.All((CopyStatusClientCachedEntry status) => status.Result == CopyStatusRpcResult.Success && status.CopyStatus.CopyStatus == CopyStatusEnum.FailedAndSuspended)) { return(ReplayStrings.AutoReseedNotAllCopiesOnVolumeFailedSuspended(databaseNames)); } } this.m_targetDbSet = enumerable; return(LocalizedString.Empty); }