[backport 3.4] salad: reserve block before bps_tree_insert_first_elem#11886
Merged
sergepetrenko merged 1 commit intorelease/3.4from Oct 9, 2025
Merged
[backport 3.4] salad: reserve block before bps_tree_insert_first_elem#11886sergepetrenko merged 1 commit intorelease/3.4from
sergepetrenko merged 1 commit intorelease/3.4from
Conversation
The commit 51c56d9 ("salad: reserve extents for matras_touch on BPS tree operations") already made the tree self-sufficient - reserved blocks in garbage and extents for `matras_touch` calls prior to insertion and deletion. However, it didn't account for the addition of the first element to the tree, which creates the root leaf - this could also trigger `matras_touch` in `bps_tree_garbage_pop`. However, it turns out there is no need to touch blocks before taking them out of the garbage. There is an invariant that blocks in the garbage are definitely not used by any read views. Although from the point of view of the matras, they require copying and could potentially have been needed by these read views. Let's just remove this `matras_touch` from `bps_tree_garbage_pop`. Also let's reserve a block in the garbage before calling `bps_tree_insert_first_elem` to bring the tree even closer to self-sufficiency. Closes #11788 NO_DOC=bugfix (cherry picked from commit 52b3d4b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(This PR is a backport of #11857 to
release/3.4to a future3.4.2release.)The commit 51c56d9 ("salad: reserve extents for matras_touch on BPS tree operations") already made the tree self-sufficient - reserved blocks in garbage and extents for
matras_touchcalls prior to insertion and deletion. However, it didn't account for the addition of the first element to the tree, which creates the root leaf - this could also triggermatras_touchinbps_tree_garbage_pop.However, it turns out there is no need to touch blocks before taking them out of the garbage. There is an invariant that blocks in the garbage are definitely not used by any read views. Although from the point of view of the matras, they require copying and could potentially have been needed by these read views. Let's just remove this
matras_touchfrombps_tree_garbage_pop. Also let's reserve a block in the garbage before callingbps_tree_insert_first_elemto bring the tree even closer to self-sufficiency.Closes #11788
NO_DOC=bugfix