Пример #1
0
        // Token: 0x06001B19 RID: 6937 RVA: 0x00074918 File Offset: 0x00072B18
        private void CheckDbValidReplicationTarget(RpcSeederArgs seederArgs, out ReplayConfiguration replayConfig)
        {
            replayConfig = null;
            ADReplicationRetryTimer adreplicationRetryTimer = new ADReplicationRetryTimer();
            bool flag = !seederArgs.SeedDatabase && seederArgs.SeedCiFiles;

            try
            {
                bool flag2;
                while (!this.IsDBCurrentReplicaInstance(seederArgs.InstanceGuid, out replayConfig, out flag2))
                {
                    if (SeedHelper.IsDbPendingLcrRcrTarget(seederArgs.InstanceGuid, out replayConfig, out flag2))
                    {
                        if (flag2)
                        {
                            if (flag)
                            {
                                ExTraceGlobals.SeederServerTracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "SeedManager: Database '{0}' ({1}) is not a valid RCR replica target but the requested seeding is CI only.", replayConfig.Name, seederArgs.InstanceGuid);
                                return;
                            }
                            this.HandleDbCopyNotTarget(seederArgs, replayConfig);
                        }
                        ExTraceGlobals.SeederServerTracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "SeedManager: Database '{0}' ({1}) is a valid RCR replica target.", replayConfig.Name, seederArgs.InstanceGuid);
                        return;
                    }
                    ExTraceGlobals.SeederServerTracer.TraceDebug <Guid>((long)this.GetHashCode(), "SeedManager: Database '{0}' is NOT a valid RCR replica target!", seederArgs.InstanceGuid);
                    if (adreplicationRetryTimer.IsExpired)
                    {
                        throw new InvalidDbForSeedSpecifiedException();
                    }
                    adreplicationRetryTimer.Sleep();
                }
                if (flag2)
                {
                    if (flag)
                    {
                        ExTraceGlobals.SeederServerTracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "SeedManager: Database '{0}' ({1}) is not running as a valid RCR replica target but the requested seeding is CI only.", replayConfig.Name, seederArgs.InstanceGuid);
                        return;
                    }
                    this.HandleDbCopyNotTarget(seederArgs, replayConfig);
                }
                ExTraceGlobals.SeederServerTracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "SeedManager: Database '{0}' ({1}) is currently running as a valid RCR replica target.", replayConfig.Name, seederArgs.InstanceGuid);
            }
            catch (DataSourceOperationException ex)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <DataSourceOperationException>((long)this.GetHashCode(), "SeedManager: CheckDBValidReplicationTarget: Exception encountered: {0}", ex);
                throw new SeedPrepareException(ex.ToString(), ex);
            }
            catch (DataValidationException ex2)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <DataValidationException>((long)this.GetHashCode(), "SeedManager: CheckDBValidReplicationTarget: Exception encountered: {0}", ex2);
                throw new SeedPrepareException(ex2.ToString(), ex2);
            }
            catch (ObjectNotFoundException ex3)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <ObjectNotFoundException>((long)this.GetHashCode(), "SeedManager: CheckDBValidReplicationTarget: Exception encountered: {0}", ex3);
                throw new SeedPrepareException(ex3.ToString(), ex3);
            }
            catch (StoragePermanentException ex4)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <StoragePermanentException>((long)this.GetHashCode(), "SeedManager: CheckDBValidReplicationTarget: Exception encountered: {0}", ex4);
                throw new SeedPrepareException(ex4.ToString(), ex4);
            }
            catch (TransientException ex5)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <TransientException>((long)this.GetHashCode(), "SeedManager: CheckDBValidReplicationTarget: Exception encountered: {0}", ex5);
                throw new SeedPrepareException(ex5.ToString(), ex5);
            }
        }
 public ADReplicationRetryTimer() : base(ADReplicationRetryTimer.GetMaxWait())
 {
 }