diff --git a/CHANGELOG b/CHANGELOG index 7399efcd15..30ee3ad3e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,10 @@ v3.5.2 (XXXX-XX-XX) ------------------- +* Fixed available flag for hotbackup. + +* Fixed list with id for partially available hotbackups. + * Fixed agency TTL bug happening under certain rare conditions. * Improved performance of some agency helper functions. @@ -48,10 +52,10 @@ v3.5.1 (2019-10-07) `--javascript.copy-installation`. This potentially fixes the following error message at startup: - Error copying JS installation files to '...': + Error copying JS installation files to '...': failed to open source file ...: No such file or directory -* Added startup option `--cluster.max-number-of-shards` for restricting the +* Added startup option `--cluster.max-number-of-shards` for restricting the maximum number of shards when creating new collections. The default value for this setting is `1000`, which is also the previously hard-coded built-in limit. A value of `0` for this option means "unrestricted". @@ -71,8 +75,8 @@ v3.5.1 (2019-10-07) No collections can be created which have a replication factor value above this setting's value. The default value is 10. - `--cluster.default-replication-factor`: this settings controls the default - replication factor value that is used when creating new collections and - no value of replication factor has been specified. + replication factor value that is used when creating new collections and + no value of replication factor has been specified. If no value is set for this option, the value of the option `--cluster.min-replication-factor` will be used. @@ -144,7 +148,7 @@ v3.5.1 (2019-10-07) * Added UI support to create documents in a collection using smartGraphAttribute and/or smartJoinAttribute. - + * Add count of objects to latency reporting in arangoimport. * Harden database creation against spurious "duplicate name" errors that diff --git a/arangod/Cluster/ClusterMethods.cpp b/arangod/Cluster/ClusterMethods.cpp index 65a62609d3..b39d45788a 100644 --- a/arangod/Cluster/ClusterMethods.cpp +++ b/arangod/Cluster/ClusterMethods.cpp @@ -312,7 +312,7 @@ static void mergeResults(std::vector> const namespace { // velocypack representation of object // {"error":true,"errorMessage":"document not found","errorNum":1202} -static const char* notFoundSlice = +static const char* notFoundSlice = "\x14\x36\x45\x65\x72\x72\x6f\x72\x1a\x4c\x65\x72\x72\x6f\x72\x4d" "\x65\x73\x73\x61\x67\x65\x52\x64\x6f\x63\x75\x6d\x65\x6e\x74\x20" "\x6e\x6f\x74\x20\x66\x6f\x75\x6e\x64\x48\x65\x72\x72\x6f\x72\x4e" @@ -327,7 +327,7 @@ static void mergeResultsAllShards(std::vector> con TRI_ASSERT(errorCounter.find(TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) == errorCounter.end()); size_t realNotFound = 0; - + resultBody->clear(); resultBody->openArray(); for (VPackValueLength currentIndex = 0; currentIndex < expectedResults; ++currentIndex) { @@ -336,7 +336,7 @@ static void mergeResultsAllShards(std::vector> con VPackSlice oneRes = it->slice(); TRI_ASSERT(oneRes.isArray()); oneRes = oneRes.at(currentIndex); - + int errorNum = TRI_ERROR_NO_ERROR; VPackSlice errorNumSlice = oneRes.get(StaticStrings::ErrorNum); if (errorNumSlice.isNumber()) { @@ -3260,8 +3260,7 @@ arangodb::Result hotBackupList(std::vector const& dbServers, VPackSlic resSlice = resSlice.get("result"); if (!resSlice.hasKey("list") || !resSlice.get("list").isObject()) { - return arangodb::Result(TRI_ERROR_HTTP_NOT_FOUND, - "result is missing backup list"); + continue; } if (!payload.isNone() && plan.slice().isNone()) { @@ -3313,7 +3312,7 @@ arangodb::Result hotBackupList(std::vector const& dbServers, VPackSlic front._sizeInBytes = totalSize; front._nrFiles = totalFiles; front._serverId = ""; // makes no sense for whole cluster - front._isAvailable = i.second.size() == dbServers.size(); + front._isAvailable = i.second.size() == dbServers.size() && i.second.size() == front._nrDBServers; front._nrPiecesPresent = static_cast(i.second.size()); hotBackups.insert(std::make_pair(front._id, front)); } @@ -3615,6 +3614,11 @@ arangodb::Result hotRestoreCoordinator(VPackSlice const payload, VPackBuilder& r << " on all db servers: " << result.errorMessage(); return result; } + if (list.size() == 0) { + return arangodb::Result(TRI_ERROR_HTTP_NOT_FOUND, + "result is missing backup list"); + } + if (plan.slice().isNone()) { LOG_TOPIC("54b9a", ERR, Logger::BACKUP) << "failed to find agency dump for " << backupId @@ -3622,14 +3626,20 @@ arangodb::Result hotRestoreCoordinator(VPackSlice const payload, VPackBuilder& r return result; } + TRI_ASSERT(list.size() == 1); + BackupMeta& meta = list.begin()->second; + if (!meta._isAvailable) { + LOG_TOPIC("ed4df", ERR, Logger::BACKUP) + << "backup not available" << backupId; + return arangodb::Result(TRI_ERROR_HOT_RESTORE_INTERNAL, + "backup not available for restore"); + } + // Check if the version matches the current version if (!ignoreVersion) { - TRI_ASSERT(list.size() == 1); using arangodb::methods::Version; using arangodb::methods::VersionResult; -#ifdef USE_ENTERPRISE - BackupMeta& meta = list.begin()->second; - // Will never be called in community +#ifdef USE_ENTERPRISE // Will never be called in community if (!RocksDBHotBackup::versionTestRestore(meta._version)) { return arangodb::Result(TRI_ERROR_HOT_RESTORE_INTERNAL, "Version mismatch");