-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: mongoimport
-
None
-
Completed
data in a replica set is only cluster-wide committed when it reaches a majority of the set. thus, it would be good if mongoimport defaults to w:majority.
this should be done intelligently to avoid slowness. for example on an unsharded collection, getLastError w:majority could be done every 1000th write and at the end (at a minimum, the latter). on a sharded collection, it is trickier to make fast and guarantee all writes are to a majority; that said, this would be better than the current behavior regardless.
note that this would also if done not just at the end but every Nth write (e.g. N=1000) create flow-control to the secondaries : if the secondaries are slower than the primaries, the import won't overrun the oplog to the point they are out of sync.
Perhaps there is already a similar ticket the main point here is that the default should change.