[SERVER-12909] error creating a unique index on two fields Created: 26/Feb/14  Updated: 26/Feb/14  Resolved: 26/Feb/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pavel Baranov Assignee: Unassigned
Resolution: Done Votes: 0
Labels: indexing, mongorestore
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

mongodump was made from version 2.4. trying to mongorestore into 2.6.0-rc1

2014-02-26T10:46:41.478-0500    going into namespace [demo.main]
2014-02-26T10:46:44.165-0500            Progress: 133116952/2407339364  5%      (bytes)
2014-02-26T10:46:47.193-0500            Progress: 275062069/2407339364  11%     (bytes)
2014-02-26T10:46:50.056-0500            Progress: 378110713/2407339364  15%     (bytes)
2014-02-26T10:46:53.230-0500            Progress: 486268459/2407339364  20%     (bytes)
2014-02-26T10:46:56.028-0500            Progress: 515090538/2407339364  21%     (bytes)
2014-02-26T10:46:59.126-0500            Progress: 668413040/2407339364  27%     (bytes)
2014-02-26T10:47:02.329-0500            Progress: 781576922/2407339364  32%     (bytes)
2014-02-26T10:47:05.126-0500            Progress: 910597410/2407339364  37%     (bytes)
2014-02-26T10:47:08.113-0500            Progress: 1050942625/2407339364 43%     (bytes)
2014-02-26T10:47:11.042-0500            Progress: 1178349489/2407339364 48%     (bytes)
2014-02-26T10:47:14.162-0500            Progress: 1306373885/2407339364 54%     (bytes)
2014-02-26T10:47:17.054-0500            Progress: 1374629111/2407339364 57%     (bytes)
2014-02-26T10:47:20.208-0500            Progress: 1550122894/2407339364 64%     (bytes)
2014-02-26T10:47:23.352-0500            Progress: 1614050146/2407339364 67%     (bytes)
2014-02-26T10:47:26.422-0500            Progress: 1701273388/2407339364 70%     (bytes)
2014-02-26T10:47:29.180-0500            Progress: 1826601748/2407339364 75%     (bytes)
2014-02-26T10:47:32.068-0500            Progress: 1900899338/2407339364 78%     (bytes)
2014-02-26T10:47:35.179-0500            Progress: 2062553358/2407339364 85%     (bytes)
2014-02-26T10:47:38.184-0500            Progress: 2209898093/2407339364 91%     (bytes)
2014-02-26T10:47:41.330-0500            Progress: 2344509745/2407339364 97%     (bytes)
40667 objects found
2014-02-26T10:47:43.315-0500    Creating index: { key: { _id: 1 }, ns: "demo.main", name: "_id_" }
2014-02-26T10:47:43.396-0500    Creating index: { key: { coords: "2dsphere" }, ns: "demo.main", name: "coords_2dsphere" }
2014-02-26T10:47:45.765-0500    Creating index: { key: { way: 1, nds: 1 }, unique: true, ns: "demo.main", name: "way_1_nds_1" }
Error creating index demo.main: 17282 err: "Btree::insert: key too large to index, failing demo.main.$way_1_nds_1 1068 { : 16300939, : "166654915 166654917 166654918 166654919 166654920 16665492..."
Aborted (core dumped)



 Comments   
Comment by Pavel Baranov [ 26/Feb/14 ]

I just did a complete dump and restore on 2.4 and no errors were logged and index created successfully.

Comment by Scott Hernandez (Inactive) [ 26/Feb/14 ]

2.4 does not generate this error, and only logs a message. The release notes and changes are for 2.6 explicitly, as this is a change from earlier versions.

Comment by Pavel Baranov [ 26/Feb/14 ]

I would agree with you on that one, however, mongorestore on 2.4 works.

Comment by Scott Hernandez (Inactive) [ 26/Feb/14 ]

This is expected if the value is too large.

See the docs and release notes:
http://docs.mongodb.org/master/release-notes/2.6/#stricter-enforcement-of-index-key-length-limit
http://docs.mongodb.org/master/reference/limits/#indexes

Generated at Thu Feb 08 03:30:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.