// Token: 0x06001A36 RID: 6710 RVA: 0x0006E2CC File Offset: 0x0006C4CC
        private void TryReseedCopy(CopyStatusClientCachedEntry status)
        {
            Exception ex          = null;
            string    dbname      = status.CopyStatus.DBName;
            string    netbiosName = status.ServerContacted.NetbiosName;

            try
            {
                FullServerReseeder.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "FullServerReseeder: Next, attempting to reseed database copy '{0}\\{1}'.", dbname, netbiosName);
                ReplayCrimsonEvents.FullServerCopyReseeding.Log <string, string, Guid>(dbname, netbiosName, status.DbGuid);
                this.m_reseedsAttempted.Add(status.DbGuid, status);
                using (SeederClient seederClient = SeederClient.Create(AmServerName.LocalComputerName.Fqdn, dbname, null, this.m_localServer.AdminDisplayVersion))
                {
                    if (this.m_args.SeedCiFiles)
                    {
                        try
                        {
                            FullServerReseeder.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "FullServerReseeder: Trying to cancel/end a previously running seed for database copy '{0}\\{1}'", dbname, netbiosName);
                            seederClient.CancelDbSeed(status.DbGuid);
                            seederClient.EndDbSeed(status.DbGuid);
                        }
                        catch (SeederInstanceNotFoundException arg)
                        {
                            FullServerReseeder.Tracer.TraceDebug <string, Guid, SeederInstanceNotFoundException>((long)this.GetHashCode(), "FullServerReseeder: CancelDbSeed() or EndDbSeed() failed for database '{0}' ({1}). Error: {2}", dbname, status.DbGuid, arg);
                        }
                    }
                    seederClient.PrepareDbSeedAndBegin(status.DbGuid, this.m_args.DeleteExistingFiles, this.m_args.SafeDeleteExistingFiles, this.m_args.AutoSuspend, this.m_args.ManualResume, this.m_args.SeedDatabase, this.m_args.SeedCiFiles, string.Empty, null, string.Empty, this.m_args.CompressOverride, this.m_args.EncryptOverride, this.m_args.Flags | SeederRpcFlags.SkipSettingReseedAutoReseedState);
                }
            }
            catch (SeederServerException ex2)
            {
                ex = ex2;
            }
            catch (SeederServerTransientException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                FullServerReseeder.Tracer.TraceError <string, string, Exception>((long)this.GetHashCode(), "FullServerReseeder: Reseeding database copy '{0}\\{1}' failed. Error: {2}", dbname, netbiosName, ex);
                ReplayCrimsonEvents.FullServerCopyReseedFailed.Log <string, string, Guid, string>(dbname, netbiosName, status.DbGuid, ex.Message);
            }
        }
Example #2
0
 // Token: 0x06001964 RID: 6500 RVA: 0x0006A0D8 File Offset: 0x000682D8
 private static void BeginSeedRpc(FailedSuspendedCopyAutoReseedWorkflow wf)
 {
     using (SeederClient seederClient = SeederClient.Create(wf.Context.TargetServerName.Fqdn, wf.Context.Database.Name, null, wf.Context.TargetServer.AdminDisplayVersion))
     {
         try
         {
             seederClient.CancelDbSeed(wf.Context.Database.Guid);
             seederClient.EndDbSeed(wf.Context.Database.Guid);
             wf.TraceDebug("Prior seed instance has been Cancelled.", new object[0]);
         }
         catch (SeederInstanceNotFoundException ex)
         {
             wf.TraceDebug("Prior seed instance cleanup failed with: {0}", new object[]
             {
                 ex
             });
         }
         seederClient.PrepareDbSeedAndBegin(wf.Context.Database.Guid, false, true, false, false, true, true, string.Empty, null, string.Empty, null, null, SeederRpcFlags.SkipSettingReseedAutoReseedState);
     }
 }