// Token: 0x06000081 RID: 129 RVA: 0x00004450 File Offset: 0x00002650 protected override void LogStartupInternal() { AmTrace.Debug("Starting {0}", new object[] { base.GetType().Name }); ExTraceGlobals.FaultInjectionTracer.TraceTest(3446025533U); }
// Token: 0x060003FB RID: 1019 RVA: 0x00015764 File Offset: 0x00013964 private void PerformVerification() { AmConfig config = AmSystemManager.Instance.Config; if (config.IsSAM) { AmServerName pam = config.DagConfig.CurrentPAM; AmRole role = AmRole.Unknown; string errorMessage = null; Exception ex = null; bool flag = false; if (this.IsServerDisabled(AmServerName.LocalComputerName)) { AmTrace.Debug("PamMonitor.PerformVerification found local server marked ActivationDisabled", new object[0]); return; } IADServer server = Dependencies.ADConfig.GetServer(pam); if (server == null) { AmTrace.Error("PamMonitor.PerformVerification found pam on {0} but no server data in ADConfig", new object[] { pam.Fqdn }); return; } if (this.IsServerDisabled(server)) { AmTrace.Debug("PamMonitor.PerformVerification found PAM server marked ActivationDisabled", new object[0]); flag = true; } if (!flag) { ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1) { role = Dependencies.AmRpcClientWrapper.GetActiveManagerRole(pam.Fqdn, out errorMessage); }); } if (flag || role != AmRole.PAM) { string text = string.Empty; int num = RegistryParameters.PamMonitorRecoveryDurationInSec; if (flag) { errorMessage = "PAM has been marked ActivationDisabled"; num = 5; } else if (ex != null) { text = ex.Message; } ReplayCrimsonEvents.PamMonitorServerNotInPamRole.Log <AmServerName, AmRole, string, string>(pam, role, errorMessage, text); this.pamServerInVerificationPhase = pam; this.phase = AmPamMonitor.PamMonitorPhase.Recovery; TimeSpan timeSpan = TimeSpan.FromSeconds((double)num); base.ChangeTimer(timeSpan, timeSpan); } } }
// Token: 0x060000A4 RID: 164 RVA: 0x00004DFC File Offset: 0x00002FFC protected override void LogStartupInternal() { AmTrace.Debug("Starting {0} for {1}", new object[] { base.GetType().Name, this.m_nodeName }); ReplayCrimsonEvents.InitiatingServerMoveAllDatabasesByComponentRequest.Log <AmServerName, string>(this.m_nodeName, this.Arguments.ComponentName); }
internal void Notify(WaitCallback compRtn) { this.m_completionCallback = compRtn; AmTrace.Debug("AMTPR: Queuing notification for database {0}", new object[] { this.m_db.Name }); ThreadPool.QueueUserWorkItem(new WaitCallback(this.NotifyProcessing)); }
// Token: 0x06000066 RID: 102 RVA: 0x0000387C File Offset: 0x00001A7C protected override void LogStartupInternal() { AmTrace.Debug("Starting {0}", new object[] { base.GetType().Name }); ReplayCrimsonEvents.InitiatingStartupAutomount.Log(); ExTraceGlobals.FaultInjectionTracer.TraceTest(3714460989U); }
// Token: 0x06000198 RID: 408 RVA: 0x00009CB8 File Offset: 0x00007EB8 public bool Start() { AmTrace.Debug("Starting Active Manager server", new object[0]); AmSystemManager.Instance.Start(); this.m_registryMonitor.Start(); bool flag = false; return(!flag); }
protected override void LogCompletionInternal() { AmTrace.Debug("Finished {0} for {1}", new object[] { base.GetType().Name, this.m_nodeName }); ReplayCrimsonEvents.CompletedSwitchover.Log <AmServerName, int>(this.m_nodeName, this.m_moveRequests); }
protected override void LogCompletionInternal() { AmTrace.Debug("Finished {0} for {1}", new object[] { base.GetType().Name, this.m_nodeName }); ReplayCrimsonEvents.CompletedStoreStartAutomount.Log <AmServerName, int, int, int, int>(this.m_nodeName, this.m_mountRequests, this.m_dismountRequests, this.m_clusDbSyncRequests, this.m_moveRequests); }
// Token: 0x060000A5 RID: 165 RVA: 0x00004E50 File Offset: 0x00003050 protected override void LogCompletionInternal() { AmTrace.Debug("Finished {0} for {1}", new object[] { base.GetType().Name, this.m_nodeName }); ReplayCrimsonEvents.CompletedServerMoveAllDatabasesByComponentRequest.Log <AmServerName, int, string, string>(this.m_nodeName, this.m_moveRequests, this.Arguments.MoveComment, this.Arguments.ComponentName); }
protected override bool IsServiceReady() { bool flag = AmStoreHelper.IsStoreRunning(AmServerName.LocalComputerName); AmTrace.Debug("AmStoreHelper.IsStoreRunning() returned {0}", new object[] { flag }); return(flag); }
// Token: 0x0600019A RID: 410 RVA: 0x00009D2C File Offset: 0x00007F2C internal static bool IsLocalNodePAM() { AmConfig config = AmSystemManager.Instance.Config; AmTrace.Debug("IsLocalNodePAM(): AM is in '{0}' role.", new object[] { config.Role }); return(config.IsPAM); }
protected override void LogStartupInternal() { AmTrace.Debug("Starting {0} for {1}", new object[] { base.GetType().Name, this.m_nodeName }); ReplayCrimsonEvents.InitiatingServerSwitchover.Log <AmServerName>(this.m_nodeName); ExTraceGlobals.FaultInjectionTracer.TraceTest(4050005309U); }
// Token: 0x060001AB RID: 427 RVA: 0x0000A874 File Offset: 0x00008A74 internal AmPamInfo GetPrimaryActiveManager() { AmConfig config = AmSystemManager.Instance.Config; if (!config.IsPamOrSam) { AmTrace.Debug("GetPAM called on Standalone machine!!", new object[0]); throw new AmOperationNotValidOnCurrentRole(config.LastError); } return(new AmPamInfo(config.DagConfig.CurrentPAM.Fqdn)); }
// Token: 0x0600046A RID: 1130 RVA: 0x00017BBC File Offset: 0x00015DBC public override RpcErrorExceptionInfo AmRefreshConfiguration(int refreshFlags, int maxSecondsToWait) { AmTrace.Debug("AmRefreshConfiguration request received (flags = {0}, timeout={1})", new object[] { refreshFlags, maxSecondsToWait }); return(AmRpcExceptionWrapper.Instance.RunRpcServerOperation(delegate() { AmRpcServer.m_amInstance.AmRefreshConfiguration((AmRefreshConfigurationFlags)refreshFlags, maxSecondsToWait); })); }
// Token: 0x060001AC RID: 428 RVA: 0x0000A8CC File Offset: 0x00008ACC internal AmRole GetActiveManagerRole(out string errorMessage) { AmConfig config = AmSystemManager.Instance.Config; errorMessage = config.LastError; AmTrace.Debug("GetActiveManagerRole: AM is in Role {0}. ErrorMessage={1}", new object[] { config.Role, errorMessage }); return(config.Role); }
// Token: 0x060001A8 RID: 424 RVA: 0x0000A59C File Offset: 0x0000879C internal void MoveDatabase(Guid mdbGuid, MountFlags mountFlags, UnmountFlags dismountFlags, DatabaseMountDialOverride mountDialOverride, AmServerName fromServer, AmServerName targetServer, bool tryOtherHealthyServers, AmBcsSkipFlags skipValidationChecks, AmDbActionCode actionCode, string moveComment, ref AmDatabaseMoveResult databaseMoveResult) { AmTrace.Debug("Task: MoveDatabase({0},{1},{2},{3},{4},{5},{6},{7},'{8}') called", new object[] { mdbGuid, mountFlags, dismountFlags, mountDialOverride, fromServer, targetServer, tryOtherHealthyServers, actionCode, moveComment }); ActiveManagerCore.ValidatePamOrStandalone("MoveDatabase"); ThirdPartyManager.PreventOperationWhenTPREnabled("MoveDatabase"); IADDatabase iaddatabase = this.AdLookup.DatabaseLookup.FindAdObjectByGuidEx(mdbGuid, AdObjectLookupFlags.ReadThrough); if (iaddatabase == null) { throw new AmDatabaseNotFoundException(mdbGuid); } AmDbMoveOperation amDbMoveOperation = new AmDbMoveOperation(iaddatabase, actionCode); AmDbMoveArguments arguments = amDbMoveOperation.Arguments; AmDbCompletionReason amDbCompletionReason = AmDbCompletionReason.None; arguments.MountFlags = mountFlags; arguments.DismountFlags = dismountFlags; arguments.MountDialOverride = mountDialOverride; arguments.SourceServer = fromServer; arguments.TargetServer = targetServer; arguments.TryOtherHealthyServers = tryOtherHealthyServers; arguments.SkipValidationChecks = skipValidationChecks; arguments.MoveComment = moveComment; amDbMoveOperation.Arguments = arguments; amDbMoveOperation.Enqueue(); try { amDbCompletionReason = amDbMoveOperation.Wait(); } finally { if (amDbMoveOperation.DetailedStatus != null) { databaseMoveResult = amDbMoveOperation.ConvertDetailedStatusToRpcMoveResult(amDbMoveOperation.DetailedStatus); } } AmTrace.Debug("MoveDatabase({0}) completed (reason={1})", new object[] { mdbGuid, amDbCompletionReason }); }
private int GetActivationPreference(AmServerName server) { AmTrace.Debug("AmBestCopySelector.GetActivationPreference: Server ({0})", new object[] { server }); if (this.m_activationPreferenceCache.ContainsKey(server)) { return(this.m_activationPreferenceCache[server]); } return(int.MaxValue); }
// Token: 0x06000469 RID: 1129 RVA: 0x00017B38 File Offset: 0x00015D38 public override RpcErrorExceptionInfo ReportSystemEvent(int eventCode, string reportingServer) { AmTrace.Debug("ReportSystemEvent request received (code={0}, reportingServer={1})", new object[] { eventCode, reportingServer }); return(AmRpcExceptionWrapper.Instance.RunRpcServerOperation(delegate() { AmRpcServer.m_amInstance.ReportSystemEvent((AmSystemEventCode)eventCode, reportingServer); })); }
// Token: 0x060001B0 RID: 432 RVA: 0x0000AB10 File Offset: 0x00008D10 internal void AttemptCopyLastLogsDirect(Guid mdbGuid, AmAcllArgs acllArgs, ref AmAcllReturnStatus acllStatus) { acllStatus = new AmAcllReturnStatus(); ThirdPartyManager.PreventOperationWhenTPREnabled("AttemptCopyLastLogsDirect"); if (!AmHelper.IsDatabaseRcrEnabled(mdbGuid)) { throw new AmDbMoveOperationNotSupportedException(mdbGuid.ToString()); } AmTrace.Debug("AttemptCopyLastLogsDirect: Calling AmAcllCallback ({0})", new object[] { mdbGuid }); acllStatus = this.m_replicaInstanceManager.AmAttemptCopyLastLogsCallback(mdbGuid, acllArgs); if (acllArgs.ActionCode.IsAutomaticShutdownSwitchover) { if (!acllStatus.NoLoss) { ReplayCrimsonEvents.AcllFailedOnSwitchover.Log <Guid>(mdbGuid); throw new AcllFailedException(acllStatus.LastError); } ReplayCrimsonEvents.AcllLosslessOnSwitchover.Log <Guid>(mdbGuid); return; } else { if (!acllStatus.NoLoss && acllStatus.MountAllowed) { ReplayCrimsonEvents.LossyMountEnabled.Log <Guid>(mdbGuid); AmTrace.Warning("AttemptCopyLastLogsDirect: ACLL detected a lossy mount will be allowed for DB {0}.", new object[] { mdbGuid }); return; } if (acllStatus.MountAllowed) { AmTrace.Debug("AttemptCopyLastLogsDirect: ACLL completed with no loss for DB {0}.", new object[] { mdbGuid }); ReplayCrimsonEvents.AcllLosslessOnMoveOrFailover.Log <Guid>(mdbGuid); return; } if (string.IsNullOrEmpty(acllStatus.LastError)) { ReplayCrimsonEvents.MountRejected.Log <Guid>(mdbGuid); throw new AmDbMountNotAllowedDueToLossException(); } ReplayCrimsonEvents.MountRejectedAcllError.Log <Guid, string>(mdbGuid, acllStatus.LastError); throw new AmDbMountNotAllowedDueToAcllErrorException(acllStatus.LastError, acllStatus.NumberOfLogsLost); } }
// Token: 0x0600045E RID: 1118 RVA: 0x000172A8 File Offset: 0x000154A8 public override RpcErrorExceptionInfo DismountDatabase(Guid guid, int flags) { AmTrace.Debug("Dismounting database: {0} flags: {1}", new object[] { guid, flags }); return(AmRpcExceptionWrapper.Instance.RunRpcServerOperation(delegate() { AmDbActionCode actionCode = new AmDbActionCode(AmDbActionInitiator.Admin, AmDbActionReason.Cmdlet, AmDbActionCategory.Dismount); AmRpcServer.m_amInstance.DismountDatabase(guid, (UnmountFlags)flags, actionCode); })); }
// Token: 0x0600046E RID: 1134 RVA: 0x00017E70 File Offset: 0x00016070 public override RpcErrorExceptionInfo ReportServiceKill(string serviceName, string serverName, string timeStampStrInUtc) { AmTrace.Debug("ReportServiceKill called. (serviceName = {0}, serverName = {1}, timeStampStrInUtc = {2})", new object[] { serviceName, serverName, timeStampStrInUtc }); return(AmRpcExceptionWrapper.Instance.RunRpcServerOperation(delegate() { AmRpcServer.m_amInstance.ReportServiceKill(serviceName, new AmServerName(serverName), ExDateTime.Parse(timeStampStrInUtc)); })); }
// Token: 0x0600045B RID: 1115 RVA: 0x000170CC File Offset: 0x000152CC public static void Stop() { lock (AmRpcServer.m_locker) { AmTrace.Debug("Stopping Active Manager Rpc", new object[0]); if (AmRpcServer.m_rpcServer != null) { RpcServerBase.StopServer(AmRpcServerBase.RpcIntfHandle); AmRpcServer.m_rpcServer = null; AmRpcServer.m_fRpcServerStarted = false; } } }
// Token: 0x060001AA RID: 426 RVA: 0x0000A74C File Offset: 0x0000894C internal List <AmDatabaseMoveResult> ServerMoveAllDatabases(AmServerName sourceServer, AmServerName targetServer, MountFlags mountFlags, UnmountFlags dismountFlags, DatabaseMountDialOverride mountDialOverride, bool tryOtherHealthyServers, AmBcsSkipFlags skipValidationChecks, AmDbActionCode actionCode, string moveComment, string componentName) { AmTrace.Debug("ServerMoveAllDatabases() called: sourceServer='{0}', targetServer='{1}', mountFlags='{2}', dismountFlags='{3}', mountDialOverride='{4}', tryOtherHealthyServers='{5}', skipValidationChecks='{6}', actionCode='{7}', MoveComment='{8}' Component='{9}'", new object[] { sourceServer, targetServer, mountFlags, dismountFlags, mountDialOverride, tryOtherHealthyServers, skipValidationChecks, actionCode, moveComment, componentName }); ActiveManagerCore.ValidatePamOrStandalone("ServerMoveAllDatabases"); ThirdPartyManager.PreventOperationWhenTPREnabled("ServerMoveAllDatabases"); AmDbMoveArguments amDbMoveArguments = new AmDbMoveArguments(actionCode); amDbMoveArguments.SourceServer = sourceServer; amDbMoveArguments.TargetServer = targetServer; amDbMoveArguments.MountFlags = mountFlags; amDbMoveArguments.DismountFlags = dismountFlags; amDbMoveArguments.MountDialOverride = mountDialOverride; amDbMoveArguments.TryOtherHealthyServers = tryOtherHealthyServers; amDbMoveArguments.SkipValidationChecks = skipValidationChecks; amDbMoveArguments.MoveComment = moveComment; amDbMoveArguments.ComponentName = componentName; if (string.IsNullOrEmpty(sourceServer.Fqdn)) { return(MoveBackToServer.Move(amDbMoveArguments)); } AmEvtMoveAllDatabasesBase amEvtMoveAllDatabasesBase; if (actionCode.IsAutomaticManagedAvailabilityFailover) { amEvtMoveAllDatabasesBase = new AmEvtMoveAllDatabasesOnComponentRequest(sourceServer); } else { amEvtMoveAllDatabasesBase = new AmEvtMoveAllDatabasesOnAdminRequest(sourceServer); } amEvtMoveAllDatabasesBase.MoveArgs = amDbMoveArguments; amEvtMoveAllDatabasesBase.Notify(); amEvtMoveAllDatabasesBase.WaitForSwitchoverComplete(); AmTrace.Debug("ServerMoveAllDatabases({0}) completed", new object[] { sourceServer }); return(amEvtMoveAllDatabasesBase.GetMoveResultsForOperationsRun()); }
public static bool IsAutoActivationAllowed(IADServer sourceServer, IADServer targetServer, out LocalizedString error) { string name = sourceServer.Name; string name2 = targetServer.Name; error = LocalizedString.Empty; if (SharedHelper.StringIEquals(name, name2)) { AmTrace.Debug("IsAutoActivationAllowed: Skipping check since source == target. TargetServer: {0}", new object[] { name2 }); return(true); } switch (targetServer.DatabaseCopyAutoActivationPolicy) { case DatabaseCopyAutoActivationPolicyType.Unrestricted: return(true); case DatabaseCopyAutoActivationPolicyType.IntrasiteOnly: if (!targetServer.ServerSite.Equals(sourceServer.ServerSite)) { AmTrace.Debug("IsAutoActivationAllowed: Rejecting server '{0}' (Site={1}) because it is in a different site from source server '{2}' (Site={2}). ", new object[] { name2, targetServer.ServerSite.Name, name, sourceServer.ServerSite.Name }); error = ReplayStrings.AmBcsTargetServerActivationIntraSite(targetServer.Fqdn, sourceServer.Fqdn, targetServer.ServerSite.Name, sourceServer.ServerSite.Name); return(false); } return(true); case DatabaseCopyAutoActivationPolicyType.Blocked: AmTrace.Debug("IsAutoActivationAllowed: Rejecting server '{0}' because it is activation policy Blocked.", new object[] { name2 }); error = ReplayStrings.AmBcsTargetServerActivationBlocked(targetServer.Fqdn); return(false); default: DiagCore.RetailAssert(false, "Unhandled case for DatabaseCopyAutoActivationPolicyType: {0}", new object[] { targetServer.DatabaseCopyAutoActivationPolicy }); return(false); } }
internal void RegisterObject(SafeHandle clusObject, ClusterNotifyFlags eventMask, IntPtr context) { AmTrace.Debug("Registering additional cluster objects for notification", new object[0]); int num = ClusapiMethods.RegisterClusterNotify(this.m_hChange, eventMask, clusObject, context); if (num != 0) { AmTrace.Error("RegisterClusterNotify for group state returned error 0x{0:X8}", new object[] { num }); throw AmExceptionHelper.ConstructClusterApiException(num, "RegisterClusterNotify(CLUSTER_CHANGE_GROUP_STATE)", new object[0]); } }
// Token: 0x06000729 RID: 1833 RVA: 0x000230DC File Offset: 0x000212DC private bool TargetHasBeenTried(ref LocalizedString error) { if (!AmServerName.IsNullOrEmpty(this.m_serverAlreadyTried)) { AmTrace.Debug("BCS: Target server '{0}' has already been tried for database '{1}'.", new object[] { this.m_serverAlreadyTried.NetbiosName, this.m_bcsContext.GetDatabaseNameOrGuid() }); error = ReplayStrings.AmBcsDatabaseCopyAlreadyTried(this.m_bcsContext.GetDatabaseNameOrGuid(), this.m_serverAlreadyTried.ToString()); return(true); } return(false); }
// Token: 0x060004B1 RID: 1201 RVA: 0x000194CC File Offset: 0x000176CC public bool Execute(int waitTimeoutMs, string hint) { bool flag = false; Stopwatch stopwatch = new Stopwatch(); AmStoreHelper.DismountDelegate dismountDelegate = new AmStoreHelper.DismountDelegate(AmStoreHelper.RemoteDismount); this.m_completedEvent = new ManualResetEvent(false); stopwatch.Start(); DateTime utcNow = DateTime.UtcNow; try { ReplayCrimsonEvents.ForceDismountingDatabases.Log <AmServerName, string>(AmServerName.LocalComputerName, hint); if (this.m_mdbStatuses != null && this.m_mdbStatuses.Length > 0) { AmTrace.Debug("DismountDatabasesInParallel.Execute() now starting with timeout of {0} ms...", new object[] { waitTimeoutMs }); foreach (MdbStatus mdbStatus in this.m_mdbStatuses) { DismountDatabasesInParallel.AsyncDismountState @object = new DismountDatabasesInParallel.AsyncDismountState(mdbStatus.MdbGuid, dismountDelegate); dismountDelegate.BeginInvoke(null, mdbStatus.MdbGuid, UnmountFlags.SkipCacheFlush, false, new AsyncCallback(this.DismountCompletionCallback), @object); } if (this.m_completedEvent.WaitOne(waitTimeoutMs)) { AmTrace.Debug("DismountDatabasesInParallel.Execute() finished dismounting DBs in {0} ms.", new object[] { stopwatch.ElapsedMilliseconds }); flag = true; } else { AmTrace.Error("DismountDatabasesInParallel.Execute() timed out waiting for DBs to finish dismounting.", new object[0]); AmStoreServiceMonitor.KillStoreIfRunningBefore(utcNow, "DismountDatabasesInParallel"); } } } finally { ReplayCrimsonEvents.ForceDismountAllDatabasesComplete.Log <bool>(flag); lock (this.m_locker) { this.m_completedEvent.Close(); this.m_completedEvent = null; } } return(flag); }
protected override void OnStop() { this.m_isStopReported = false; this.m_isStopObserved = true; AmTrace.Debug("AmStoreServiceMonitor.OnStop clearing AM counters.", new object[0]); ExTraceGlobals.FaultInjectionTracer.TraceTest(3764792637U); foreach (string instanceName in ActiveManagerPerfmon.GetInstanceNames()) { if (!AmStoreServiceMonitor.IsTotalInstanceName(instanceName)) { ActiveManagerPerfmon.ResetInstance(instanceName); } } this.OnWaitingForStart(); }
// Token: 0x060001D3 RID: 467 RVA: 0x00008744 File Offset: 0x00006944 public string GetNodeIdentifier() { string text = string.Empty; using (AmClusterRawData nodeControlData = this.GetNodeControlData(AmClusterNodeControlCode.CLUSCTL_NODE_GET_ID, 1024U)) { text = nodeControlData.ReadString(); AmTrace.Debug("GetNodeIdentifier: Node '{0}' is identified by '{1}'.", new object[] { this.Name, text }); } return(text); }
// Token: 0x06000812 RID: 2066 RVA: 0x00027100 File Offset: 0x00025300 internal void Init() { int num = 0; this.ReadProperty <int>("Software\\Microsoft\\Exchange\\ActiveManager\\FaultInject", "Enabled", out num, 0); this.m_isEnabled = (num > 0); if (this.m_isEnabled) { AmTrace.Debug("**** AM fault injector is enabled ****", new object[0]); if (this.IsTempDisabled) { AmTrace.Debug("**** But it is temporarily disabled by the TempDisabled setting ****", new object[0]); } } }