[SERVER-3330] Sporadically missing data from a query Created: 24/Jun/11 Updated: 29/Aug/11 Resolved: 27/Jun/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Michael D. Norman | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Driver: Java 2.6.3 CentOS release 5.6 |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
The behavior we are seeing I can reproduce the issue in the shell as well, though not as easily. I turned on profiling logs and here { "ts" : ISODate("2011-06-24T02:31:23.438Z"), "info" : "query , deployments: { $elemMatch: , } ] } } }, orderby: { _id: 1 }} nreturned:523 bytes:619904", "millis" : 17 } { "ts" : ISODate("2011-06-24T02:31:23.924Z"), "info" : "query , deployments: { $elemMatch: , } ] } } }, orderby: { _id: 1 }} nreturned:522 bytes:618717", "millis" : 19 } { "ts" : ISODate("2011-06-24T02:31:24.354Z"), "info" : "query , deployments: { $elemMatch: , } ] } } }, orderby: { _id: 1 }} nreturned:523 bytes:619904", "millis" : 19 } |
| Comments |
| Comment by Michael D. Norman [ 27/Jun/11 ] |
|
I was finally able to reproduce the issue locally and I have found the root cause: we were updating the data for an item in an array by removing the item and inserting a new one in its place. Because that cannot be done atomically, queries were coming into the middle of this operation. In all of my repro scenarios, I was never touching the code that did these updates because they were supposedly rarer than they are. |
| Comment by Michael D. Norman [ 26/Jun/11 ] |
|
I have been doing more testing, and I'm unable to reproduce this on the same server with a new mongo instance. Therefore, I think the hardware is not necessarily the culprit, and I have a feeling that I just can't reproduce the results while generating similar writes and reads. It appears that the data changes in production are causing the issue, but the root cause is still unknown, especially since a snapshot query is supposed to fix this type of issue. |
| Comment by Michael D. Norman [ 24/Jun/11 ] |
|
I started this as a thread at http://groups.google.com/group/mongodb-user/browse_thread/thread/bd2d02f9f2129365# |