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

Assertion failure updating two fields atomically

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.3.1
    • 1.3.2
    • Write Ops
    • None
    • Linux x64, Mac OS x64

    Description

      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 }

      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: