// Token: 0x06001986 RID: 6534 RVA: 0x0006AA54 File Offset: 0x00068C54
 protected SeederInstanceBase(RpcSeederArgs rpcArgs, ConfigurationArgs configArgs)
 {
     this.SeederArgs     = rpcArgs;
     this.ConfigArgs     = configArgs;
     this.m_seederStatus = new RpcSeederStatus();
     ExTraceGlobals.SeederServerTracer.TraceDebug <string, string>((long)this.GetHashCode(), "SeederInstanceBase constructed with the following arguments: {0}; {1}", this.SeederArgs.ToString(), this.ConfigArgs.ToString());
     this.InitializePerfCounters();
     this.m_completedTimeUtc = DateTime.MaxValue;
     if (!string.IsNullOrEmpty(rpcArgs.SourceMachineName) && !SharedHelper.StringIEquals(rpcArgs.SourceMachineName, configArgs.SourceMachine))
     {
         this.m_fPassiveSeeding = true;
     }
 }
        // Token: 0x06001A9D RID: 6813 RVA: 0x00071EC8 File Offset: 0x000700C8
        public SeederInstanceContainer(RpcSeederArgs rpcArgs, ConfigurationArgs configArgs)
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 66, ".ctor", "f:\\15.00.1497\\sources\\dev\\cluster\\src\\Replay\\seeder\\seederinstancecontainer.cs");
            Database  database = null;
            Exception ex       = null;

            try
            {
                database = topologyConfigurationSession.FindDatabaseByGuid <Database>(configArgs.IdentityGuid);
            }
            catch (ADTransientException ex2)
            {
                ex = ex2;
            }
            catch (ADExternalException ex3)
            {
                ex = ex3;
            }
            catch (ADOperationException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                throw new SeedPrepareException(ReplayStrings.CouldNotFindDatabase(configArgs.IdentityGuid.ToString(), ex.ToString()), ex);
            }
            this.m_seederArgs   = rpcArgs;
            this.m_configArgs   = configArgs;
            this.m_seedDatabase = rpcArgs.SeedDatabase;
            this.m_seedCiFiles  = (rpcArgs.SeedCiFiles && !database.IsPublicFolderDatabase);
            if (this.m_seedDatabase)
            {
                if (this.m_seedCiFiles)
                {
                    this.m_databaseSeeder = new DatabaseSeederInstance(rpcArgs, configArgs, new SeedCompletionCallback(this.LaunchCiFileSeeder), null);
                }
                else
                {
                    this.m_databaseSeeder = new DatabaseSeederInstance(rpcArgs, configArgs, null, null);
                }
            }
            if (this.m_seedCiFiles)
            {
                this.m_ciFilesSeeder = new CiFilesSeederInstance(rpcArgs, configArgs);
            }
        }
        public CiFilesSeederInstance(RpcSeederArgs rpcArgs, ConfigurationArgs configArgs) : base(rpcArgs, configArgs)
        {
            ITopologyConfigurationSession adSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 73, ".ctor", "f:\\15.00.1497\\sources\\dev\\cluster\\src\\Replay\\seeder\\cifileseederinstance.cs");

            this.targetServer = CiFilesSeederInstance.GetLocalServer(adSession);
            if (!string.IsNullOrEmpty(rpcArgs.SourceMachineName) && !SharedHelper.StringIEquals(rpcArgs.SourceMachineName, configArgs.SourceMachine))
            {
                this.m_fPassiveSeeding = true;
            }
            Server server          = this.m_fPassiveSeeding ? CiFilesSeederInstance.GetServerByName(adSession, rpcArgs.SourceMachineName) : CiFilesSeederInstance.GetServerByName(adSession, configArgs.SourceMachine);
            string indexSystemName = FastIndexVersion.GetIndexSystemName(this.ConfigArgs.IdentityGuid);

            this.targetIndexSeeder                     = new IndexSeeder(indexSystemName);
            this.sourceSeederProvider                  = new CiFileSeederProvider(server.Fqdn, this.targetServer.Fqdn, this.ConfigArgs.IdentityGuid);
            this.sourceSeederProvider.NetworkName      = this.SeederArgs.NetworkId;
            this.sourceSeederProvider.CompressOverride = this.SeederArgs.CompressOverride;
            this.sourceSeederProvider.EncryptOverride  = this.SeederArgs.EncryptOverride;
            base.ReadSeedTestHook();
            ExTraceGlobals.SeederServerTracer.TraceDebug <string, string>((long)this.GetHashCode(), "CiFilesSeederInstance constructed with the following arguments: {0}; {1}", this.SeederArgs.ToString(), this.ConfigArgs.ToString());
        }
