Ejemplo n.º 1
0
        // Token: 0x06001BD5 RID: 7125 RVA: 0x00078268 File Offset: 0x00076468
        private bool SendUpdatesAndCheckIfLocalUpdateRequired(Dictionary <string, string> clusdbUpdates)
        {
            AmConfig  cfg = AmSystemManager.Instance.Config;
            Exception ex  = null;

            if (cfg.IsPamOrSam)
            {
                ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
                {
                    ActiveManagerServerPerfmon.LastLogRemoteUpdateRpcAttempted.Increment();
                    DateTime t = RpcUpdateLastLogImpl.Send(AmServerName.LocalComputerName, cfg.DagConfig.CurrentPAM, clusdbUpdates);
                    if (t > this.mostRecentValidServerUpdateTimeFromPamUtc)
                    {
                        this.mostRecentValidServerUpdateTimeFromPamUtc = t;
                    }
                });
            }
            if (ex != null)
            {
                ActiveManagerServerPerfmon.LastLogRemoteUpdateRpcFailed.Increment();
                ReplayCrimsonEvents.LastLogUpdateRpcFailed.LogPeriodic <AmRole, DateTime, string>(AmServerName.LocalComputerName.NetbiosName, TimeSpan.FromMinutes(5.0), cfg.Role, this.mostRecentValidServerUpdateTimeFromPamUtc, ex.Message);
            }
            ExDateTime lastServerUpdateTimeAsPerClusdbUtc;
            bool       flag = this.IsLocalUpdateRequired(out lastServerUpdateTimeAsPerClusdbUtc);

            this.LogUpdateEvents(flag, lastServerUpdateTimeAsPerClusdbUtc, ex);
            return(flag);
        }
        // Token: 0x0600240B RID: 9227 RVA: 0x000A8368 File Offset: 0x000A6568
        public void ImmediateDismountMailboxDatabase(Guid databaseId)
        {
            ExTraceGlobals.ThirdPartyManagerTracer.TraceDebug(0L, "ImmediateDismountMailboxDatabase called");
            this.CheckForPam("ImmediateDismountMailboxDatabase");
            Exception ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
            {
                this.CheckForPam("ImmediateDismountMailboxDatabase");
                IADDatabase db            = this.LookupDatabase(databaseId);
                AmDbActionCode actionCode = new AmDbActionCode(AmDbActionInitiator.Admin, AmDbActionReason.FailureItem, AmDbActionCategory.Dismount);
                AmConfig config           = AmSystemManager.Instance.Config;
                new AmDbPamAction(config, db, actionCode, this.GenerateUniqueDbActionId())
                {
                    LockTimeout = new TimeSpan?(this.m_openTimeout)
                }.Dismount(UnmountFlags.SkipCacheFlush);
            });

            if (ex == null)
            {
                return;
            }
            if (ex is ThirdPartyReplicationException)
            {
                throw ex;
            }
            throw new ImmediateDismountMailboxDatabaseException(databaseId, ex.Message);
        }
        // Token: 0x0600240C RID: 9228 RVA: 0x000A8464 File Offset: 0x000A6664
        public void ChangeActiveServer(Guid databaseId, string newActiveServerName)
        {
            ExTraceGlobals.ThirdPartyManagerTracer.TraceDebug(0L, "ChangeActiveServer called");
            Exception ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
            {
                this.CheckForPam("ChangeActiveServer");
                IADDatabase db = this.LookupDatabase(databaseId);
                this.CheckServerForCopy(db, newActiveServerName);
                AmDbActionCode actionCode   = new AmDbActionCode(AmDbActionInitiator.Admin, AmDbActionReason.FailureItem, AmDbActionCategory.Move);
                AmConfig config             = AmSystemManager.Instance.Config;
                AmDbPamAction amDbPamAction = new AmDbPamAction(config, db, actionCode, this.GenerateUniqueDbActionId());
                amDbPamAction.ChangeActiveServerForThirdParty(newActiveServerName, this.m_openTimeout);
            });

            if (ex != null)
            {
                throw ex;
            }
        }