Open broneill opened 5 years ago
Implementing this is tricky, due to how root node splits are handled. When finishing a split, if the node is the root node or if it becomes the root node during latch re-acquisition, then the original node must be in a dirty state. This is because it will remain as the root, and so it gets promoted to become the parent node.
When inserting a new entry, the leaf node is always dirtied in advance. If the leaf needs to split, and it splits on an edge, then dirtying the node was unnecessary, and it causes an extra page to be written.