[SERVER-12523] When creating collection with autoIndexId set to false, upserts create documents with no _id Created: 29/Jan/14 Updated: 07/Mar/14 Resolved: 29/Jan/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alon Horev | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Debian running 2.4.3 |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
Once _id is missing we saw fatal assertions coming from replica set code (we tried creating the index but it complain on dup key error) and failed migration because migrated documents must contain a _id. I assume all documents in mongo must have a _id. |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 29/Jan/14 ] |
|
Yes, creating a unique index on _id, when not all your docs have unique _id will cause this. This is expected and correct behavior wrt replication – btw, it didn't crash but simply shutdown due to an unrecoverable error during replication. The underlying issue will be resolved in the next stable release, but for now you can assign an _id to all your docs before creating the unique _id index. |
| Comment by Alon Horev [ 29/Jan/14 ] |
|
here's the shard crashing (I redacted some sensitive information): Wed Jan 29 12:06:13.278 [repl writer worker 2] ERROR: writer worker caught exception: E11000 duplicat } ***aborting after fassert() failure Wed Jan 29 12:06:13.319 Got signal: 6 (Aborted). Wed Jan 29 12:06:13.323 Backtrace: |
| Comment by Scott Hernandez (Inactive) [ 29/Jan/14 ] |
|
Can you post the logs from the server with the replication failures please? I believe this is a duplicate of something we have fixed for newer versions already: |