-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: mongoexport
-
None
-
Server Tools A (10/09/15), Server Tools B (11/02/15)
From the help on mongoexport:
-k [ --slaveOk ] arg (=1) use secondaries for export if available, default true
On a sharded cluster this can lead to tragedy:
- It would be possible for the same document to appear twice (repeated _id) or even many times (orphans) which could break a subsequent import.
- Some documents can be missing entirely, even ones that have been present for years and never modified (an in-progress migration can cause this).
The default should not allow reading from secondaries. If we are concerned about a change in behavior without notice then make the -k parameter required when connected to a mongos (as opposed to optional).
It is better to fail totally and noisily than to fail partially but silently.