1
0
Fork 0

Feature/dont get local system collections alltogether (#6250)

* don't need to look at local _system collections in maintenace
* Use system() API to determine if a collection is a system coll.
This commit is contained in:
Kaveh Vahedipour 2018-09-03 09:23:06 +02:00 committed by Max Neunhöffer
parent a669d5a03d
commit c7bb7a6f44
2 changed files with 11 additions and 13 deletions

View File

@ -84,11 +84,14 @@ Result getLocalCollections(VPackBuilder& collections) {
auto cols = vocbase->collections(false);
for (auto const& collection : cols) {
collections.add(VPackValue(collection->name()));
VPackObjectBuilder col(&collections);
collection->toVelocyPack(collections,true,false);
collections.add(
"theLeader", VPackValue(collection->followers()->getLeader()));
if (!collection->system()) {
std::string const colname = collection->name();
collections.add(VPackValue(colname));
VPackObjectBuilder col(&collections);
collection->toVelocyPack(collections,true,false);
collections.add(
"theLeader", VPackValue(collection->followers()->getLeader()));
}
}
} catch (std::exception const& e) {
return Result(
@ -234,7 +237,7 @@ DBServerAgencySyncResult DBServerAgencySync::execute() {
}
}
auto took = duration<double>(clock::now() - start).count();
if (took > 30.0) {
LOG_TOPIC(WARN, Logger::MAINTENANCE) << "DBServerAgencySync::execute "

View File

@ -437,10 +437,8 @@ arangodb::Result arangodb::maintenance::diffPlanLocal (
if (pdbs.hasKey(dbname)) { // if in plan
for (auto const& sh : VPackObjectIterator(db.value)) { // for each local shard
std::string shName = sh.key.copyString();
if (shName.front() != '_') { // exclude local system shards/collections
handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds,
indis, serverId, actions);
}
handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds,
indis, serverId, actions);
}
}
}
@ -805,9 +803,6 @@ arangodb::Result arangodb::maintenance::reportInCurrent(
for (auto const& shard : VPackObjectIterator(database.value)) {
auto const shName = shard.key.copyString();
if (shName.at(0) == '_') { // local system collection
continue;
}
auto const shSlice = shard.value;
auto const colName = shSlice.get(PLAN_ID).copyString();