mirror of https://gitee.com/bigwinds/arangodb
corrected hot backup lock timings (#10076)
* corrected hot backup lock timings * the lock timeout added to overall unlock timeout]
This commit is contained in:
parent
2e293b85ca
commit
bbe7d424d5
|
@ -1,6 +1,8 @@
|
||||||
devel
|
devel
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
* DB server locking / unlocking for hot backup revisited and enhanced
|
||||||
|
|
||||||
* Re-enabled the AQL sort-limit optimization rule in conjunction with fullCount
|
* 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
|
in the cluster. It now also may speed up fullCount with sorted indexes and a
|
||||||
limit.
|
limit.
|
||||||
|
|
|
@ -3526,8 +3526,7 @@ arangodb::Result hotRestoreCoordinator(ClusterFeature& feature, VPackSlice const
|
||||||
return arangodb::Result();
|
return arangodb::Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> lockPath =
|
std::vector<std::string> lockPath = std::vector<std::string>{"result", "lockId"};
|
||||||
std::vector<std::string>{"result", "lockId"};
|
|
||||||
|
|
||||||
arangodb::Result lockDBServerTransactions(std::string const& backupId,
|
arangodb::Result lockDBServerTransactions(std::string const& backupId,
|
||||||
std::vector<ServerID> const& dbServers,
|
std::vector<ServerID> const& dbServers,
|
||||||
|
@ -3549,6 +3548,7 @@ arangodb::Result lockDBServerTransactions(std::string const& backupId,
|
||||||
VPackObjectBuilder o(&lock);
|
VPackObjectBuilder o(&lock);
|
||||||
lock.add("id", VPackValue(backupId));
|
lock.add("id", VPackValue(backupId));
|
||||||
lock.add("timeout", VPackValue(lockWait));
|
lock.add("timeout", VPackValue(lockWait));
|
||||||
|
lock.add("unlockTimeout", VPackValue(5.0 + lockWait));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_TOPIC("707ed", DEBUG, Logger::BACKUP)
|
LOG_TOPIC("707ed", DEBUG, Logger::BACKUP)
|
||||||
|
@ -3916,10 +3916,8 @@ arangodb::Result hotBackupCoordinator(ClusterFeature& feature, VPackSlice const
|
||||||
}
|
}
|
||||||
std::vector<ServerID> dbServers = ci.getCurrentDBServers();
|
std::vector<ServerID> dbServers = ci.getCurrentDBServers();
|
||||||
std::vector<ServerID> lockedServers;
|
std::vector<ServerID> lockedServers;
|
||||||
double lockWait = 2.0;
|
double lockWait(0.1);
|
||||||
while (cc != nullptr && steady_clock::now() < end) {
|
while (cc != nullptr && steady_clock::now() < end) {
|
||||||
auto iterEnd = steady_clock::now() + duration<double>(lockWait);
|
|
||||||
|
|
||||||
result = lockDBServerTransactions(backupId, dbServers, lockWait, lockedServers);
|
result = lockDBServerTransactions(backupId, dbServers, lockWait, lockedServers);
|
||||||
if (!result.ok()) {
|
if (!result.ok()) {
|
||||||
unlockDBServerTransactions(backupId, lockedServers);
|
unlockDBServerTransactions(backupId, lockedServers);
|
||||||
|
@ -3931,12 +3929,9 @@ arangodb::Result hotBackupCoordinator(ClusterFeature& feature, VPackSlice const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lockWait < 30.0) {
|
if (lockWait < 30.0) {
|
||||||
lockWait *= 1.1;
|
lockWait *= 1.25;
|
||||||
}
|
|
||||||
double tmp = duration<double>(iterEnd - steady_clock::now()).count();
|
|
||||||
if (tmp > 0) {
|
|
||||||
std::this_thread::sleep_for(duration<double>(tmp));
|
|
||||||
}
|
}
|
||||||
|
std::this_thread::sleep_for(seconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gotLocks = result.ok();
|
bool gotLocks = result.ok();
|
||||||
|
|
Loading…
Reference in New Issue