Skip to content

Commit

Permalink
Merge pull request #489 from scality/bf/ZENKO-343-dontFilterInternalM…
Browse files Browse the repository at this point in the history
…ongoNs

bf: ZENKO-343 remove regexp-based 'ns' filtering
  • Loading branch information
rahulreddy authored May 11, 2018
2 parents 1425f03 + de7ebf7 commit e7862d3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/storage/metadata/mongoclient/LogConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ class LogConsumer {
* @param {string} logger - logger
*/
constructor(mongoConfig, logger) {
const { replicaSetHosts, database } = mongoConfig;
const { replicaSetHosts } = mongoConfig;
// 'local' is the database where MongoDB has oplogs.rs capped collection
this.database = 'local';
this.mongoUrl = `mongodb://${replicaSetHosts}/local`;
this.logger = logger;
this.metadataDatabase = database;
}

/**
Expand Down Expand Up @@ -155,12 +154,8 @@ class LogConsumer {
const lastEndID = startIDandSeq[1];
const recordStream = new ListRecordStream(this.logger, lastEndID);

const db = this.metadataDatabase;
const ns = new RegExp(`^(?!.*${db}.*(?:__)).*${db}\\.\\w+.*`);

this.coll = this.db.collection('oplog.rs');
return this.coll.find({
ns,
ts: { $gte: Timestamp.fromNumber(startSeq) },
}, {
limit,
Expand Down

0 comments on commit e7862d3

Please sign in to comment.