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

wrong update result with upsert:true

    XMLWordPrintableJSON

Details

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

    Description

      mongo1886:PRIMARY> db
      lpc
      mongo1886:PRIMARY> db.lpc.find()
      { "_id" : ObjectId("5de9c501959eef478c3a21d7"), "xid" : 1 }
      { "_id" : ObjectId("5de9c503959eef478c3a21d8"), "xid" : 2 }
      { "_id" : ObjectId("5de9c56a959eef478c3a21da"), "xid" : 3, "xxxx" : 11}
      mongo1886:PRIMARY> db.lpc.getIndexes()
      [
              {
                      "v" : 2,
                      "key" : {
                              "_id" : 1
                      },
                      "name" : "_id_",
                      "ns" : "lpc.lpc"
              },
              {
                      "v" : 2,
                      "key" : {
                              "xid" : "hashed"
                      },
                      "name" : "xid_hashed",
                      "ns" : "lpc.lpc"
              },
              {
                      "v" : 2,
                      "key" : {
                              "xid" : -1
                      },
                      "name" : "xid_-1",
                      "ns" : "lpc.lpc"
              }
      ]
      mongo1886:PRIMARY> 
      

      then i use a python script with 20 threads to update the {"xid" : 3}.  at last i get the write.

      mongo1886:PRIMARY> db.lpc.find()
      { "_id" : ObjectId("5de9c501959eef478c3a21d7"), "xid" : 1 }
      { "_id" : ObjectId("5de9c503959eef478c3a21d8"), "xid" : 2 }
      { "_id" : ObjectId("5de9c56a959eef478c3a21da"), "xid" : 3, "xxxx" : 11, "tmp_test_data" : NumberLong("46211725577525978") }
      { "_id" : ObjectId("5dea0b087cf278ae08d1ba91"), "xid" : 3, "tmp_test_data" : NumberLong("30455178109802127") }
      

      i couldn't get the in other mongod . but in this mongod .it's a really truth.

      Attachments

        Issue Links

          Activity

            People

              carl.champain@mongodb.com Carl Champain (Inactive)
              lpc FirstName lipengchong
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: