private void ReportStop()
        {
            AmConfig config = AmSystemManager.Instance.Config;

            AmServiceMonitor.Tracer.TraceInformation(0, 0L, "Store service stopped unexpectedly.");
            AmSystemEventCode eventCode = AmSystemEventCode.StoreServiceUnexpectedlyStopped;

            if (config.IsUnknown)
            {
                AmServiceMonitor.Tracer.TraceError(0L, "Store service stop detected, but configuration is in unknown state");
                return;
            }
            if (config.IsStandalone)
            {
                AmStoreServiceMonitor.ReportStoreStatus(AmServerName.LocalComputerName, eventCode, AmServerName.LocalComputerName);
                this.m_isStopReported = true;
                this.m_isStopObserved = false;
                return;
            }
            AmServerName currentPAM = config.DagConfig.CurrentPAM;

            if (config.DagConfig.IsNodePubliclyUp(currentPAM))
            {
                AmStoreServiceMonitor.ReportStoreStatus(currentPAM, eventCode, AmServerName.LocalComputerName);
                this.m_isStopReported = true;
                this.m_isStopObserved = false;
                return;
            }
            AmServiceMonitor.Tracer.TraceInformation <AmServerName>(0, 0L, "Store service monitor is not reporting the store stop to the PAM, since PAM on '{0}'is not up yet. Store monitor will retry once the node is up", currentPAM);
        }
 // Token: 0x060004DE RID: 1246 RVA: 0x0001A1BC File Offset: 0x000183BC
 internal void SetStoreState(AmServerName serverName, AmSystemEventCode eventCode)
 {
     lock (this.m_locker)
     {
         this.m_storeStateMap[serverName] = eventCode;
     }
 }
Пример #3
0
        // Token: 0x060001AD RID: 429 RVA: 0x0000A918 File Offset: 0x00008B18
        internal void ReportSystemEvent(AmSystemEventCode eventCode, string reportingServer)
        {
            AmTrace.Debug("ReportSystemEvent({0},{1}) called", new object[]
            {
                eventCode,
                reportingServer
            });
            ReplayCrimsonEvents.SystemEventReported.Log <AmSystemEventCode, string>(eventCode, reportingServer);
            ActiveManagerCore.ValidatePamOrStandalone("ReportSystemEvent");
            AmServerName amServerName = new AmServerName(reportingServer);

            AmSystemManager.Instance.StoreStateMarker.SetStoreState(amServerName, eventCode);
            if (eventCode == AmSystemEventCode.StoreServiceStarted)
            {
                AmEvtStoreServiceStarted amEvtStoreServiceStarted = new AmEvtStoreServiceStarted(amServerName);
                amEvtStoreServiceStarted.Notify();
                return;
            }
            if (eventCode == AmSystemEventCode.StoreServiceStopped)
            {
                new AmEvtStoreServiceStopped(amServerName)
                {
                    IsGracefulStop = true
                }.Notify();
                return;
            }
            if (eventCode == AmSystemEventCode.StoreServiceUnexpectedlyStopped)
            {
                new AmEvtStoreServiceStopped(amServerName)
                {
                    IsGracefulStop = false
                }.Notify();
            }
        }
        // Token: 0x060004E5 RID: 1253 RVA: 0x0001A440 File Offset: 0x00018640
        private bool CheckIfEventMarked(AmServerName serverName, AmSystemEventCode compareEventCode, bool isRemove)
        {
            AmSystemEventCode amSystemEventCode;

            if (this.m_storeStateMap.TryGetValue(serverName, out amSystemEventCode) && amSystemEventCode == compareEventCode)
            {
                if (isRemove)
                {
                    this.m_storeStateMap.Remove(serverName);
                }
                return(true);
            }
            return(false);
        }
        private static void ReportKillStarted()
        {
            AmStoreServiceMonitor.s_killWasTriggered = true;
            AmSystemEventCode eventCode = AmSystemEventCode.StoreServiceUnexpectedlyStopped;
            AmConfig          config    = AmSystemManager.Instance.Config;

            if (!config.IsUnknown && !config.IsStandalone)
            {
                AmServerName currentPAM = config.DagConfig.CurrentPAM;
                if (config.DagConfig.IsNodePubliclyUp(currentPAM))
                {
                    AmTrace.Diagnostic("Reporting to PAM ({0}) that store process is being killed.", new object[]
                    {
                        currentPAM
                    });
                    AmStoreServiceMonitor.ReportStoreStatus(currentPAM, eventCode, AmServerName.LocalComputerName);
                }
            }
        }
        private static bool ReportStoreStatus(AmServerName serverToContact, AmSystemEventCode eventCode, AmServerName reportingServer)
        {
            Exception ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
            {
                AmRpcClientHelper.ReportSystemEvent(serverToContact.Fqdn, (int)eventCode, reportingServer.Fqdn);
            });

            if (ex != null)
            {
                AmServiceMonitor.Tracer.TraceError(0L, "Failed to report status to PAM (pam={0}, eventCode={1}, reportingServer={2}): error={3}", new object[]
                {
                    serverToContact,
                    eventCode,
                    reportingServer,
                    ex.Message
                });
                return(false);
            }
            return(true);
        }
Пример #7
0
 public static bool IsReportSystemEventRpcSupported(ServerVersion serverVersion, AmSystemEventCode eventCode)
 {
     if (eventCode == AmSystemEventCode.StoreServiceStarted || eventCode == AmSystemEventCode.StoreServiceStopped)
     {
         return(ReplayRpcVersionControl.IsVersionGreater(serverVersion, AmRpcVersionControl.ReportSystemEventRpcSupportedVersion));
     }
     return(eventCode == AmSystemEventCode.StoreServiceUnexpectedlyStopped && ReplayRpcVersionControl.IsVersionGreater(serverVersion, AmRpcVersionControl.UnexpectedStoreStopEventCodeSupportedVersion));
 }