Exemple #4
0
        // Token: 0x06001B15 RID: 6933 RVA: 0x000744C4 File Offset: 0x000726C4
        public void PrepareDbSeedAndBegin(RpcSeederArgs seederArgs)
        {
            ExTraceGlobals.SeederServerTracer.TraceDebug((long)this.GetHashCode(), "SeedManager: PrepareDbSeedAndBegin() called.");
            SeederInstanceContainer seederInstanceContainer;
            bool flag = this.m_seederInstances.TryGetInstance(seederArgs.InstanceGuid, out seederInstanceContainer);

            if (flag)
            {
                this.ThrowExceptionForExistingInstance(seederArgs, seederInstanceContainer);
            }
            ExTraceGlobals.SeederServerTracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "SeedManager: A SeederInstanceContainer does NOT already exist for DB '{0}' ({1}).", seederArgs.DatabaseName, seederArgs.InstanceGuid);
            Dependencies.ADConfig.Refresh("SeedManager.PrepareDbSeedAndBegin");
            ReplayConfiguration replayConfiguration;

            this.CheckDbValidReplicationTarget(seederArgs, out replayConfiguration);
            ConfigurationArgs configurationArgs = new ConfigurationArgs(replayConfiguration, this.m_replicaInstanceManager);

            seederInstanceContainer = new SeederInstanceContainer(seederArgs, configurationArgs);
            try
            {
                this.m_seederInstances.AddInstance(seederInstanceContainer);
                ReplayEventLogConstants.Tuple_SeedInstancePrepareAdded.LogEvent(null, new object[]
                {
                    configurationArgs.Name,
                    seederArgs.ToString()
                });
            }
            catch (ArgumentException arg)
            {
                ExTraceGlobals.SeederServerTracer.TraceError <string, ArgumentException>((long)this.GetHashCode(), "SeedManager: SeederInstanceContainer for db '{0}' has already been added. This indicates another PrepareDbSeed() call got to add it just before this one. Ex: {1}", replayConfiguration.Name, arg);
                throw new SeederInstanceAlreadyAddedException(seederInstanceContainer.SeedingSource);
            }
            try
            {
                seederInstanceContainer.PrepareDbSeed();
                ReplayEventLogConstants.Tuple_SeedInstancePrepareSucceeded.LogEvent(null, new object[]
                {
                    configurationArgs.Name
                });
            }
            finally
            {
                SeederState seedState = seederInstanceContainer.SeedState;
                if (seedState != SeederState.SeedPrepared)
                {
                    this.m_seederInstances.RemoveInstance(seederInstanceContainer);
                    ExTraceGlobals.SeederServerTracer.TraceDebug <string, SeederState>((long)this.GetHashCode(), "SeedManager: SeederInstanceContainer for db '{0}' is being removed from table because PrepareDbSeed() did not pass (state ={1}, expected was SeedPrepared).", replayConfiguration.Name, seedState);
                    ReplayEventLogConstants.Tuple_SeedInstancePrepareUnknownError.LogEvent(null, new object[]
                    {
                        configurationArgs.Name
                    });
                }
            }
            ExTraceGlobals.SeederServerTracer.TraceDebug <string>((long)this.GetHashCode(), "SeedManager: SeederInstanceContainer for db '{0} is being queued for seeding since PrepareDbSeed() passed.", replayConfiguration.Name);
            try
            {
                seederInstanceContainer.BeginDbSeed();
                ReplayEventLogConstants.Tuple_SeedInstanceBeginSucceeded.LogEvent(null, new object[]
                {
                    configurationArgs.Name
                });
            }
            finally
            {
                SeederState seedState2 = seederInstanceContainer.SeedState;
                if (seedState2 != SeederState.SeedInProgress && seedState2 != SeederState.SeedSuccessful)
                {
                    this.m_seederInstances.RemoveInstance(seederInstanceContainer);
                    ExTraceGlobals.SeederServerTracer.TraceDebug <string, SeederState>((long)this.GetHashCode(), "SeedManager: SeederInstanceContainer for db '{0}' is being removed from table because BeginDbSeed() did not pass (state = {1}).", replayConfiguration.Name, seedState2);
                    ReplayEventLogConstants.Tuple_SeedInstanceBeginUnknownError.LogEvent(null, new object[]
                    {
                        configurationArgs.Name
                    });
                }
            }
        }