Commit ae519ed
committed
vinyl: do not reset cache link LSN on partial key lookup
Since commit e8109b2 ("vinyl: ignore cache chains with invisible
DELETEs") each cache node stores the LSNs of the left and right links.
They are used to ignore links that are invisible from the current read
view (created after the read view was opened). We update the LSN not
only when we link two nodes together but also when we update the node's
boundary level. This is incorrect if the node is linked.
For example, suppose we have an index over two fields that contains
tuples {0,2} and {2,0} and there's a transaction that was sent to
a read view. Now another transaction inserts {0,1} and deletes {0,2},
then selects all tuples. This results in creation of two interlinked
cache nodes: {0,1} and {2,0}. The link is invisible from the read view:
since we skipped DELETE{0,2}, its LSN equals the LSN of the DELETE
statement, which is greater than the read view LSN. However, if we now
select GT{1}, we will update the boundary level of the node storing
{2,0} from 2 to 1 and reset its LSN to 0 because we didn't skip any
DELETE statements. As a result, if the transaction operating in the read
view tries to select GT{0,1}, it will find {2,0}, see that it's
left-linked and the link LSN is 0, and return it right away, skipping
{0,2}, which is visible from the read view.
To fix this issue, let's skip the boundary level update if the node
is linked. It doesn't make sense anyway because the boundary level is
used only for unlinked nodes, see vy_cache_iterator_is_stop().
Follow-up tarantool#11079
Closes tarantool#11294
NO_DOC=bug fix1 parent f001417 commit ae519ed
File tree
3 files changed
+59
-1
lines changed- changelogs/unreleased
- src/box
- test/vinyl-luatest
3 files changed
+59
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
0 commit comments