diff --git a/CHANGELOG b/CHANGELOG index 6894363d3c..dc0b9d0acb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ devel ----- +* DB server locking / unlocking for hot backup revisited and enhanced + * Re-enabled the AQL sort-limit optimization rule in conjunction with fullCount in the cluster. It now also may speed up fullCount with sorted indexes and a limit. @@ -8,7 +10,7 @@ devel * Fix config directory handling, so we don't trap into UNC path lookups on windows * Prevent spurious log message "Scheduler queue is filled more than 50% in last x s" - from occurring when this is not the case. Due to a data race, the message could + from occurring when this is not the case. Due to a data race, the message could previously also occur if the queue was empty. * Make the scheduler enforce the configured queue lengths. The values of the options @@ -34,8 +36,8 @@ devel * Add replicationFactor, minReplicationFactor and sharding strategy to database creation dialog in web UI. Preselect database default values for collection creation in web UI. -* Add new JavaScipt function `db._properties()` and REST route GET - `/_api/database/properties` that provides information about the current database's +* Add new JavaScipt function `db._properties()` and REST route GET + `/_api/database/properties` that provides information about the current database's properties. * Add new options `sharding` and `replicationFactor` for database creation methods. The diff --git a/arangod/Cluster/ClusterMethods.cpp b/arangod/Cluster/ClusterMethods.cpp index ddf77d12ab..3b22e7f377 100644 --- a/arangod/Cluster/ClusterMethods.cpp +++ b/arangod/Cluster/ClusterMethods.cpp @@ -3526,8 +3526,7 @@ arangodb::Result hotRestoreCoordinator(ClusterFeature& feature, VPackSlice const return arangodb::Result(); } -std::vector lockPath = - std::vector{"result", "lockId"}; +std::vector lockPath = std::vector{"result", "lockId"}; arangodb::Result lockDBServerTransactions(std::string const& backupId, std::vector const& dbServers, @@ -3549,6 +3548,7 @@ arangodb::Result lockDBServerTransactions(std::string const& backupId, VPackObjectBuilder o(&lock); lock.add("id", VPackValue(backupId)); lock.add("timeout", VPackValue(lockWait)); + lock.add("unlockTimeout", VPackValue(5.0 + lockWait)); } LOG_TOPIC("707ed", DEBUG, Logger::BACKUP) @@ -3916,10 +3916,8 @@ arangodb::Result hotBackupCoordinator(ClusterFeature& feature, VPackSlice const } std::vector dbServers = ci.getCurrentDBServers(); std::vector lockedServers; - double lockWait = 2.0; + double lockWait(0.1); while (cc != nullptr && steady_clock::now() < end) { - auto iterEnd = steady_clock::now() + duration(lockWait); - result = lockDBServerTransactions(backupId, dbServers, lockWait, lockedServers); if (!result.ok()) { unlockDBServerTransactions(backupId, lockedServers); @@ -3931,12 +3929,9 @@ arangodb::Result hotBackupCoordinator(ClusterFeature& feature, VPackSlice const break; } if (lockWait < 30.0) { - lockWait *= 1.1; - } - double tmp = duration(iterEnd - steady_clock::now()).count(); - if (tmp > 0) { - std::this_thread::sleep_for(duration(tmp)); + lockWait *= 1.25; } + std::this_thread::sleep_for(seconds(1)); } bool gotLocks = result.ok();