[DOCS-11289] Document use of failIndexKeyTooLong parameter during restore Created: 23/Jul/17  Updated: 29/Oct/23  Resolved: 06/Feb/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Nic Cottrell (Personal) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 1 week, 1 day ago

 Description   

Moved to Docs:

  • When using mongorestore, if users experience "key too large to index", they should restart the DB with --setParameter failIndexKeyTooLong=0 and retry the restore.

Original:

I've just done a mongodump on 3.2 and now doing a restore on a 3.4 server. I'm getting errors like:

code
2017-07-22T21:17:26.085+0000 restoring indexes for collection jerome5.BugReport from metadata
2017-07-22T21:17:26.555+0000 Failed: jerome5.BugReport: error creating indexes for jerome5.BugReport: createIndex error: WiredTigerIndex::insert: key too large to index, failing 69040 { : "Cache Thu Apr 02 21:00:01 UTC 2015 sourceText mismatch: <!DOCTYPE html>
<html>
<head>
<base href="http://articles.if.ua/" />
<link rel="StyleSheet" hr...", : ObjectId('552605abe4b0b601f78f8700') }
code

I don't see any option in https://docs.mongodb.com/manual/reference/program/mongorestore/ to continue after insert errors like this. Shouldn't it be possible to force insert of documents that can't be indexed?

I don't want to skip indexes for all with --noIndexRestore so what to do?



 Comments   
Comment by Githook User [ 06/Feb/18 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'kay', 'username': 'kay-kim'}

Message: DOCS-11289: mongorestore and index key length limit
Branch: v3.2
https://github.com/mongodb/docs/commit/95719cbe68e0688c24a4f7fb8efb2bde1f1778ab

Comment by Githook User [ 06/Feb/18 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'kay', 'username': 'kay-kim'}

Message: DOCS-11289: mongorestore and index key length limit
Branch: v3.4
https://github.com/mongodb/docs/commit/20bfb91a1ae1a3f601ace13b4366fc45849bc9f9

Comment by Githook User [ 06/Feb/18 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'kay', 'username': 'kay-kim'}

Message: DOCS-11289: mongorestore and index key length limit
Branch: master
https://github.com/mongodb/docs/commit/76b2f14fbfb835bfdc6614be46ca5e12fee730e9

Comment by David Golden [ 06/Feb/18 ]

LGTM

Comment by Kay Kim (Inactive) [ 06/Feb/18 ]

david.golden – let me know if the below is okay:

https://docs-mongodbcom-staging.corp.mongodb.com/kay/restore-11289/reference/program/mongorestore.html#rebuild-indexes

Comment by Kay Kim (Inactive) [ 06/Feb/18 ]

Great. will do.

Comment by David Golden [ 06/Feb/18 ]

I think a note on the mongorestore page linking to the failIndexKeyTooLong parameter entry is sufficient.

Comment by David Golden [ 23/Jan/18 ]

You'd have to open a SERVER ticket for that. mongorestore sends the index creation command as a batch with all indexes so we don't know which index or document was the problem either.

Comment by David Golden [ 11/Oct/17 ]

Updated ticket to indicate that the fix is to document the failIndexKeyTooLong parameter.

Comment by William Banfield [ 28/Jul/17 ]

It likely could, but the main priority of the tool is to efficiently load the data into mongodb. It mostly tries to avoid performing operations that should be more carefully considered by a DBA. I'm placing this issue on the backlog while we consider its priority

Comment by Nic Cottrell (Personal) [ 27/Jul/17 ]

Thanks - already found failIndexKeyTooLong as a workaround - successfully, but couldn't mongorestore catch this error and continue with the next document in the bson?

Comment by William Banfield [ 26/Jul/17 ]

Hey niccottrell, Thanks for opening this issue!

The failure you're seeing is from the database. It's failing trying to insert the index document and the tool would not be able to 'force' it in. As a workaround, you can connect to the DB and set failIndexKeyTooLong:false on the destination database.

Please follow this ticket as we further consider this feature request.

Comment by Nic Cottrell (Personal) [ 23/Jul/17 ]

Maybe --setParameter failIndexKeyTooLong=0 would help? Can this be added to the mongorestore docs?

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