[SERVER-49283] Biggie merge3 can incorrectly store nodes under the wrong parent Created: 02/Jul/20  Updated: 29/Oct/23  Resolved: 13/Jul/20

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

Type: Task Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-07-13, Execution Team 2020-07-27
Participants:

 Description   

When resolving merge conflicts we may erase nodes that lead to node compression. If this is done under _merge3Helper the current node is modified and its depth and triekey changes, being different from other and base nodes.

When this state is normally encountered we don't recurse into _merge3Helper and go into merge conflict handling. But the case above happens when we are already recursed in _merge3Helper. This leads to the code paths detecting that just a single branch changed to merge the children into current to put them into the compressed node that should have been split before the merge.

The store is left in an invalid state making these nodes accessible, it also crashes iterators operating on the tree.



 Comments   
Comment by Githook User [ 13/Jul/20 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-49283 Fixing issues in merge3 when previous operation has resulted in compression of current node

Depending on where we are in the algorithm we can try to re-expand the node or fallback to conflict resolution at the higher level.
Branch: master
https://github.com/mongodb/mongo/commit/445ae8fab6ac0ec5e02d94d5afddb1b6827965df

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