Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-76

mongoimport should default to w:majority

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc0
    • 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.

            Assignee:
            adinoyi.omuya@mongodb.com Adinoyi Omuya
            Reporter:
            ian@mongodb.com Ian Whalen (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: