[SERVER-49984] Skip side writes if both keys and multikeypaths are empty Created: 29/Jul/20  Updated: 27/Oct/23  Resolved: 04/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Backlog - Storage Execution Team
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-48471 Hashed indexes may be incorrectly mar... Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Participants:
Linked BF Score: 8

 Description   

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.



 Comments   
Comment by Louis Williams [ 04/Mar/21 ]

This should be fixed by SERVER-48471

Generated at Thu Feb 08 05:21:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.