1
0
Fork 0

Changes to allow restore from 3.5 to 3.6.

This commit is contained in:
Max Neunhoeffer 2019-11-14 16:49:38 +01:00
parent 40ae1d3c81
commit abd8c5b8bd
No known key found for this signature in database
GPG Key ID: 89A912AD5E343E1E
4 changed files with 9 additions and 5 deletions

View File

@ -143,9 +143,9 @@ void UpgradeFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
cluster.forceDisable(); cluster.forceDisable();
ServerState::instance()->setRole(ServerState::ROLE_SINGLE); ServerState::instance()->setRole(ServerState::ROLE_SINGLE);
#ifdef USE_ENTEPRISE #ifdef USE_ENTERPRISE
HotBackupFeature& hotBackupFeature = server().getFeature<HotBackupFeature>(); HotBackupFeature& hotBackupFeature = server().getFeature<HotBackupFeature>();
hotBackupFeature.disable(); hotBackupFeature.forceDisable();
#endif #endif
} }

View File

@ -277,3 +277,5 @@ std::string const StaticStrings::New("new");
std::string const StaticStrings::Old("old"); std::string const StaticStrings::Old("old");
std::string const StaticStrings::UpgradeEnvName( std::string const StaticStrings::UpgradeEnvName(
"ARANGODB_UPGRADE_DURING_RESTORE"); "ARANGODB_UPGRADE_DURING_RESTORE");
std::string const StaticStrings::BackupToDeleteName("DIRECTORY_TO_DELETE");
std::string const StaticStrings::BackupSearchToDeleteName("DIRECTORY_TO_DELETE_SEARCH");

View File

@ -252,6 +252,8 @@ class StaticStrings {
static std::string const New; static std::string const New;
static std::string const Old; static std::string const Old;
static std::string const UpgradeEnvName; static std::string const UpgradeEnvName;
static std::string const BackupToDeleteName;
static std::string const BackupSearchToDeleteName;
}; };
} // namespace arangodb } // namespace arangodb

View File

@ -365,16 +365,16 @@ public:
/// @brief test /// @brief test
TEST(RocksDBHotBackupRestoreDirectories, test_createRestoringDirectory) { TEST(RocksDBHotBackupRestoreDirectories, test_createRestoringDirectory) {
std::string restoringDir, restoringSearchDir, tempname; std::string fullRestoringDir, restoringDir, restoringSearchDir, tempname;
bool retBool; bool retBool;
VPackBuilder report; VPackBuilder report;
tests::mocks::MockAqlServer server; tests::mocks::MockAqlServer server;
HotBackupFeature& feature = server.getFeature<HotBackupFeature>(); HotBackupFeature& feature = server.getFeature<HotBackupFeature>();
RocksDBHotBackupRestoreTest testee(feature, VPackSlice(), report); RocksDBHotBackupRestoreTest testee(feature, VPackSlice(), report);
testee.createHotDirectory(); testee.createHotDirectory()
retBool = testee.createRestoringDirectories(restoringDir, restoringSearchDir); retBool = testee.createRestoringDirectories(fullRestoringDir, restoringDir, restoringSearchDir);
// spot check files in restoring dir // spot check files in restoring dir
EXPECT_TRUE( retBool ); EXPECT_TRUE( retBool );