[SERVER-14999] db.system.indexes.dropIndexes() crashes mongod Created: 22/Aug/14 Updated: 16/Nov/21 Resolved: 03/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | 2.6.1, 2.6.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steffen | Assignee: | Charlie Swanson |
| Resolution: | Won't Fix | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
Somehow we created by accident an index in "system.indexes"
To get rid of this index we try to drop it via dropIndex or remove. Both don't work. So we used db.system.indexes.dropIndexes() to get rid of it. This crashes mongod.
|
| Comments |
| Comment by Charlie Swanson [ 03/Feb/16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
It turns out this issue can still affect 2.4 mongods. If you created an index on the system.indexes collection in 2.4, you should follow the steps described in this comment to drop it. Do not try to drop it after upgrading. We do not plan to take any action to fix this issue on versions newer than 2.4, as they already prevent you from creating indexes on the system.indexes collection. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 02/Feb/16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm closing this ticket as "Gone away", since I cannot reproduce it on any recent versions (including 2.6.11, 3.0.7, and 3.2.1). Please re-open if you believe it is still an issue. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 29/Oct/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
reidmorrison, the downgrade to 2.4.10 is only temporary – after running
on 2.4.10 to get rid of the offending index you can go back to 2.6.5. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Reid Morrison [ 29/Oct/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is downgrading to V2.4.10 the only solution at this time? Running the following command causes MongoDB server to crash:
Below is our stack trace running a stand-alone MongoDB server ( no replica set or shard ) :
With the following Index information:
Extract from log files after restarting showing version info etc.
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 12/Sep/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for letting us know the workaround solved your issue steffen. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Steffen [ 10/Sep/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Ramon, we solved this issue with the downgrade like you described. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 25/Aug/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
steffen, the workaround I posted above is no good – my apologies. Also I'm told that renaming system.indexes is not safe (see As for the actual issue, I was able to work around it by going back to 2.4.10 to get rid of the unwanted index. Here's how my sample index looks:
When I try dropIndexes() on 2.6.4 then I observe the behavior you reported:
But when I rolled back to 2.4.10 I was able to get rid of the offending index, despite a confusing error message:
Right after I did that my sample replica set recovered to a healthy state. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Steffen [ 22/Aug/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
renaming worked.
Bug deleting all Indexes doesn't have any effect, since system.indexes is empty / not there anymore
I tried to delete the document but this fails if there is no system.indexes collection.
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 22/Aug/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
steffen, I'm able to reproduce the behavior you describe, so we'll investigate. I think I've found a workaround by renaming the system.indexes collection:
Can you give this workaround a try and see if it solves the replication problem? Thanks, |