Hi Team,
Recently we migrated from 2.6 to 3.6, Storage engine is still MMAVP1.
But our code is extremely slow to read data/transactions from “oplog” [ oplog size - 50 GB ]. Queries were taking more than 90 minutes to give an output.
After migration, Please let us know if any additional steps to be implemented regarding oplog configuration.
Below is the snapshot of code for reading the “oplog”. The test instance where we directly installed 3.6, the same code works without any lag.
Please let us know if there is any suggestion which need to be implemented on Mongo for improving the performance of reading the “oplog”.
private void readOplog() {
Publisher<Document> pubDoc = null;
MongoDBOperationsSubscriber<Document> sub = null;
Document filter = new Document();
filter.put("ns", namespace);
pubDoc = fromCollection.find(clientSession, filter);
sub = new MongoDBOperationsSubscriber<Document>();
pubDoc.subscribe(sub);
try {
sub.await();
sub.onComplete();
} catch (Throwable e) {
System.out.println(
"Read from Start, Error occurred while subscriber is in wait for messages from MongoDB publisher."
+ e);
}
fetchedOplogDocs = sub.getData();
System.out.println("Total documents fetched so far are [ "+ fetchedOplogDocs.size() +" ].");
}