Connection to MongoDB is unavailable

I have a replica set version 3.6.63 and almost every evening around 21:00 the server goes down, when I open the log file I see this message:

2023-07-30T21:06:48.847+0300 I COMMAND [conn14689698] command command: find { find: “”, filter: { ts: { $exists: true } }, sort: { $natural: 1 }, skip: 0, limit: 1, batchSize: 1, singleBatch: true, maxTimeMS: 3000, $readPreference: { mode: “secondaryPreferred” }, $db: “local” } planSummary: COLLSCAN exception: operation exceeded time limit code:ExceededTimeLimit numYields:0 reslen:246 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, oplog: { acquireCount: { r: 1 } } } protocol:op_query 3417ms

Has anyone encountered this phenomenon? Why does the system scan the file

Try setting higher timeout.

db.adminCommand( { setParameter: 1, maxTransactionLockRequestTimeoutMillis: 60000 });
Your error contains COLLSCAN, which is a collection scan, meaning the server must read all the documents in the collection to answer the query. This is typically the cause of a slow query. You can follow these guidelines to create indexes which can improve query performance.

Hope this helps!

OK. I know this well…
The question was why was LOCAL’s collection even scanned?
Is this an automatic operation?

This topic was automatically closed after 180 days. New replies are no longer allowed.