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

Assertion failure updating two fields atomically

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.2
    • Affects Version/s: 1.3.1
    • Component/s: Write Ops
    • None
    • Environment:
      Linux x64, Mac OS x64

      The following atomic update works on 1.3.0, but doesn't on 1.3.1.

      1.3.0
      > db.userdb.find()
      > db.userdb.update(

      { "l" : 123 }

      , { $set : { "v" :

      { "i" : 123, "a":456 }

      }, $push :

      { "f" : 234}

      }, 1, 0 );
      > db.userdb.update(

      { "l" : 123 }

      , { $set : { "v" :

      { "i" : 123, "a":456 }

      }, $push :

      { "f" : 234}

      }, 1, 0 );
      > db.userdb.find()
      { "_id" : ObjectId("4b5df3d9b93fbafb88ecc49e"), "f" : [ 234, 234 ], "l" : 123, "v" :

      { "i" : 123, "a" : 456 }

      }

      1.3.1
      > db.userdb.find()
      > db.userdb.update(

      { "l" : 123 }

      , { $set : { "v" :

      { "i" : 123, "a":456 }

      }, $push :

      { "f" : 234}

      }, 1, 0 );
      > db.userdb.update(

      { "l" : 123 }

      , { $set : { "v" :

      { "i" : 123, "a":456 }

      }, $push :

      { "f" : 234}

      }, 1, 0 );
      can't apply mod in place - shouldn't have gotten here
      > db.userdb.find()
      { "_id" : ObjectId("4b5df40fe57102386957a5ed"), "f" : [ 234 ], "l" : 123, "v" :

      { "i" : 123, "a" : 456 }

      }

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            kleinsch Nick Kleinschmidt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: