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

write conflict on single-update isn't being retried

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 2.8.0-rc0
    • None
    • Storage
    • ALL
    • Hide

      repro script / jstest that runs two threads that update the same document:

      load('jstests/libs/parallelTester.js');
       
      db.foo.drop();
      db.foo.insert({});
      assert.eq(1, db.foo.count());
       
      var t0 = new ScopedThread(function() {
          for (var i=0; i<100; ++i) {
              var res = db.foo.update({}, { $inc: { x: 1 } });
              assert.eq(1, res.nModified, res);
          }
          return 'ok';
      });
       
       
      t0.start();
       
      for (var i=0; i<100; ++i) {
          var res = db.foo.update({}, { $inc: { y: 1 } });
          assert.eq(1, res.nModified, res);
      }
       
      t0.join();

      Show
      repro script / jstest that runs two threads that update the same document: load('jstests/libs/parallelTester.js');   db.foo.drop(); db.foo.insert({}); assert.eq(1, db.foo.count());   var t0 = new ScopedThread(function() { for (var i=0; i<100; ++i) { var res = db.foo.update({}, { $inc: { x: 1 } }); assert.eq(1, res.nModified, res); } return 'ok'; });     t0.start();   for (var i=0; i<100; ++i) { var res = db.foo.update({}, { $inc: { y: 1 } }); assert.eq(1, res.nModified, res); }   t0.join();

    Description

      When using WiredTiger, if a WriteConflictException happens with a single update, the operation returns nModified: 0 to the client, and the document is not updated.

      Attachments

        Issue Links

          Activity

            People

              kaloian.manassiev@mongodb.com Kaloian Manassiev
              david.percy@mongodb.com David Percy
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: