-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongoexport
-
(copied to CRM)
The snapshot query option was deprecated in 3.6.1.
Still, latest mongoexport 4.1.2 uses snapshot option by default, unless --forceTableScan is specified.
// don't snapshot if we've been asked not to, // or if we cannot because we are querying, sorting, or if the collection is a view if !exp.InputOpts.ForceTableScan && len(query) == 0 && exp.InputOpts != nil && exp.InputOpts.Sort == "" && !collInfo.IsView() && !collInfo.IsSystemCollection() { flags = flags | db.Snapshot }
This behavior makes MongoDB to log a warning message once per 128 events:
if (query.getQueryRequest().isSnapshot()) { RARELY { warning() << "The snapshot option is deprecated. See " "http://dochub.mongodb.org/core/snapshot-deprecation"; }
Since the option is deprecated, mongoexport should use the the workarounds available:
- For MMAPv1, use hint() on the
{ _id: 1}
index instead to prevent a cursor from returning a document more than once if an intervening write operation results in a move of the document.
- For other storage engines, use hint() with
{ $natural : 1 }
instead.
- duplicates
-
TOOLS-1952 Use --forceTableScan by default when running against WiredTiger nodes
- Closed
- related to
-
TOOLS-1972 Hint the _id index instead of using $snapshot query option
- Closed