[SERVER-20145] Handle duplicate _id's from re-inserted documents in yield_geo_near_dedup.js Created: 26/Aug/15  Updated: 19/Sep/15  Resolved: 09/Sep/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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

Sprint: Quint 9 09/18/15
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 09/Sep/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-20145 Fix yield_geo_near_dedup.js to work with re-inserted docs.
Branch: master
https://github.com/mongodb/mongo/commit/da43f0452e9f93788c19dbee4e541cfe4593628a

Generated at Thu Feb 08 03:53:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.