-
Notifications
You must be signed in to change notification settings - Fork 387
crash in bps tree on OOM #11326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Introduced by 3.3.0-entrypoint-216-g51c56d9b33 (51c56d9). Before it we don't have any reservation inside bps tree and just do some heuristic reservation on insert using |
nshy
added a commit
to nshy/tarantool
that referenced
this issue
Apr 3, 2025
On insertion into bps tree we first reserve blocks for the case we need to insert new leaf during rebalancing. Next there can be a free block on last extent in matras but no more free extents in tuple arena. So `bps_tree_reserve_blocks()` is able to allocate a block but then `bps_tree_garbage_push()` is called that touches a block. As there no free extents touch is failed which is unexpected and causes a crash. We don't need to touch the block on this path as block is newly allocated and is not shared with any read view. We don't need to touch block on other paths too (disposing a leaf or a inner node) because we move data from this node before so it is already should be touched. So just don't touch the block in `bps_tree_garbage_push()`. The issue is introduced in the commit 51c56d9 ("salad: reserve extents for matras_touch on BPS tree operations") and unlocked in the commit 32b0678 ("memtx: reserve extents in the RTREE index itself") where we removed crutches where we heuristically reserve memory for index operations. Closes tarantool#11326 NO_DOC=bugfix
This was referenced Apr 3, 2025
github-actions bot
pushed a commit
that referenced
this issue
Apr 4, 2025
On insertion into bps tree we first reserve blocks for the case we need to insert new leaf during rebalancing. Next there can be a free block on last extent in matras but no more free extents in tuple arena. So `bps_tree_reserve_blocks()` is able to allocate a block but then `bps_tree_garbage_push()` is called that touches a block. As there 8DD1 no free extents touch is failed which is unexpected and causes a crash. We don't need to touch the block on this path as block is newly allocated and is not shared with any read view. We don't need to touch block on other paths too (disposing a leaf or a inner node) because we move data from this node before so it is already should be touched. So just don't touch the block in `bps_tree_garbage_push()`. The issue is introduced in the commit 51c56d9 ("salad: reserve extents for matras_touch on BPS tree operations") and unlocked in the commit 32b0678 ("memtx: reserve extents in the RTREE index itself") where we removed crutches where we heuristically reserve memory for index operations. Closes #11326 NO_DOC=bugfix (cherry picked from commit 46cc98b)
sergepetrenko
pushed a commit
that referenced
this issue
Apr 4, 2025
On insertion into bps tree we first reserve blocks for the case we need to insert new leaf during rebalancing. Next there can be a free block on last extent in matras but no more free extents in tuple arena. So `bps_tree_reserve_blocks()` is able to allocate a block but then `bps_tree_garbage_push()` is called that touches a block. As there no free extents touch is failed which is unexpected and causes a crash. We don't need to touch the block on this path as block is newly allocated and is not shared with any read view. We don't need to touch block on other paths too (disposing a leaf or a inner node) because we move data from this node before so it is already should be touched. So just don't touch the block in `bps_tree_garbage_push()`. The issue is introduced in the commit 51c56d9 ("salad: reserve extents for matras_touch on BPS tree operations") and unlocked in the commit 32b0678 ("memtx: reserve extents in the RTREE index itself") where we removed crutches where we heuristically reserve memory for index operations. Closes #11326 NO_DOC=bugfix (cherry picked from commit 46cc98b)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
Tarantool crashed with backtrace:
Steps to reproduce
Repro script:
Same as https://github.com/tarantool/tarantool-ee/issues/1180.
The text was updated successfully, but these errors were encountered: