Exemplo n.º 1
0
        private IADDatabaseCopy GetDatabaseCopy(IADDatabase db, AmServerName server)
        {
            IADDatabaseCopy databaseCopy = db.GetDatabaseCopy(server.NetbiosName);

            if (databaseCopy == null || !databaseCopy.IsValid)
            {
                throw new RlmDatabaseCopyInvalidException(db.Name, server.NetbiosName);
            }
            return(databaseCopy);
        }
 // Token: 0x06000C45 RID: 3141 RVA: 0x000365B8 File Offset: 0x000347B8
 private RemoteReplayConfiguration(IADDatabaseAvailabilityGroup dag, IADDatabase database, IADServer server, string activeFqdn, LockType lockType, ReplayConfigType type)
 {
     try
     {
         if (database == null)
         {
             throw new NullDatabaseException();
         }
         if (server == null)
         {
             throw new ErrorNullServerFromDb(database.Name);
         }
         if (activeFqdn == null)
         {
             throw new ArgumentException("Caller must provide the active node");
         }
         IADDatabaseCopy databaseCopy = database.GetDatabaseCopy(server.Name);
         if (databaseCopy == null)
         {
             throw new NullDbCopyException();
         }
         this.m_server                = server;
         this.m_database              = database;
         this.m_targetNodeFqdn        = server.Fqdn;
         this.m_sourceNodeFqdn        = activeFqdn;
         this.m_type                  = type;
         this.m_autoDatabaseMountDial = this.m_server.AutoDatabaseMountDial;
         if (type == ReplayConfigType.RemoteCopyTarget)
         {
             this.m_replayState = ReplayState.GetReplayState(this.m_targetNodeFqdn, this.m_sourceNodeFqdn, lockType, this.Identity, this.Database.Name);
         }
         else
         {
             this.m_replayState = ReplayState.GetReplayState(this.m_sourceNodeFqdn, this.m_sourceNodeFqdn, lockType, this.Identity, this.Database.Name);
         }
         this.m_replayLagTime        = databaseCopy.ReplayLagTime;
         this.m_truncationLagTime    = databaseCopy.TruncationLagTime;
         this.m_activationPreference = databaseCopy.ActivationPreference;
         base.PopulatePropertiesFromDag(dag);
     }
     finally
     {
         this.BuildDebugString();
     }
 }
 // Token: 0x060011CA RID: 4554 RVA: 0x00049F40 File Offset: 0x00048140
 public void PossiblyReportObjectsNotFoundInAD(IMonitoringADConfig adConfig)
 {
     base.WriterLockedOperation(delegate
     {
         List <AmServerName> list = new List <AmServerName>();
         List <Guid> list2        = new List <Guid>();
         List <Tuple <DbHealthInfo, DbCopyHealthInfo> > list3 = new List <Tuple <DbHealthInfo, DbCopyHealthInfo> >();
         foreach (ServerHealthInfo serverHealthInfo in this.m_serverInfos.Values)
         {
             if (adConfig.LookupMiniServerByName(serverHealthInfo.ServerName) == null)
             {
                 this.ReportTransition(serverHealthInfo.ServerFoundInAD, false);
                 if (this.IsADObjectMissingTooLong(serverHealthInfo.ServerFoundInAD.FailedDuration))
                 {
                     list.Add(serverHealthInfo.ServerName);
                 }
             }
         }
         foreach (KeyValuePair <Guid, DbHealthInfo> keyValuePair in this.m_dbServerInfos)
         {
             Guid key                = keyValuePair.Key;
             DbHealthInfo value      = keyValuePair.Value;
             IADDatabase iaddatabase = null;
             bool flag               = true;
             if (adConfig.DatabaseByGuidMap.TryGetValue(key, out iaddatabase))
             {
                 flag = false;
             }
             foreach (DbCopyHealthInfo dbCopyHealthInfo in value.DbServerInfos.Values)
             {
                 bool flag2 = true;
                 if (!flag)
                 {
                     IADDatabaseCopy databaseCopy = iaddatabase.GetDatabaseCopy(dbCopyHealthInfo.ServerName.NetbiosName);
                     if (databaseCopy != null)
                     {
                         flag2 = false;
                     }
                 }
                 if (flag2)
                 {
                     this.ReportTransition(dbCopyHealthInfo.CopyFoundInAD, false);
                     if (this.IsADObjectMissingTooLong(dbCopyHealthInfo.CopyFoundInAD.FailedDuration))
                     {
                         list3.Add(new Tuple <DbHealthInfo, DbCopyHealthInfo>(value, dbCopyHealthInfo));
                     }
                 }
             }
             if (flag)
             {
                 this.ReportTransition(value.DbFoundInAD, false);
                 if (this.IsADObjectMissingTooLong(value.DbFoundInAD.FailedDuration))
                 {
                     list2.Add(key);
                 }
             }
         }
         if (list.Count > 0)
         {
             foreach (AmServerName key2 in list)
             {
                 this.m_serverInfos.Remove(key2);
             }
         }
         if (list3.Count > 0)
         {
             foreach (Tuple <DbHealthInfo, DbCopyHealthInfo> tuple in list3)
             {
                 tuple.Item1.RemoveDbCopy(tuple.Item2.ServerName);
             }
         }
         if (list2.Count > 0)
         {
             foreach (Guid key3 in list2)
             {
                 this.m_dbServerInfos.Remove(key3);
             }
         }
     });
 }