mirror of https://gitee.com/bigwinds/arangodb
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:
parent
a669d5a03d
commit
c7bb7a6f44
|
@ -84,12 +84,15 @@ Result getLocalCollections(VPackBuilder& collections) {
|
||||||
auto cols = vocbase->collections(false);
|
auto cols = vocbase->collections(false);
|
||||||
|
|
||||||
for (auto const& collection : cols) {
|
for (auto const& collection : cols) {
|
||||||
collections.add(VPackValue(collection->name()));
|
if (!collection->system()) {
|
||||||
|
std::string const colname = collection->name();
|
||||||
|
collections.add(VPackValue(colname));
|
||||||
VPackObjectBuilder col(&collections);
|
VPackObjectBuilder col(&collections);
|
||||||
collection->toVelocyPack(collections,true,false);
|
collection->toVelocyPack(collections,true,false);
|
||||||
collections.add(
|
collections.add(
|
||||||
"theLeader", VPackValue(collection->followers()->getLeader()));
|
"theLeader", VPackValue(collection->followers()->getLeader()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (std::exception const& e) {
|
} catch (std::exception const& e) {
|
||||||
return Result(
|
return Result(
|
||||||
TRI_ERROR_INTERNAL,
|
TRI_ERROR_INTERNAL,
|
||||||
|
|
|
@ -437,13 +437,11 @@ arangodb::Result arangodb::maintenance::diffPlanLocal (
|
||||||
if (pdbs.hasKey(dbname)) { // if in plan
|
if (pdbs.hasKey(dbname)) { // if in plan
|
||||||
for (auto const& sh : VPackObjectIterator(db.value)) { // for each local shard
|
for (auto const& sh : VPackObjectIterator(db.value)) { // for each local shard
|
||||||
std::string shName = sh.key.copyString();
|
std::string shName = sh.key.copyString();
|
||||||
if (shName.front() != '_') { // exclude local system shards/collections
|
|
||||||
handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds,
|
handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds,
|
||||||
indis, serverId, actions);
|
indis, serverId, actions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -805,9 +803,6 @@ arangodb::Result arangodb::maintenance::reportInCurrent(
|
||||||
for (auto const& shard : VPackObjectIterator(database.value)) {
|
for (auto const& shard : VPackObjectIterator(database.value)) {
|
||||||
|
|
||||||
auto const shName = shard.key.copyString();
|
auto const shName = shard.key.copyString();
|
||||||
if (shName.at(0) == '_') { // local system collection
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto const shSlice = shard.value;
|
auto const shSlice = shard.value;
|
||||||
auto const colName = shSlice.get(PLAN_ID).copyString();
|
auto const colName = shSlice.get(PLAN_ID).copyString();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue