8000 Backup with view by maierlars · Pull Request #10386 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Backup with view #10386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes to upgrade on env-var.
  • Loading branch information
neunhoef committed Nov 13, 2019
commit 40ae1d3c8143788d5cddd24668c1eb77adbd2c63
3 changes: 2 additions & 1 deletion arangod/Cluster/ClusterMethods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3011,7 +3011,8 @@ arangodb::Result hotRestoreCoordinator(ClusterFeature& feature, VPackSlice const
using arangodb::methods::VersionResult;
#ifdef USE_ENTERPRISE
// Will never be called in community
if (!RocksDBHotBackup::versionTestRestore(meta._version)) {
bool autoUpgradeNeeded; // not actually used
if (!RocksDBHotBackup::versionTestRestore(meta._version, autoUpgradeNeeded)) {
return arangodb::Result(TRI_ERROR_HOT_RESTORE_INTERNAL,
"Version mismatch");
}
Expand Down
19 changes: 15 additions & 4 deletions arangod/RestServer/UpgradeFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@

#include "ApplicationFeatures/HttpEndpointProvider.h"
#include "Basics/application-exit.h"
#include "Basics/StaticStrings.h"
#include "Cluster/ClusterFeature.h"
#ifdef USE_ENTERPRISE
#include "Enterprise/StorageEngine/HotBackupFeature.h"
#endif
#include "FeaturePhases/AqlFeaturePhase.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "Logger/LogMacros.h"
Expand Down Expand Up @@ -79,10 +83,8 @@ void UpgradeFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
extern std::function<int()> * restartAction;

#ifndef _WIN32
static std::string const UPGRADE_ENV = "ARANGODB_UPGRADE_DURING_RESTORE";

static int upgradeRestart() {
unsetenv(UPGRADE_ENV.c_str());
unsetenv(StaticStrings::UpgradeEnvName.c_str());
return 0;
}
#endif
Expand All @@ -97,11 +99,15 @@ void UpgradeFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
// variable at runtime and then does a restore. After the restart (with
// the old data) the database upgrade is run and another restart is
// happening afterwards with the environment variable being cleared.
char* upgrade = getenv(UPGRADE_ENV.c_str());
char* upgrade = getenv(StaticStrings::UpgradeEnvName.c_str());
if (upgrade != nullptr) {
_upgrade = true;
restartAction = new std::function<int()>();
*restartAction = upgradeRestart;
LOG_TOPIC("fdeae", INFO, Logger::STARTUP)
<< "Detected environment variable " << StaticStrings::UpgradeEnvName
<< " with value " << upgrade
<< " will perform database auto-upgrade and immediately restart.";
}
#endif
if (_upgrade && !_upgradeCheck) {
Expand Down Expand Up @@ -136,6 +142,11 @@ void UpgradeFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
ClusterFeature& cluster = server().getFeature<ClusterFeature>();
cluster.forceDisable();
ServerState::instance()->setRole(ServerState::ROLE_SINGLE);

#ifdef USE_ENTEPRISE
HotBackupFeature& hotBackupFeature = server().getFeature<HotBackupFeature>();
hotBackupFeature.disable();
#endif
}

8000
void UpgradeFeature::prepare() {
Expand Down
2 changes: 2 additions & 0 deletions lib/Basics/StaticStrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,5 @@ std::string const StaticStrings::RebootId("rebootId");

std::string const StaticStrings::New("new");
std::string const StaticStrings::Old("old");
std::string const StaticStrings::UpgradeEnvName(
"ARANGODB_UPGRADE_DURING_RESTORE");
1 change: 1 addition & 0 deletions lib/Basics/StaticStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ class StaticStrings {
static std::string const RebootId;
static std::string const New;
static std::string const Old;
static std::string const UpgradeEnvName;
};
} // namespace arangodb

Expand Down
0