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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc1
    • Component/s: mongoexport
    • Labels:
      None
    • Sprint:
      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

              • Assignee:
                gabriel.russell Gabriel Russell
                Reporter:
                andrew.ryder Andrew Ryder
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: