[SERVER-16905] Concurrent upserts to the same non-existing document can result in duplicate key error Created: 16/Jan/15 Updated: 14/Sep/15 Resolved: 16/Jan/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency, Write Ops |
| Affects Version/s: | 2.8.0-rc5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
2.8.0-rc5, wiredTiger storage engine only |
||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: | Run the Java code from this gist: https://gist.github.com/anonymous/5221f3025b549a708299 Expected result: One thread will "win" and be the one to insert the document. The rest will see the insert and just update the existing document. Actual result: Depending on timing, there are 0-4 exceptions thrown indicating a duplicate key error. |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
A test program that starts five threads, each repeatedly upserting a document with the same _id to a collection that doesn't initially contain a document with that _id, will encounter duplicate key errors on the first attempt from 0-4 of the five threads, depending on timing. |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 16/Jan/15 ] |
|
dup of |