private static Exception ReseedCatalog(CatalogAutoReseedWorkflow workflow) { Exception result = null; using (SeederClient seederClient = SeederClient.Create(workflow.Context.TargetServerName.Fqdn, workflow.Context.Database.Name, null, workflow.Context.TargetServer.AdminDisplayVersion)) { bool flag = false; for (int i = 0; i <= 1; i++) { result = null; try { if (flag) { seederClient.EndDbSeed(workflow.Context.Database.Guid); } AutoReseedWorkflow.Tracer.TraceDebug((long)workflow.GetHashCode(), "CatalogAutoReseedWorkflow: Attempt({0}) to reseed catalog for database copy '{1}\\{2}' from {3}.", new object[] { i, workflow.Context.Database.Name, workflow.Context.TargetServerName, string.IsNullOrEmpty(workflow.sourceName) ? "Active" : workflow.sourceName }); SeederRpcFlags reseedRPCReason = CatalogAutoReseedWorkflow.GetReseedRPCReason(workflow.catalogReseedReason); seederClient.PrepareDbSeedAndBegin(workflow.Context.Database.Guid, false, false, false, false, false, true, string.Empty, null, workflow.sourceName, null, null, reseedRPCReason); break; } catch (SeederInstanceAlreadyInProgressException ex) { result = ex; break; } catch (SeederInstanceAlreadyFailedException ex2) { result = ex2; flag = true; } catch (SeederServerException ex3) { result = ex3; } catch (SeederServerTransientException ex4) { result = ex4; } if (!string.IsNullOrEmpty(workflow.sourceName)) { workflow.sourceName = string.Empty; } } } return(result); }
// Token: 0x06001A47 RID: 6727 RVA: 0x0006EA10 File Offset: 0x0006CC10 public void BeginServerLevelSeed(bool fDeleteExistingLogs, bool fSafeDeleteExistingFiles, int maxSeedsInParallel, bool fAutoSuspend, bool fManualResume, bool fSeedDatabase, bool fSeedCiFiles, bool?compressOverride, bool?encryptOverride, SeederRpcFlags flags = SeederRpcFlags.None) { RpcSeederArgs args = new RpcSeederArgs(Guid.Empty, fDeleteExistingLogs, fAutoSuspend, null, null, string.Empty, false, string.Empty, null, fManualResume, fSeedDatabase, fSeedCiFiles, compressOverride, encryptOverride, maxSeedsInParallel, fSafeDeleteExistingFiles, flags); this.ValidateArgs(args); ExTraceGlobals.SeederClientTracer.TraceDebug <RpcSeederArgs>((long)this.GetHashCode(), "BeginServerLevelSeed(): Constructed RpcSeederArgs: {0}", args); RpcErrorExceptionInfo errorInfo = null; RpcSeederStatus seedStatus = null; ServerVersion version = this.GetTestHookServerVersion(); SeederRpcExceptionWrapper.Instance.ClientRetryableOperation(this.m_serverName, delegate { if (ReplayRpcVersionControl.IsSeedRpcV5Supported(version)) { errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin5(args, ref seedStatus); return; } if (ReplayRpcVersionControl.IsSeedRpcSafeDeleteSupported(version)) { errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin4(args, ref seedStatus); return; } ExTraceGlobals.SeederClientTracer.TraceError <string, ServerVersion, ServerVersion>((long)this.GetHashCode(), "BeginServerLevelSeed(): Server '{0}' does not support server-level reseed RPC. Server version: {1}. Minimum supported version: {2}", this.m_serverName, version, ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion); throw new SeederRpcServerLevelUnsupportedException(this.m_serverName, version.ToString(), ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion.ToString()); }); SeederRpcExceptionWrapper.Instance.ClientRethrowIfFailed(this.m_databaseName, this.m_serverName, errorInfo); }
// Token: 0x06001A46 RID: 6726 RVA: 0x0006E83C File Offset: 0x0006CA3C public void PrepareDbSeedAndBegin(Guid dbGuid, bool fDeleteExistingLogs, bool fSafeDeleteExistingFiles, bool fAutoSuspend, bool fManualResume, bool fSeedDatabase, bool fSeedCiFiles, string networkId, string seedingPath, string sourceName, bool?compressOverride, bool?encryptOverride, SeederRpcFlags flags = SeederRpcFlags.None) { if (dbGuid == Guid.Empty) { throw new ArgumentException("An invalid Database Guid was specified.", "dbGuid"); } RpcSeederArgs args = new RpcSeederArgs(dbGuid, fDeleteExistingLogs, fAutoSuspend, seedingPath, null, networkId, false, sourceName, null, fManualResume, fSeedDatabase, fSeedCiFiles, compressOverride, encryptOverride, 0, fSafeDeleteExistingFiles, flags); this.ValidateArgs(args); ExTraceGlobals.SeederClientTracer.TraceDebug <RpcSeederArgs>((long)this.GetHashCode(), "PrepareDbSeedAndBegin(): Constructed RpcSeederArgs: {0}", args); RpcErrorExceptionInfo errorInfo = null; RpcSeederStatus seedStatus = null; ServerVersion version = this.GetTestHookServerVersion(); bool isSafeDeleteSupported = ReplayRpcVersionControl.IsSeedRpcSafeDeleteSupported(version); bool isSeedV5Supported = ReplayRpcVersionControl.IsSeedRpcV5Supported(version); SeederRpcExceptionWrapper.Instance.ClientRetryableOperation(this.m_serverName, delegate { if (isSeedV5Supported) { errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin5(args, ref seedStatus); return; } if (isSafeDeleteSupported) { errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin4(args, ref seedStatus); return; } if (!fSafeDeleteExistingFiles) { errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin(args, ref seedStatus); return; } ExTraceGlobals.SeederClientTracer.TraceError <string, ServerVersion, ServerVersion>((long)this.GetHashCode(), "PrepareDbSeedAndBegin(): Server '{0}' does not support SafeDeleteExistingFiles RPC. Server version: {1}. Minimum supported version: {2}", this.m_serverName, version, ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion); throw new SeederRpcSafeDeleteUnsupportedException(this.m_serverName, version.ToString(), ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion.ToString()); }); SeederRpcExceptionWrapper.Instance.ClientRethrowIfFailed(this.m_databaseName, this.m_serverName, errorInfo); }