[SERVER-23655] CollectionInfoCache is not invalidated when starting an index build Created: 12/Apr/16 Updated: 02/Aug/18 Resolved: 15/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Internal Code, MMAPv1 |
| Affects Version/s: | 3.3.4 |
| Fix Version/s: | 3.2.6, 3.3.5 |
| Type: | Task | Priority: | Critical - P2 |
| Reporter: | Kyle Suarez | Assignee: | Kyle Suarez |
| Resolution: | Done | Votes: | 0 |
| Labels: | code-only | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Backport Completed: | |||||||||||||||||
| Sprint: | Integration 13 (04/22/16) | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
When running on MMAPv1, transformAndUpdate calls Collection::updateDocumentWithDamages() when performing an in-place update when a background index build is in progress. However, it can't do this when the field being updated is indexed, as the damage vector update doesn't take index changes into account. |
| Comments |
| Comment by Githook User [ 16/Apr/16 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}Message: This forces a rebuild of a collection's info cache once an index build has |
| Comment by Githook User [ 15/Apr/16 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}Message: This forces a rebuild of a collection's info cache once an index build has |
| Comment by Kyle Suarez [ 14/Apr/16 ] |
|
Bisection shows that the bug was introduced in |
| Comment by Kyle Suarez [ 12/Apr/16 ] |
|
Looks like the situation is the following: The UpdateDriver determines that an update can (possibly) be done in-place if it does not touch any indexed fields. It does this by consulting the collection's CollectionInfoCache to see if any of its indexed paths are affected. This CollectionInfoCache correctly includes indexes that are in progress, but the CollectionInfoCache only regenerates the indexes it knows about after the index build has finished successfully. This means that a background index build in progress won't be registered in time with the cache, and the UpdateDriver will falsely believe that there's no need to update any indexes. Updating the cache when the index build starts should fix this, though it's still unclear if this will affect other behavior. |