• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 18973005052

31 Oct 2025 12:48PM UTC coverage: 87.643% (-0.02%) from 87.666%
18973005052

push

github

sergepetrenko
bps: prevent missing matras head view changes

We've removed CoW'ing of garbage blocks for creating new inner/leaf
blocks in commit 52b3d4b91 ("salad:
reserve block before bps_tree_insert_first_elem") as the blocks are
not required to be preserved in views and can be used without CoW.

The problem is that in some circumstances this approach can lead to
a tricky problem: if we've created a block, CoW'ed another one and
then update values of the created one, the new block could've been
CoW'ed by the previous `matras_touch` (as the blocks are located in
extents of greater size than the blocks themselves). So following
updates in the created block gone into the view while the current
matras head had the old view's values remained.

The problem is that if we don't touch the garbage on block creation,
we need to make sure there's no any `matras_touch` between the block
creation and the last assignment of its field. We could fix the only
place where the guarantee is not preserved: the leaf insert routine,
but let's keep the tree similar to the BPS vector and simply revert
the change and touch popped garbage blocks too.

Since now the garbage pop invokes CoW, we might need to reserve more
memory for touches, as some new garbage blocks can be allocated on the
`bps_vec_reserve_blocks`, but other ones can be existing in the vector
previously, and, for these ones, we must reserve touches. Also, one
more touch might be required if a new block allocated on reserve.

Removed the target leaf touch from the `bps_tree_process_insert_leaf`
by the way as it's not required cause the leaf is touched on lookup.

Follows-up #11857
Closes #11979

NO_DOC=bugfix
NO_CHANGELOG=was not released

69985 of 117831 branches covered (59.39%)

11 of 11 new or added lines in 1 file covered. (100.0%)

70 existing lines in 23 files now uncovered.

105050 of 119861 relevant lines covered (87.64%)

1361034.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.38
/src/lib/core/trigger.cc


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc