Files
turso/core
Jussi Saurio d6bd9fc26e Merge 'fix/btree/balance: interior cell insertion can leave page overfull' from Jussi Saurio
- When an interior index cell is replaced, it can cause the page where
the
replacement happens to overflow OR underflow. On `main` we did not check
this case, because
the interior cell replacement always moves the cursor to a leaf, and if
the leaf
doesn't underflow, then no further balancing happens.
- The solution is to ALWAYS check whether the interior page where the
replacement
happens is underflowing OR overflowing, and balance that page regardless
of whether
the leaf page where the replacement was taken underflows or not.
So summary:
- InteriorCellReplacement: cell deleted from Interior page I,
replacement cell taken from Leaf L
  and inserted back to Interior page I.
- If Leaf L underflows:
  * balance it first
  * then balance I if it overflows OR underflows
- If Leaf L does NOT underflow:
  * balance I anyway if it overflows OR underflows
Closes https://github.com/tursodatabase/turso/issues/1701
Closes https://github.com/tursodatabase/turso/issues/2167

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #2168
2025-07-21 11:03:26 +03:00
..
2025-07-16 13:54:39 -03:00
2025-07-16 14:02:56 +04:00
2025-07-18 11:01:57 +03:00
2025-07-14 11:20:49 +04:00
2025-07-17 21:43:07 +03:00
2025-06-23 19:52:13 +01:00
2025-06-30 10:01:03 +03:00
2025-07-10 19:15:39 +08:00
2025-01-28 14:55:38 -05:00
2025-07-18 07:28:36 +02:00
2025-06-23 19:52:13 +01:00
2025-01-28 14:55:38 -05:00
2025-07-19 20:44:06 -05:00
2025-06-23 19:52:13 +01:00
2024-12-24 18:04:30 +01:00
2025-07-19 01:40:42 -03:00
2025-06-30 09:54:13 +03:00
2025-07-14 07:16:53 +02:00