// Token: 0x0600147E RID: 5246 RVA: 0x00052690 File Offset: 0x00050890 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { CopyStatusClientCachedEntry status = args.Status; TimeSpan timeSpan = DateTime.UtcNow.Subtract(status.CreateTimeUtc); if (timeSpan > DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeError) { DatabaseValidationCheck.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Database Copy '{1}' has copy status cached entry that is older than maximum *error* age of {2}. Actual age: {3}.", new object[] { base.CheckName, args.DatabaseCopyName, DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeError, timeSpan }); error = ReplayStrings.DbValidationCopyStatusTooOld(args.DatabaseCopyName, timeSpan, DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeError); return(DatabaseValidationCheck.Result.Failed); } if (timeSpan > DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeWarning) { DatabaseValidationCheck.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Database Copy '{1}' has copy status cached entry that is older than maximum *warning* age of {2}. Actual age: {3}.", new object[] { base.CheckName, args.DatabaseCopyName, DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeWarning, timeSpan }); error = ReplayStrings.DbValidationCopyStatusTooOld(args.DatabaseCopyName, timeSpan, DatabaseCheckCopyStatusNotStale.s_maximumStatusAgeWarning); return(DatabaseValidationCheck.Result.Warning); } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x06001444 RID: 5188 RVA: 0x00051A58 File Offset: 0x0004FC58 public DatabaseValidationCheck.Result Validate(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { DiagCore.RetailAssert(args.Status != null, "args.Status cannot be null!", new object[0]); DatabaseValidationCheck.Tracer.TraceDebug((long)this.GetHashCode(), "Check '{0}' is starting against database copy '{1}'. [ActiveServer: {2}, TargetServer: {3}, IsActive: {4}]", new object[] { this.CheckName, args.DatabaseCopyName, args.ActiveServer.NetbiosName, args.TargetServer.NetbiosName, args.Status.IsActive }); if (!this.IsPrerequisiteMetForCheck(args)) { DatabaseValidationCheck.Tracer.TraceError <string, string>((long)this.GetHashCode(), "Check '{0}' is skipping for database copy '{1}' because prereqs were not met. Returning Passed result.", this.CheckName, args.DatabaseCopyName); return(DatabaseValidationCheck.Result.Passed); } DatabaseValidationCheck.Result result = this.ValidateInternal(args, ref error); if (result == DatabaseValidationCheck.Result.Passed) { DatabaseValidationCheck.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "Check '{0}' for database copy '{1}' Passed.", this.CheckName, args.DatabaseCopyName); } else { DatabaseValidationCheck.Tracer.TraceError((long)this.GetHashCode(), "Check '{0}' for database copy '{1}' returned result '{2}'. Error: {3}", new object[] { this.CheckName, args.DatabaseCopyName, result, error }); } return(result); }
// Token: 0x0600147A RID: 5242 RVA: 0x00052560 File Offset: 0x00050760 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (args.IsCopyRemoval) { DatabaseValidationCheck.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "{0}: Validation is being run in copy-removal mode, so skipping DatabaseCheckReplayServiceUpOnActiveCopy check for database copy '{1}'!", base.CheckName, args.DatabaseCopyName); return(DatabaseValidationCheck.Result.Passed); } if (args.ActiveStatus == null) { DatabaseValidationCheck.Tracer.TraceError <string, string>((long)this.GetHashCode(), "{0}: Could not find active copy status result for database copy '{1}'.", base.CheckName, args.DatabaseCopyName); error = ReplayStrings.DbValidationActiveCopyStatusUnknown(args.DatabaseName); return(DatabaseValidationCheck.Result.Warning); } CopyStatusClientCachedEntry activeStatus = args.ActiveStatus; if (!activeStatus.IsActive) { return(DatabaseValidationCheck.Result.Passed); } if (activeStatus.Result != CopyStatusRpcResult.Success) { error = ReplayStrings.DbValidationActiveCopyStatusRpcFailed(args.DatabaseName, activeStatus.ServerContacted.NetbiosName, activeStatus.LastException.Message); return(DatabaseValidationCheck.Result.Warning); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (!args.IgnoreTooManyActivesCheck) { IADServer iadserver = args.ADConfig.LookupMiniServerByName(args.TargetServer); if (iadserver == null) { error = ReplayStrings.AmBcsTargetServerADError(args.TargetServer.Fqdn, ReplayStrings.AmBcsNoneSpecified); return(DatabaseValidationCheck.Result.Failed); } int?maximumPreferredActiveDatabases = iadserver.MaximumPreferredActiveDatabases; if (maximumPreferredActiveDatabases != null) { IEnumerable <IADDatabase> expectedDatabases = args.ADConfig.DatabaseMap[args.TargetServer]; IEnumerable <CopyStatusClientCachedEntry> copyStatusesByServer = args.StatusLookup.GetCopyStatusesByServer(args.TargetServer, expectedDatabases, CopyStatusClientLookupFlags.None); IEnumerable <CopyStatusClientCachedEntry> enumerable = from copy in copyStatusesByServer where copy.IsActive select copy; if (enumerable != null && enumerable.Count <CopyStatusClientCachedEntry>() > maximumPreferredActiveDatabases) { error = ReplayStrings.AmBcsTargetServerPreferredMaxActivesExceeded(args.TargetServer.Fqdn, (maximumPreferredActiveDatabases != null) ? maximumPreferredActiveDatabases.Value.ToString() : "<null>"); return(DatabaseValidationCheck.Result.Failed); } } } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { AmServerName targetServer = args.TargetServer; RpcDatabaseCopyStatus2 copyStatus = args.Status.CopyStatus; if (copyStatus.CopyStatus == CopyStatusEnum.Dismounted || copyStatus.CopyStatus == CopyStatusEnum.Dismounting) { if (!string.IsNullOrEmpty(copyStatus.ErrorMessage)) { error = ReplayStrings.DbAvailabilityActiveCopyDismountedError(args.DatabaseName, targetServer.NetbiosName, copyStatus.ErrorMessage); return(DatabaseValidationCheck.Result.Failed); } DatabaseValidationCheck.Tracer.TraceDebug <string, string, CopyStatusEnum>((long)this.GetHashCode(), "{0}: Active database copy '{1}' is dismounted/dismounting. CopyStatus={2}. Returning Warning.", base.CheckName, args.DatabaseCopyName, copyStatus.CopyStatus); error = ReplayStrings.DbAvailabilityActiveCopyMountState(args.DatabaseName, targetServer.NetbiosName, copyStatus.CopyStatus.ToString()); return(DatabaseValidationCheck.Result.Warning); } else { if (copyStatus.CopyStatus == CopyStatusEnum.Mounted) { DatabaseValidationCheck.Tracer.TraceDebug <string, string, CopyStatusEnum>((long)this.GetHashCode(), "{0}: Active database copy '{1}' is mounted. CopyStatus={2}. Returning Passed.", base.CheckName, args.DatabaseCopyName, copyStatus.CopyStatus); return(DatabaseValidationCheck.Result.Passed); } if (copyStatus.CopyStatus == CopyStatusEnum.Mounting) { DatabaseValidationCheck.Tracer.TraceDebug <string, string, CopyStatusEnum>((long)this.GetHashCode(), "{0}: Active database copy '{1}' is mounting. CopyStatus={2}. Returning Warning.", base.CheckName, args.DatabaseCopyName, copyStatus.CopyStatus); error = ReplayStrings.DbAvailabilityActiveCopyMountState(args.DatabaseName, targetServer.NetbiosName, copyStatus.CopyStatus.ToString()); return(DatabaseValidationCheck.Result.Warning); } error = ReplayStrings.DbAvailabilityActiveCopyUnknownState(args.DatabaseName, targetServer.NetbiosName, copyStatus.CopyStatus.ToString()); return(DatabaseValidationCheck.Result.Failed); } }
private bool IsCopyHealthy(CopyStatusClientCachedEntry status, CopyStatusClientCachedEntry activeStatus, ICopyStatusClientLookup statusLookup) { DatabaseValidationCheck.Arguments arguments = new DatabaseValidationCheck.Arguments(status.ServerContacted, status.ActiveServer, this.Database, status, activeStatus, statusLookup, this.m_adConfig, this.m_propertyUpdateTracker, this.m_ignoreActivationDisfavored, this.m_isCopyRemoval, this.m_ignoreMaintenanceChecks, this.m_ignoreTooManyActivesCheck); DatabaseValidationMultiChecks databaseValidationMultiChecks = status.IsActive ? this.ActiveCopyChecks : this.PassiveCopyChecks; foreach (DatabaseValidationCheck databaseValidationCheck in databaseValidationMultiChecks) { LocalizedString empty = LocalizedString.Empty; switch (databaseValidationCheck.Validate(arguments, ref empty)) { case DatabaseValidationCheck.Result.Warning: if (!this.m_skipEvents) { ReplayCrimsonEvents.DatabaseCopyValidationCheckWarning.LogPeriodic <string, string, string>(arguments.DatabaseCopyName.GetHashCode() ^ databaseValidationCheck.CheckName.GetHashCode(), DiagCore.DefaultEventSuppressionInterval, arguments.DatabaseCopyName, databaseValidationCheck.CheckName, EventUtil.TruncateStringInput(empty, 32766)); } break; case DatabaseValidationCheck.Result.Failed: this.RecordError(status.ServerContacted, empty); if (databaseValidationCheck.CheckId == DatabaseValidationCheck.ID.DatabaseCheckCopyStatusNotStale) { this.m_isAnyCachedCopyStatusStale = true; } return(false); } } return(true); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { RpcDatabaseCopyStatus2 copyStatus = args.Status.CopyStatus; CopyStatusEnum copyStatus2 = copyStatus.CopyStatus; switch (copyStatus2) { case CopyStatusEnum.DisconnectedAndHealthy: case CopyStatusEnum.Healthy: break; default: if (copyStatus2 != CopyStatusEnum.SeedingSource) { DatabaseValidationCheck.Tracer.TraceError((long)this.GetHashCode(), "{0}: Passive database copy '{1}' is in state '{2}'. Returning Failed! StatusFetched at {3}", new object[] { base.CheckName, args.DatabaseCopyName, copyStatus.CopyStatus, copyStatus.StatusRetrievedTime }); error = ReplayStrings.DbValidationPassiveCopyUnhealthyState(args.DatabaseCopyName, copyStatus.CopyStatus.ToString(), string.IsNullOrEmpty(copyStatus.ErrorMessage) ? ReplayStrings.AmBcsNoneSpecified : copyStatus.ErrorMessage, string.IsNullOrEmpty(copyStatus.SuspendComment) ? ReplayStrings.AmBcsNoneSpecified : copyStatus.SuspendComment); return(DatabaseValidationCheck.Result.Failed); } break; } DatabaseValidationCheck.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Passive database copy '{1}' is in state '{2}'. Returning Passed. StatusFetched at {3}", new object[] { base.CheckName, args.DatabaseCopyName, copyStatus.CopyStatus, copyStatus.StatusRetrievedTime }); return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x0600146E RID: 5230 RVA: 0x00052224 File Offset: 0x00050424 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { error = LocalizedString.Empty; if (!AmBcsCopyValidation.IsHealthyOrDisconnected(args.DatabaseName, args.Status.CopyStatus, args.TargetServer, ref error)) { return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { error = LocalizedString.Empty; if (!AmBcsCopyValidation.IsTotalQueueLengthLessThanMaxThreshold(args.DatabaseName, args.Status.CopyStatus, args.TargetServer, ref error)) { return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x06001474 RID: 5236 RVA: 0x000523F0 File Offset: 0x000505F0 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { error = LocalizedString.Empty; if (!AmBcsCopyValidation.IsRealCopyQueueLengthAcceptable(args.DatabaseName, args.Status.CopyStatus, RegistryParameters.MaxAutoDatabaseMountDial, args.TargetServer, ref error)) { return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x0600147C RID: 5244 RVA: 0x00052624 File Offset: 0x00050824 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (args.Database.ReplicationType != ReplicationType.Remote) { DatabaseValidationCheck.Tracer.TraceDebug <string, string, int>((long)this.GetHashCode(), "{0}: Database '{1}' is *NOT* replicated! It has only {2} copy(ies) configured in the AD.", base.CheckName, args.DatabaseName, args.Database.DatabaseCopies.Length); error = ReplayStrings.DbValidationDbNotReplicated(args.DatabaseName); return(DatabaseValidationCheck.Result.Warning); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (args.Status.Result != CopyStatusRpcResult.Success) { error = ReplayStrings.DbValidationCopyStatusRpcFailed(args.DatabaseName, args.TargetServer.NetbiosName, args.Status.LastException.Message); return(DatabaseValidationCheck.Result.Failed); } DiagCore.RetailAssert(args.Status.CopyStatus != null, "CopyStatus cannot be null if Result is Success!", new object[0]); return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { RpcDatabaseCopyStatus2 copyStatus = args.Status.CopyStatus; if (copyStatus.NodeStatus == NodeUpStatusEnum.Down) { error = ReplayStrings.AmBcsTargetNodeDownError(args.TargetServer.NetbiosName); return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { AmServerName targetServer = args.TargetServer; RpcDatabaseCopyStatus2 copyStatus = args.Status.CopyStatus; if (copyStatus.ActivationSuspended) { error = ReplayStrings.AmBcsDatabaseCopyActivationSuspended(args.DatabaseName, targetServer.NetbiosName, string.IsNullOrEmpty(copyStatus.SuspendComment) ? ReplayStrings.AmBcsNoneSpecified : copyStatus.SuspendComment); return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { error = LocalizedString.Empty; AmBcsServerChecks checks = AmBcsServerChecks.DatacenterActivationModeStarted | AmBcsServerChecks.AutoActivationAllowed; AmBcsServerValidation amBcsServerValidation = new AmBcsServerValidation(args.TargetServer, args.ActiveServer, args.Database, null, null, args.ADConfig); if (!amBcsServerValidation.RunChecks(checks, ref error)) { return(DatabaseValidationCheck.Result.Failed); } return(DatabaseValidationCheck.Result.Passed); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { error = LocalizedString.Empty; DatabaseValidationCheck.Result result = DatabaseValidationCheck.Result.Passed; if (args.Status.CopyStatus != null) { string text = args.Status.CopyStatus.DBName + "\\" + args.Status.CopyStatus.MailboxServer; if (args.PropertyUpdateTracker.LastTimeCopierTimeUpdateTracker.UpdateCurrentValueOrReturnStaleness(text, args.Status.CopyStatus.LastLogInfoFromCopierTime).TotalSeconds >= (double)RegistryParameters.DatabaseHealthCheckCopyConnectedErrorThresholdInSec) { error = ReplayStrings.PassiveCopyDisconnected; result = DatabaseValidationCheck.Result.Failed; } } return(result); }
protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { RpcDatabaseCopyStatus2 copyStatus = args.Status.CopyStatus; long num = Math.Max(0L, copyStatus.LastLogCopied - copyStatus.LastLogInspected); if (num > (long)RegistryParameters.DatabaseCheckInspectorQueueLengthFailedThreshold) { error = ReplayStrings.DbValidationInspectorQueueLengthTooHigh(args.DatabaseCopyName, num, (long)RegistryParameters.DatabaseCheckInspectorQueueLengthFailedThreshold); return(DatabaseValidationCheck.Result.Failed); } if (num > (long)RegistryParameters.DatabaseCheckInspectorQueueLengthWarningThreshold) { error = ReplayStrings.DbValidationInspectorQueueLengthTooHigh(args.DatabaseCopyName, num, (long)RegistryParameters.DatabaseCheckInspectorQueueLengthWarningThreshold); return(DatabaseValidationCheck.Result.Warning); } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x06001468 RID: 5224 RVA: 0x00051FCC File Offset: 0x000501CC protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (!args.IgnoreActivationDisfavored) { AmServerName targetServer = args.TargetServer; IADServer iadserver = args.ADConfig.LookupMiniServerByName(targetServer); if (iadserver == null) { error = ReplayStrings.AmBcsTargetServerADError(args.TargetServer.Fqdn, ReplayStrings.AmBcsNoneSpecified); return(DatabaseValidationCheck.Result.Failed); } if (iadserver.DatabaseCopyActivationDisabledAndMoveNow) { error = ReplayStrings.AmBcsTargetServerActivationDisabled(args.ActiveServer.Fqdn); return(DatabaseValidationCheck.Result.Failed); } } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x06001461 RID: 5217 RVA: 0x00051DA8 File Offset: 0x0004FFA8 protected override DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error) { if (!args.IgnoreMaintenanceChecks) { IADServer iadserver = args.ADConfig.LookupMiniServerByName(args.TargetServer); if (iadserver == null) { error = ReplayStrings.AmBcsTargetServerADError(args.TargetServer.Fqdn, ReplayStrings.AmBcsNoneSpecified); return(DatabaseValidationCheck.Result.Failed); } if (ServerComponentStates.ReadEffectiveComponentState(iadserver.Fqdn, iadserver.ComponentStates, ServerComponentStateSources.AD, ServerComponentStates.GetComponentId(ServerComponentEnum.HighAvailability), ServiceState.Active) == ServiceState.Inactive) { error = ReplayStrings.AmBcsTargetServerIsHAComponentOffline(iadserver.Fqdn); return(DatabaseValidationCheck.Result.Failed); } if (iadserver.DatabaseCopyAutoActivationPolicy == DatabaseCopyAutoActivationPolicyType.Blocked) { error = ReplayStrings.AmBcsTargetServerActivationBlocked(args.TargetServer.Fqdn); return(DatabaseValidationCheck.Result.Failed); } } return(DatabaseValidationCheck.Result.Passed); }
// Token: 0x06001445 RID: 5189 protected abstract bool IsPrerequisiteMetForCheck(DatabaseValidationCheck.Arguments args);
// Token: 0x06001446 RID: 5190 protected abstract DatabaseValidationCheck.Result ValidateInternal(DatabaseValidationCheck.Arguments args, ref LocalizedString error);
protected override bool IsPrerequisiteMetForCheck(DatabaseValidationCheck.Arguments args) { return(args.Status.IsActive); }
// Token: 0x06001457 RID: 5207 RVA: 0x00051CAC File Offset: 0x0004FEAC protected override bool IsPrerequisiteMetForCheck(DatabaseValidationCheck.Arguments args) { return(true); }