[SERVER-31999] Race condition in awaitdata_getmore_cmd.js Created: 16/Nov/17  Updated: 30/Oct/23  Resolved: 09/Mar/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.6.0-rc4
Fix Version/s: 3.6.4, 3.7.3

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Query 2018-03-12, Query 2018-03-26
Participants:
Linked BF Score: 0

 Description   

awaitdata_getmore_cmd.js can encounter an assert.soon() failure in the following code if the time it takes to start the parallelShell exceeds the 4 second maxTimeMS set on the awaitData getMore:

139
// getMore should time out if we insert a non-matching document.
140
let insertshell = startParallelShell(function() {
141
    assert.soon(function() {
142
        return db.currentOp({op: "getmore", "command.collection": "await_data"})
143
                   .inprog.length == 1;
144
    });
145
    assert.writeOK(db.await_data.insert({x: 0}));
146
}, mongo.port);
147
 
148
now = new Date();
149
cmdRes = db.runCommand({getMore: cmdRes.cursor.id, collection: collName, maxTimeMS: 4000});
150
assert.commandWorked(cmdRes);
151
assert.gt(cmdRes.cursor.id, NumberLong(0));
152
assert.eq(cmdRes.cursor.ns, coll.getFullName());
153
assert.eq(cmdRes.cursor.nextBatch.length, 0);
154
assert.gte((new Date()) - now,
155
           // SERVER-31502 Add some leniency here since our server-side wait may be woken up
156
           // spuriously.
157
           3900,
158
           "Insert not matching filter caused awaitData getMore to return prematurely.");
159
insertshell();



 Comments   
Comment by Githook User [ 09/Mar/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-31999: Race condition in awaitdata_getmore_cmd.js

(cherry picked from commit dbfc1e30a2e06732c5cd3d20aabfff67737f3521)
Branch: v3.6
https://github.com/mongodb/mongo/commit/01a9daf7da1ff177b4c621a83c8d3970dc4cd1bc

Comment by Githook User [ 09/Mar/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-31999: Race condition in awaitdata_getmore_cmd.js
Branch: master
https://github.com/mongodb/mongo/commit/dbfc1e30a2e06732c5cd3d20aabfff67737f3521

Comment by David Storch [ 02/Mar/18 ]

bernard.gorman, I'm also assigning you the backport of this fix to 3.6, as nicholas.zolnierz says this has been causing build failures there as well.

Comment by Charlie Swanson [ 01/Mar/18 ]

Assigning to Bernard for BF Friday tomorrow.

Comment by Ian Whalen (Inactive) [ 23/Feb/18 ]

Putting this into the next sprint to do on BF Friday.

Comment by Nicholas Zolnierz [ 16/Feb/18 ]

Throwing this back into NT because it's reproduced twice since first being reported.

Generated at Thu Feb 08 04:28:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.