fix: if a DR cluster has a much lower version than the primary database, it would take a long time to process the empty versions. But the version of the DR cluster before starting the DR to avoid this problem.

This commit is contained in:
Evan Tschannen 2018-04-18 19:37:24 -07:00
parent 224621be04
commit 77d100e1e6
1 changed files with 13 additions and 13 deletions

View File

@ -1426,19 +1426,6 @@ public:
TraceEvent("DBA_switchover_stopped");
try {
Void _ = wait( drAgent.submitBackup(backupAgent->taskBucket->src, tagName, backupRanges, false, addPrefix, removePrefix, true, true) );
} catch( Error &e ) {
if( e.code() != error_code_backup_duplicate )
throw;
}
TraceEvent("DBA_switchover_submitted");
int _ = wait( drAgent.waitSubmitted(backupAgent->taskBucket->src, tagName) );
TraceEvent("DBA_switchover_started");
state ReadYourWritesTransaction tr3(dest);
loop {
try {
@ -1460,6 +1447,19 @@ public:
TraceEvent("DBA_switchover_version_upgraded");
try {
Void _ = wait( drAgent.submitBackup(backupAgent->taskBucket->src, tagName, backupRanges, false, addPrefix, removePrefix, true, true) );
} catch( Error &e ) {
if( e.code() != error_code_backup_duplicate )
throw;
}
TraceEvent("DBA_switchover_submitted");
int _ = wait( drAgent.waitSubmitted(backupAgent->taskBucket->src, tagName) );
TraceEvent("DBA_switchover_started");
Void _ = wait( backupAgent->unlockBackup(dest, tagName) );
TraceEvent("DBA_switchover_unlocked");