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

Handle duplicate _id's from re-inserted documents in yield_geo_near_dedup.js

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • Affects Version/s: 3.1.7
    • Component/s: Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • Hide

      Running the yield_geo_near_dedup.js workload with 10 threads for 50,000 iterations causes this failure pretty reliably.

      Show
      Running the yield_geo_near_dedup.js workload with 10 threads for 50,000 iterations causes this failure pretty reliably.
    • Quint 9 09/18/15
    • 0
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      The yield_geo_near_dedup.js test extends the yield_geo_near.js workload, which extends the yield.js workload. The yield.js workload defines a remove state function that will randomly delete a document by its _id and then re-insert the same document.

      /*
       * Remove a random document from the collection, then re-insert one to prevent losing
       * documents.
       */
      remove: function remove(db, collName) {
          var id = Random.randInt(this.nDocs);
          var doc = db[collName].findOne({ _id: id });
          if (doc !== null) {
              var res = db[collName].remove({ _id: id });
              assertAlways.writeOK(res);
              if (res.nRemoved > 0) {
                  assertAlways.writeOK(db[collName].insert(doc));
              }
          }
      },
      

      Proposal is to re-insert the document with another field (e.g. num) modified. Then, rather than asserting that there should be no duplicate _id values, we should assert that the pair (_id, num) is distinct. This seems better than removing the remove state function from the yield_geo_near_dedup.js workload so that we still have coverage of geoNear when there are concurrent remove operations.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: