[SERVER-19687] immediate collection count doesn't get correct result if new document is inserted Created: 31/Jul/15 Updated: 13/Aug/15 Resolved: 13/Aug/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Write Ops |
| Affects Version/s: | 3.0.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Morgan Cheng | Assignee: | Ramon Fernandez Marina |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL | |||
| Steps To Reproduce: | These steps are not guaranteed to reproduce this bug. 1) create a collection with a lot of documents named test;
3) make sure the index built is done; 4) insert one more document
5) immediately count documents by
Expected result: Actual result: |
|||
| Participants: |
| Description |
|
It is hard to reproduce, but I have this issue identified multiple times in production environment. One operation insert a document into a collection host in only one mongod with write concern 1. After got the write success response, a count with condition is issued to the same mongod. Surely, the count response should include the newly-inserted document. However, sometimes it just doesn't have the new document counted. Just my guessing: If the indexing of the count condition is performed in background, there is possibility that collection indexing is not updated when insert operation returns OK even with write concern 1. If count operation depends on the index, then a immediate count operation could return result without the newly-inserted document counted. |
| Comments |
| Comment by Ramon Fernandez Marina [ 13/Aug/15 ] | |||||||
|
morgan.chengmo@gmail.com, we tried my repro above again using save() and with some other variations, but we were still unable to reproduce the behavior you describe so I'm going to close this ticket. If there's some more details you can provide about how your application works and triggers this behavior feel free to post it here so we can investigate further. Regards, | |||||||
| Comment by Ramon Fernandez Marina [ 06/Aug/15 ] | |||||||
|
Hi morgan.chengmo@gmail.com, I tried the following to reproduce:
but no luck. What storage engine are you using? What kind of deployment are you running, stand-alone, replicated, sharded? Are there any other details you can provide that may help us reproduce the behavior you describe? Thanks, | |||||||
| Comment by Morgan Cheng [ 31/Jul/15 ] | |||||||
|
Damn, the default action of Enter keypress in this JIRA instance is really annoying. It takes me three times to finally post a whole bug. |