Commit 46cc98b
salad: fix crash on insertion into bps tree with OOM conditions
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=bugfix1 parent 061d4bb commit 46cc98b
File tree
3 files changed
+47
-4
lines changed- changelogs/unreleased
- src/lib/salad
- test/unit
3 files changed
+47
-4
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3156 | 3156 | | |
3157 | 3157 | | |
3158 | 3158 | | |
3159 | | - | |
3160 | 3159 | | |
3161 | 3160 | | |
3162 | 3161 | | |
| |||
3165 | 3164 | | |
3166 | 3165 | | |
3167 | 3166 | | |
3168 | | - | |
3169 | | - | |
| 3167 | + | |
3170 | 3168 | | |
3171 | 3169 | | |
3172 | 3170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| 183 | + | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
920 | 923 | | |
921 | 924 | | |
922 | 925 | | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
923 | 960 | | |
924 | 961 | | |
925 | 962 | | |
926 | | - | |
| 963 | + | |
927 | 964 | | |
928 | 965 | | |
929 | 966 | | |
| |||
944 | 981 | | |
945 | 982 | | |
946 | 983 | | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
947 | 989 | | |
948 | 990 | | |
949 | 991 | | |
0 commit comments