When running a $backupCursor aggregation against a collection, we execute this code path. This path locks the collection the aggregation was executed against and opens a storage transaction using the lock-free reads AutoGetCollection helper.
However, when running a collection-less $backupCursor aggregation, we execute this code path and we don't lock any collection. This is the documented way of opening a backup cursor.
Collection-less aggregation example:
db.aggregate([{$backupCursor: {}}]);
Aggregration against a collection example:
db.getCollection("...").aggregate([{$backupCursor: {}}]);
- is related to
-
SERVER-63050 using $backupCursor and referencing a namespace can cause invariant failure
- Closed