Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-32865

Dropped write during insert loop with retry_writes on

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • None
    • Shell
    • None
    • ALL
    • Hide

      1. Start a MongoDB 3.6.2 replica set with FCV 3.6
      2. Start a loop in the mongo shell to insert 10,000 documents with retry_writes set to true:

      use test
      db = db.getMongo().startSession({retry_writes: true}).getDatabase(db.getName());
      for (i = 0; i < 10000; i++) { db.test.insert({}); }
      

      3. While the inserts are happening issue an rs.stepDown() command on the primary
      4. The insert loop will eventually finish but db.test.count() will indicate that only 9,999 documents have been inserted.

      Show
      1. Start a MongoDB 3.6.2 replica set with FCV 3.6 2. Start a loop in the mongo shell to insert 10,000 documents with retry_writes set to true: use test db = db.getMongo().startSession({retry_writes: true}).getDatabase(db.getName()); for (i = 0; i < 10000; i++) { db.test.insert({}); } 3. While the inserts are happening issue an rs.stepDown() command on the primary 4. The insert loop will eventually finish but db.test.count() will indicate that only 9,999 documents have been inserted.

    Description

      max.hirschhorn suggested I file this ticket.

      If I start a an insert loop that attempts to insert 10,000 documents with retry_writes on and then step down the primary only 9,999 documents are inserted.

      MongoDB is running with FCV 3.6.

      Attachments

        1. new-primary.log
          22 kB
        2. old-primary.log
          28 kB

        Activity

          People

            max.hirschhorn@mongodb.com Max Hirschhorn
            tim.olsen@mongodb.com Timothy Olsen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: