Hi,
In MongoDB 4.2 release notes, I see below lines which states that mongodump is not reliable for backup as atomicity cannot be guaranteed. Will acquiring lock using fsyncLock before backup help here?
mongodump and mongorestore cannot be part of a backup strategy for 4.2+ sharded clusters that have sharded transactions in progress, as backups created with mongodump do not maintain the atomicity guarantees of transactions across shards.
For 4.2+ sharded clusters with in-progress sharded transactions, use one of the following coordinated backup and restore processes which do maintain the atomicity guarantees of transactions across shards: