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

mongoexport default to slaveOk on a sharded cluster (but should not)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.2.0-rc1
    • mongoexport
    • None
    • Server Tools A (10/09/15), Server Tools B (11/02/15)

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              gabriel.russell@mongodb.com Gabriel Russell (Inactive)
              andrew.ryder@mongodb.com Andrew Ryder (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: