internal void CheckForCatalogState(SearchTestResult result) { Guid databaseGuid = result.DatabaseGuid; Guid serverGuid = result.ServerGuid; Guid mailboxGuid = result.MailboxGuid; AmServerName amServer = new AmServerName(result.Server); this.monitor.AddMonitoringEvent(result, Strings.TestSearchGetMDBCatalogState(result.Database)); base.WriteVerbose(Strings.TestSearchGetMDBCatalogState(result.Database)); Exception ex; CopyStatusClientCachedEntry[] copyStatus = CopyStatusHelper.GetCopyStatus(amServer, RpcGetDatabaseCopyStatusFlags2.None, new Guid[] { databaseGuid }, 5000, null, out ex); if (ex != null || copyStatus == null || copyStatus.Length != 1) { this.monitor.AddMonitoringEvent(result, Strings.TestSearchGetCatalogStatusError(result.Database)); return; } RpcDatabaseCopyStatus2 copyStatus2 = copyStatus[0].CopyStatus; base.WriteVerbose(Strings.TestSearchCatalogState(copyStatus2.ContentIndexStatus.ToString())); this.monitor.AddMonitoringEvent(result, Strings.TestSearchCatalogState(copyStatus2.ContentIndexStatus.ToString())); if (copyStatus2.ContentIndexStatus != ContentIndexStatusType.Healthy && copyStatus2.ContentIndexStatus != ContentIndexStatusType.HealthyAndUpgrading) { result.SetErrorTestResult(EventId.CatalogInUnhealthyState, Strings.TestSearchCatalogState(copyStatus2.ContentIndexStatus.ToString())); if (!string.IsNullOrWhiteSpace(copyStatus2.ContentIndexErrorMessage)) { this.monitor.AddMonitoringEvent(result, Strings.TestSearchCatalogErrorMessage(copyStatus2.ContentIndexErrorMessage)); return; } } else if (copyStatus2.ContentIndexBacklog != null) { int value = copyStatus2.ContentIndexBacklog.Value; string backlog = (value / 60).ToString(); this.monitor.AddMonitoringEvent(result, Strings.TestSearchCatalogBacklog(backlog, copyStatus2.ContentIndexRetryQueueSize.ToString())); if (value > this.IndexingTimeoutInSeconds) { result.SetErrorTestResult(EventId.CatalogBacklog, Strings.TestSearchCatalogBacklog(backlog, copyStatus2.ContentIndexRetryQueueSize.ToString())); } } }
internal virtual bool TryGetCopyStatus(AmServerName node, Guid[] mdbGuids, out CopyStatusClientCachedEntry[] results, out RpcHealthStateInfo[] healthStates, out Exception exception) { int timeoutMs = (this.m_rpcTimeoutInMs > 0) ? this.m_rpcTimeoutInMs : RegistryParameters.BCSGetCopyStatusRPCTimeoutInMSec; results = null; healthStates = null; exception = null; if (mdbGuids != null) { results = CopyStatusHelper.GetCopyStatus(node, this.m_rpcFlags, mdbGuids, timeoutMs, this.m_activeManager, this.m_isGetHealthStates, out healthStates, out exception); } else { results = CopyStatusHelper.GetAllCopyStatuses(node, this.m_rpcFlags, this.m_databaseMap[node], timeoutMs, this.m_activeManager, this.m_isGetHealthStates, out healthStates, out exception); } bool flag = exception == null; if (!flag) { ExTraceGlobals.ActiveManagerTracer.TraceError <AmServerName, Exception>(0L, "AmMultiNodeCopyStatusFetcher: GetCopyStatus RPC to server '{0}' failed with ex: {1}", node, exception); } return(flag); }