[SERVER-12233] Command to check for over-long index keys Created: 02/Jan/14 Updated: 10/Dec/14 Resolved: 01/Feb/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Richard Kreuter (Inactive) | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Problem: installed deployments are likely to contain documents whose for which index keys are too long to index. MongoDB 2.6 will be stricter about long index keys than earlier versions. Proposal: the 2.6 release could include a command that looked for overly long index keys in a collection, and, depending on a boolean argument, either counted the number of bad documents, or else wrote each document to a BSON file in the dbpath and removed the document from the collection. Rationale for setting aside offending documents in the mongod: suppose the collection only has an index on _id, then uniqueness of _id values isn't enforced, and so there may not be any unique value that identifies a document with overly long _id fields. So just reporting the bad documents will not be enough for a client program to issue valid cleanup operations in all cases. Rationale for a boolean argument saying whether to count or set aside the documents: (a) users might want to assess the magnitude of the problem before clearing out the offending documents, and probably wants to do that assessment on secondaries but a command that changes collections has to be run on a primary. Documentation changes needed: once this command exists, it needs to be documented, and the release notes/upgrade steps should recommend using this command to look for and/or clean out offending documents as part of the upgrade process (e.g., upgrade one secondary (per shard), then run this command). |
| Comments |
| Comment by Daniel Pasette (Inactive) [ 01/Feb/14 ] |
|
functionality will be provided by |
| Comment by Daniel Pasette (Inactive) [ 03/Jan/14 ] |
|
this is a specific check which could be used in the tool/command described in |
| Comment by Richard Kreuter (Inactive) [ 02/Jan/14 ] |
|
Restricting index key lengths motivates the addition of a new command to help the installed userbase. |