Migrate error in mongodb cluster

An error appears in the mongod log:

mongod: {“t”:{“$date”:“2025-03-17T08:42:04.046+00:00”},“s”:“I”, “c”:“MIGRATE”, “id”:21998, “ctx”:“migrateThread”,“msg”:“Error during migration”,“attr”:{“error”:“ExceededTimeLimit: Failed to delete orphaned database.collection range [{ _id: ObjectId(‘ObjectID1’), user: ObjectId(‘ObjectID2’) }, { _id: ObjectId(‘ObjectID3’), user: ObjectId(‘ObjectID2’) }) :: caused by :: operation exceeded time limit”}}

Can someone provide some explanation or guidance what can cause this problem?

i got a same error but i aslo dont konw resolve :sweat_smile:

The severity in “Information”, did you encounter any problems? Maybe, the database just repeats the operation and everything will be fine.

This message keeps recurring every day.
Mby there is a way to set higher time limit?

Hi @Mait_S There is no direct way to increase the time limit for orphaned range deletion during migration. There are multiple reasons behind this. This problem can be caused by a large number of orphaned documents that need to be deleted, which may result in timeouts, especially on busy or resource-constrained servers. Slow disk performance or I/O bottlenecks can also contribute, as deleting many documents or scanning large collections takes significant time. Additionally, high server load, heavy write operations, or other ongoing migrations can slow down the orphan cleanup process. Finally, if certain shards are overloaded or have an imbalance of data, range deletions during migrations can become even slower and more prone to timing out.

As Wernfried mentioned above, this is informational error and won’t have any severe impact. MongoDB will often retry and eventually clear up orphans on the next migration or cleanup pass. if it occurring very frequent, you can focus on operational optimizations (I/O, indexing, balancing) and monitor the balancer and migration logs for persistent issues if any.
Hope this helps!