1
0
Fork 0

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

This commit is contained in:
Jan 2018-04-06 14:14:52 +02:00 committed by GitHub
parent f4fa677b91
commit a2f8077cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -1339,7 +1339,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();
@ -1454,7 +1454,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
@ -1546,8 +1546,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;