// 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: 0x06000461 RID: 1121 RVA: 0x0001751C File Offset: 0x0001571C public override RpcErrorExceptionInfo GetActiveManagerRole(ref AmRole amRole, ref string errorMessage) { AmRole tmpAmRole = AmRole.Unknown; string tmpMsg = string.Empty; RpcErrorExceptionInfo result = AmRpcExceptionWrapper.Instance.RunRpcServerOperation(delegate() { tmpAmRole = AmRpcServer.m_amInstance.GetActiveManagerRole(out tmpMsg); }); amRole = tmpAmRole; errorMessage = tmpMsg; return(result); }
// Token: 0x06000137 RID: 311 RVA: 0x00007738 File Offset: 0x00005938 private void Initialize(AmRole role, IAmDbState dbState, AmDagConfig dagCfg, string lastError) { this.Role = role; this.DbState = dbState; this.DagConfig = dagCfg; this.LastError = lastError; this.TimeCreated = ExDateTime.Now; this.TimeRoleLastChanged = this.TimeCreated; this.PeriodicEventWatch = new Stopwatch(); this.PeriodicEventWatch.Start(); this.IsUnknownTriggeredByADError = false; this.IsCurrentConfiguration = true; this.IsInternalObjectsDisposed = false; }
protected void InitiateSystemFailoverIfReplayUnreachable(AmMultiNodeMdbStatusFetcher mdbStatusFetcher, Dictionary <Guid, DatabaseInfo> dbMap) { AmRole role = AmSystemManager.Instance.Config.Role; if (role != AmRole.PAM) { return; } if (!RegistryParameters.OnReplDownFailoverEnabled) { ReplayCrimsonEvents.FailoverOnReplDownDisabledInRegistry.LogPeriodic(Environment.MachineName, TimeSpan.FromHours(1.0)); return; } AmSystemFailoverOnReplayDownTracker systemFailoverOnReplayDownTracker = AmSystemManager.Instance.SystemFailoverOnReplayDownTracker; if (systemFailoverOnReplayDownTracker == null) { ReplayCrimsonEvents.FailoverOnReplDownFailoverTrackerNotInitialized.LogPeriodic(Environment.MachineName, TimeSpan.FromHours(1.0)); return; } foreach (KeyValuePair <AmServerName, AmMdbStatusServerInfo> keyValuePair in mdbStatusFetcher.ServerInfoMap) { AmServerName key = keyValuePair.Key; AmMdbStatusServerInfo value = keyValuePair.Value; if (value.IsReplayRunning) { systemFailoverOnReplayDownTracker.MarkReplayUp(key); } else if (value.IsStoreRunning) { systemFailoverOnReplayDownTracker.MarkReplayDown(key, false); int activeDatabaseCountOnServer = this.GetActiveDatabaseCountOnServer(dbMap, key); if (activeDatabaseCountOnServer > 0) { systemFailoverOnReplayDownTracker.ScheduleFailover(key); } else { ReplayCrimsonEvents.FailoverOnReplDownSkipped.LogPeriodic <AmServerName, string, string>(key, TimeSpan.FromDays(1.0), key, "NoActives", "Periodic"); } } } }
protected void SkipOnSamNodeIfMonitoringContext() { if (ReplicationCheckGlobals.RunningInMonitoringContext && (ReplicationCheckGlobals.ServerConfiguration & ServerConfig.DagMember) == ServerConfig.DagMember) { if (!IgnoreTransientErrors.HasPassed(base.GetDefaultErrorKey(typeof(ActiveManagerCheck)))) { ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "ActiveManagerCheck didn't pass! Skipping check {0}.", base.Title); base.Skip(); } if (ReplicationCheckGlobals.ActiveManagerRole == AmRole.SAM) { ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "SkipOnSAMNode(): Local machine is the SAM. Skipping check {0}.", base.Title); base.Skip(); return; } if (ReplicationCheckGlobals.ActiveManagerRole == AmRole.PAM) { ExTraceGlobals.HealthChecksTracer.TraceDebug((long)this.GetHashCode(), "SkipOnSAMNode(): Local machine is the PAM. Checks will be run here."); return; } AmRole activeManagerRole = ReplicationCheckGlobals.ActiveManagerRole; } }
protected override void InternalRun() { if (!ReplicationCheckGlobals.ActiveManagerCheckHasRun) { ReplicationCheckGlobals.ActiveManagerCheckHasRun = true; } else { ExTraceGlobals.HealthChecksTracer.TraceDebug((long)this.GetHashCode(), "ActiveManagerCheck skipping because it has already been run once."); base.Skip(); } if (!IgnoreTransientErrors.HasPassed(base.GetDefaultErrorKey(typeof(ReplayServiceCheck)))) { ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "ReplayServiceCheck didn't pass! Skipping {0}.", base.Title); base.Skip(); } if ((ReplicationCheckGlobals.ServerConfiguration & ServerConfig.Stopped) == ServerConfig.Stopped) { ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "Stopped server! Skipping {0}.", base.Title); base.Skip(); } string error = null; AmRole amRole = AmRole.Unknown; try { if (AmRpcVersionControl.IsGetAmRoleRpcSupported(ReplicationCheckGlobals.Server.AdminDisplayVersion)) { if (ReplicationCheckGlobals.WriteVerboseDelegate != null) { ReplicationCheckGlobals.WriteVerboseDelegate(Strings.TestRHGetAmRoleRpc(ReplicationCheckGlobals.Server.AdminDisplayVersion.ToString(), AmRpcVersionControl.GetAMRoleSupportVersion.ToString())); } amRole = AmRpcClientHelper.GetActiveManagerRole(base.ServerName, out error); ReplicationCheckGlobals.ActiveManagerRole = amRole; } else { ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "ActiveManagerCheck skipping because server {0} doesn't support the GetActiveManagerRole RPC.", base.ServerName); base.Skip(); } } catch (AmServerException ex) { base.Fail(Strings.ErrorReadingAMRole(base.ServerName, ex.Message)); } catch (AmServerTransientException ex2) { base.Fail(Strings.ErrorReadingAMRole(base.ServerName, ex2.Message)); } ExTraceGlobals.HealthChecksTracer.TraceDebug <AmRole, string>((long)this.GetHashCode(), "AM has role {0} on server {1}.", amRole, base.ServerName); if (amRole == AmRole.Unknown) { base.Fail(Strings.AmUnknownRole(base.ServerName, error)); } if ((ReplicationCheckGlobals.ServerConfiguration & ServerConfig.DagMember) == ServerConfig.DagMember) { if (amRole == AmRole.Standalone) { base.Fail(Strings.AmInvalidRoleDagServer(base.ServerName)); return; } } else if (amRole != AmRole.Standalone) { base.Fail(Strings.AmInvalidRoleStandaloneServer(base.ServerName)); } }
// Token: 0x0600011A RID: 282 RVA: 0x00007509 File Offset: 0x00005709 internal AmConfig(AmRole role, IAmDbState dbState, AmDagConfig dagCfg, string lastError) { this.Initialize(role, dbState, dagCfg, lastError); }