1
0
Fork 0

fix restoring of smart graph edge collections so it does not time out (#5048)

This commit is contained in:
Jan 2018-04-06 14:15:29 +02:00 committed by GitHub
parent ae0b99de63
commit b96250b57a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,8 @@
v3.3.6 (XXXX-XX-XX)
-------------------
* fix restoring of smart graph edge collections (may have run into timeout before)
* added ArangoShell helper function for packaging all information about an
AQL query so it can be run and analyzed elsewhere:

View File

@ -1145,7 +1145,7 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName,
std::string const name =
arangodb::basics::VelocyPackHelper::getStringValue(json, "name", "");
{
// check if a collection with the same name is already planned
loadPlan();
@ -1260,7 +1260,7 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName,
}
return true;
};
// ATTENTION: The following callback calls the above closure in a
// different thread. Nevertheless, the closure accesses some of our
// local variables. Therefore we have to protect all accesses to them
@ -1350,8 +1350,14 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName,
// Update our cache:
loadPlan();
}
bool isSmart = false;
VPackSlice smartSlice = json.get("isSmart");
if (smartSlice.isBool() && smartSlice.getBool()) {
isSmart = true;
}
if (numberOfShards == 0) {
if (numberOfShards == 0 || isSmart) {
loadCurrent();
events::CreateCollection(name, TRI_ERROR_NO_ERROR);
return TRI_ERROR_NO_ERROR;