[SERVER-30205] Report warning if requested key(s) is not found when creating index Created: 18/Jul/17 Updated: 29/Jan/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Chris Harris | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | execution-product-sync, neweng, oldstorexemea, pmr, storex-ranked | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Storage Execution
|
| Participants: | |
| Case: | (copied to CRM) |
| Description |
|
We should consider reporting a warning if an index build on a non-empty collection does not encounter any documents containing the key(s) specified. This can happen, for example, if there is a typo in the command. Such a warning could help mitigate performance issues and reduce the time and resources required to investigate and correct.
|
| Comments |
| Comment by Dianna Hohensee (Inactive) [ 07/Feb/23 ] |
|
Triage conversation: can we leave a note in the command response when this happens? If every single field value is null for an index, surface this. |
| Comment by Ana Meza [ 25/Oct/22 ] |
|
james.wahlin@mongodb.com I am assigning this to you as discussed during QO Triage meeting |
| Comment by Asya Kamsky [ 07/Apr/22 ] |
|
Why not make it a more general info message:
”Found X distinct values when building this index” ? |
| Comment by Chris Harris [ 27/Sep/17 ] |
|
Regarding preemptively creating an index (for an incoming field), that's absolutely a possibility. Users issuing the command in that situation are probably already aware and expecting that the field will not be found. But the intention is that the warning would be worded in such a way to note this possibility (and that it is not a problem). Since the mongo shell session creating the index [in the background] will block until the index build is complete, this warning could be applied in either situation. |
| Comment by Kyle Suarez [ 18/Jul/17 ] |
|
What if I want to preemptively create an index for some new field that will be inserted for future documents? I suppose a warning wouldn't really hurt, but it sounds like a product like Compass would make the most use of this feature, as it has a sample of the documents in the collection. In any case. it sounds like this would only be possible for foreground index builds. |