[SERVER-16965] Missing _id index message after dropping and re-creating _id index Created: 21/Jan/15 Updated: 23/Feb/15 Resolved: 23/Feb/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 2.6.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Elad Moshe | Assignee: | Ramon Fernandez Marina |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | 1. Create a collection with some data on a single instance deployment |
| Participants: |
| Description |
|
I have some collection that is only used for archiving (no reads). I have removed the _id index at some point (I think it was still in ver 2.4).
I created an index, but the warning still appears:
|
| Comments |
| Comment by Elad Moshe [ 22/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you milkie, restarting the server indeed made the warning to disappear. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 22/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Elad. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elad Moshe [ 22/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried to create the collection again and got the same results. Attached is the log, although I don't see anything interesting here...
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
emoshe, I'm not able to reproduce the behavior you describe, so I think I'll need more details on how you arrived to this situation (and the logs of course). This is what I tried:
In other words, the secondary automatically creates the missing {_id: 1} index. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you please upload the logs of the primary and secondaries involved from the time you created a new collection until now? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elad Moshe [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried creating a new collection and copy all the data to that collection, then rename the new collection with dropTarget:true, but the warning does not disappear:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elad Moshe [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think that while creating the collection I used the autoIndexId:false flag of db.createCollection(). Then, when moving to the replica set I created the _id index manually with background:true. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elad Moshe [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I started using Mongo version 2.4.x. Since it was quite time ago, unfortunately I no longer have those logs. I don't recall anything special I did to remove that index (although I am unable to remove the _id index now). | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 21/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The _id index is not expected to be a background index, so I think that's the issue here. I tried removing the _id index with various 2.4 and 2.2 versions, unsuccessfully, so I think at this stage you may need to dump/export and restore/import your data. Also, are you sure you're upgrading from 2.4? I'm asking because one can't upgrade from older versions directly into 2.6. For example, if you're running 2.0 you must go through 2.2 and 2.4 before getting to 2.6. Do you know what version you were running before? Can you please check the logs and find out? |