1
0
Fork 0

if collection is gone in meantine ... (#9331)

This commit is contained in:
Kaveh Vahedipour 2019-06-26 15:11:40 +02:00 committed by Max Neunhöffer
parent 7d822355b3
commit b97a62c0de
1 changed files with 5 additions and 0 deletions

View File

@ -2873,6 +2873,11 @@ int ClusterInfo::ensureIndexCoordinatorInner(std::string const& databaseName,
// Finally check if it has appeared, if not, we take another turn,
// which does not do any harm:
auto coll = getCollection(databaseName, collectionID);
if (coll == nullptr) {
errorMsg = "The collection has gone. Aborting index creation";
return TRI_ERROR_ARANGO_INDEX_CREATION_FAILED;
}
auto indexes = coll->getIndexes();
if (std::any_of(indexes.begin(), indexes.end(),
[indexId](std::shared_ptr<arangodb::Index>& index) -> bool {