Skip to content

Commit

Permalink
Skip system collections in getBucketInfos
Browse files Browse the repository at this point in the history
Issue: ARSN-447
  • Loading branch information
francoisferrand committed Nov 26, 2024
1 parent 6a33bcc commit 5612a8d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/storage/metadata/mongoclient/MongoClientInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -2106,6 +2106,14 @@ class MongoClientInterface {
name.startsWith('__');
}

/*
* return true if it a system collection, reserved by Mongo for internal use: and which should
* not be used.
*/
_isSystemCollection(name) {
return name.startsWith('system.');
}

/*
* get bucket related information for count items, used by cloudserver
* and s3utils
Expand All @@ -2116,7 +2124,7 @@ class MongoClientInterface {

this.db.listCollections({ type: 'collection' }).toArray().then(collInfos =>
async.eachLimit(collInfos, 10, (value, next) => {
if (this._isSpecialCollection(value.name)) {
if (this._isSystemCollection(value.name) || this._isSpecialCollection(value.name)) {
// skip
return next();
}
Expand Down

0 comments on commit 5612a8d

Please sign in to comment.