-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
ALL
-
8
When key generation encounters a suppressible error (e.g. during initial sync), we clear both the output key set and multikeypaths vector.
Even after key generation fails, we still call IndexBuildInterceptor::sideWrite, which can initialize _multikeypaths to a vector of zero-length, even if the actual index spec has non-trivial multikey paths. This will trigger invariants when attempting to merge multikeypaths from valid keys later one with non-trivial multikeypaths.
To solve this problem, I think we should skip initializing/merging the _multikeypaths when both the key set and the multikeypaths are empty. This suggests that key generation failed (and cleared both containers) or there is no useful multikey information to update and no indexable keys.
See SERVER-39705 which is related.
- related to
-
SERVER-48471 Hashed indexes may be incorrectly marked multikey and be ineligible as a shard key
- Closed