[SERVER-36343] Encountering error Btree::insert: key too large to index when deleting a document Created: 30/Jul/18  Updated: 30/Jul/18  Resolved: 30/Jul/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kefeng Zhang Assignee: Nick Brewer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

We are facing the error "Btree::insert: key too large to index" when trying to delete a document, and the document is not deleted with success. I know that this error is caused by the index entry for this document exceeds index key limit, as described in the doc: https://docs.mongodb.com/manual/reference/limits/#Index-Key-Limit .

My question is that why this document was inserted into the database without error. As the document https://docs.mongodb.com/manual/reference/limits/#Index-Key-Limit  says, inserting this document to the mongodb should be failed.  

 



 Comments   
Comment by Nick Brewer [ 30/Jul/18 ]

kzhang@appcelerator.com As mentioned in the link you've provided, the change to more strictly enforce the index key limit size during document creation was introduced in MongoDB 2.6 - if the document was added in an older version, and then you attempted to remove it on 2.6, it would explain the behavior you're seeing.

That said, MongoDB 2.6 became EOL in October 2016, so I strongly recommend that you upgrade to a supported version. If you're still encountering this behavior on a supported version, feel free to update this ticket and I'll re-open it for you.

-Nick

Generated at Thu Feb 08 04:42:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.