[SERVER-2660] $atomic update may yield before any writes and possibly between $or clauses Created: 01/Mar/11  Updated: 07/Mar/14  Resolved: 28/Nov/12

Status: Closed
Project: Core Server
Component/s: Concurrency, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

In an update operation, each time we have a chance to select indexes we pick the index that produces the first match. When we are doing this index selection, we currently may yield even if $atomic has been set for the update operation. This yield can occur before any writes take place, and potentially between $or clauses.



 Comments   
Comment by Aaron Staple [ 22/Aug/11 ]

Same issue with atomic delete I think.

Comment by Aaron Staple [ 01/Mar/11 ]

This resulted in a failure of the update_yield1 test

Sun Feb 27 09:01:41 [conn3] query admin.$cmd ntoreturn:1 command:

{ listDatabases: 1 }

reslen:301 10906ms
Sun Feb 27 09:01:41 [conn34] update test.update_yield1 query:

{ $atomic: true }

13321ms
assert: [[ ]] != [[
{
"opid" : 13193985,
"active" : true,
"lockType" : "write",
"waitingForLock" : false,
"secs_running" : 13,
"op" : "update",
"ns" : "test.update_yield1",
"query" :

{ "$atomic" : true }

,
"client" : "127.0.0.1:39805",
"desc" : "conn"
}
]] are not equal : should have been atomic
Error("Printing Stack Trace")@:0
()@shell/utils.js:21
("[[ ]] != [[\n\t{\n\t\t\"opid\" : 13193985,\n\t\t\"active\" : true,\n\t\t\"lockType\" : \"write\",\n\t\t\"waitingForLock\" : false,\n\t\t\"secs_running\" : 13,\n\t\t\"op\" : \"update\",\n\t\t\"ns\" : \"test.update_yield1\",\n\t\t\"query\" :

{\n\t\t\t\"$atomic\" : true\n\t\t}

,\n\t\t\"client\" : \"127.0.0.1:39805\",\n\t\t\"desc\" : \"conn\"\n\t}\n]] are not equal : should have been atomic")@shell/utils.js:32
([object Array],[object Array],"should have been atomic")@shell/utils.js:60
@/mnt/data/slaves/Linux_64bit_Legacy_Weekly_Slow_Tests/mongo/jstests/slowWeekly/update_yield1.js:79

Sun Feb 27 09:01:41 uncaught exception: [[ ]] != [[
{
"opid" : 13193985,
"active" : true,
"lockType" : "write",
"waitingForLock" : false,
"secs_running" : 13,
"op" : "update",
"ns" : "test.update_yield1",
"query" :

{ "$atomic" : true }

,
"client" : "127.0.0.1:39805",
"desc" : "conn"
}
]] are not equal : should have been atomic
failed to load: /mnt/data/slaves/Linux_64bit_Legacy_Weekly_Slow_Tests/mongo/jstests/slowWeekly/update_yield1.js
sh12961| null
Sun Feb 27 09:01:41 [conn34] end connection 127.0.0.1:39805
Sun Feb 27 09:01:42 [conn32] end connection 127.0.0.1:44557
Sun Feb 27 09:01:42 got kill or ctrl c or hup signal 15 (Terminated), will terminate after current cmd ends
Sun Feb 27 09:01:42 [interruptThread] now exiting
Sun Feb 27 09:01:42 dbexit:

<http://buildbot.mongodb.org/builders/Linux%2064-bit%20Legacy%20Weekly%20Slow%20Tests/builds/35/steps/test/logs/stdio>

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