mirror of https://gitee.com/bigwinds/arangodb
fix restoring of smart graph edge collections so it does not time out (#5049)
This commit is contained in:
parent
f4fa677b91
commit
a2f8077cd4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue