1
0
Fork 0

forceBackup is now allowInconsistent (#9850)

* forceBackup is now allowInconsistent
This commit is contained in:
Kaveh Vahedipour 2019-09-02 10:32:58 +02:00 committed by Max Neunhöffer
parent 2cdb335584
commit cced54cbc7
4 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,8 @@
devel
-----
* Allowing inconsistent rather than forcing hot backups
* Fixed adding an orphan collections as the first collection in a SmartGraph.
* Fixed issue #9862: ServerException: RestHandler/RestCursorHandler.cpp:279
@ -20,14 +22,14 @@ devel
* Fixed internal issue #4407: remove storage engine warning.
* Added support for TLS 1.3 for the arangod server and the client tools.
* Added support for TLS 1.3 for the arangod server and the client tools.
The default TLS protocol for the arangod server is now TLS 1.3 as well, in
contrast to TLS 1.2 in previous versions.
The arangod server can be started with option `--ssl.protocol 5` to make it use
TLS 1.2 again.
All client tools also support TLS 1.3, by using the `--ssl.protocol 6` option when
invoking them. The client tools will use TLS 1.2 by default, in order to be
compatible with older versions of ArangoDB that may be contacted by these tools.

View File

@ -24,7 +24,7 @@ UUID is created for this part of the ID.
The time in seconds that the operation tries to get a consistent
snapshot. The default is 120 seconds.
@RESTBODYPARAM{forceBackup,boolean,optional,boolean}
@RESTBODYPARAM{allowInconsistent,boolean,optional,boolean}
If this flag is set to `true` and no global transaction lock can be
acquired within the given timeout, a possibly inconsistent backup
is taken. The default for this flag is `false` and in this case

View File

@ -3888,7 +3888,7 @@ arangodb::Result hotBackupDBServers(
builder.add("label", VPackValue(backupId));
builder.add("agency-dump", agencyDump);
builder.add("timestamp", VPackValue(timeStamp));
builder.add("forceBackup", VPackValue(force));
builder.add("allowInconsistent", VPackValue(force));
}
auto body = std::make_shared<std::string>(builder.toJson());
@ -4059,11 +4059,11 @@ arangodb::Result hotBackupCoordinator(VPackSlice const payload, VPackBuilder& re
(!payload.isObject() ||
(payload.hasKey("label") && !payload.get("label").isString()) ||
(payload.hasKey("timeout") && !payload.get("timeout").isNumber()) ||
(payload.hasKey("forceBackup") && !payload.get("forceBackup").isBoolean()))) {
(payload.hasKey("allowInconsistent") && !payload.get("allowInconsistent").isBoolean()))) {
return arangodb::Result(TRI_ERROR_BAD_PARAMETER, BAD_PARAMS_CREATE);
}
bool force = !payload.isNone() && payload.get("forceBackup").isTrue();
bool force = !payload.isNone() && payload.get("allowInconsistent").isTrue();
std::string const backupId =
(payload.isObject() && payload.hasKey("label")) ?
@ -4205,7 +4205,7 @@ arangodb::Result hotBackupCoordinator(VPackSlice const payload, VPackBuilder& re
VPackObjectBuilder o(&report);
report.add("id", VPackValue(timeStamp + "_" + backupId));
if (!gotLocks) {
report.add("forced", VPackValue(true));
report.add("potentiallyInconsistent", VPackValue(true));
}
}

View File

@ -260,7 +260,7 @@ arangodb::Result executeCreate(arangodb::httpclient::SimpleHttpClient& client,
{
VPackObjectBuilder guard(&bodyBuilder);
bodyBuilder.add("timeout", VPackValue(options.maxWaitForLock));
bodyBuilder.add("forceBackup", VPackValue(options.force));
bodyBuilder.add("allowInconsistent", VPackValue(options.force));
if (!options.label.empty()) {
bodyBuilder.add("label", VPackValue(options.label));
}
@ -303,14 +303,14 @@ arangodb::Result executeCreate(arangodb::httpclient::SimpleHttpClient& client,
}
TRI_ASSERT(identifier.isString());
VPackSlice const forced = resultObject.get("forced");
VPackSlice const forced = resultObject.get("potentiallyInconsistent");
if (forced.isTrue()) {
LOG_TOPIC("f448b", WARN, arangodb::Logger::BACKUP)
<< "Failed to get write lock before proceeding with backup. Backup may "
"contain some inconsistencies.";
} else if (!forced.isBoolean() && !forced.isNone()) {
result.reset(TRI_ERROR_INTERNAL,
"expected 'result.forced'' to be an boolean");
"expected 'result.potentiallyInconsistent' to be an boolean");
return result;
}
@ -680,7 +680,7 @@ void BackupFeature::collectOptions(std::shared_ptr<options::ProgramOptions> opti
new DiscreteValuesParameter<StringParameter>(&_options.operation, ::Operations),
static_cast<std::underlying_type<Flags>::type>(Flags::Hidden));
options->addOption("--force",
options->addOption("--allow-inconsistent",
"whether to attempt to continue in face of errors (may "
"result in inconsistent backup state)",
new BooleanParameter(&_options.force));