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

tarantool / tarantool / 10614108676
88%

Build:
DEFAULT BRANCH: master
Ran 29 Aug 2024 11:38AM UTC
Jobs 1
Files 514
Run time 18min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Aug 2024 11:25AM UTC coverage: 87.222% (+0.004%) from 87.218%
10614108676

push

github

sergepetrenko
memtx: accelerate count in the tree

Prior to this patch the count request had been performed in the memtx
in a straightforward way: we created an iterator by a type and key and
simply called its `next` method until it's exhausted. That means the
operation had a linear complexity, which could lead to DoS situations.

Also the count operation with ALL iterator hadn't been recorded in the
MVCC previously and had an erroneous logic (see the #10140). This is
fixed too as a side effect.

This patch makes the memtx tree index use a version of BPS tree with
the cardinality information enabled and takes advantage of its offset
based API to implement the count operation using tree lookups.

Since the method does not read each counted tuple now, MVCC subsystem
would be unaware of it. In order to fix this, this patch introduces a
new entity in the memtx transaction manager to track such operations:
GAP_COUNT, and the corresponding `memtx_tx_track_count` function.

The entity (gap item) is a record that a concurrent transaction has
counted tuples matching some key and iterator type in an index.

If a transaction creates such an entity, any insertion or deletion
of a matching tuple in the index will be conflicted with it. This
works differently for inserts and deletes:

1. If a concurrent transaction inserts a new matching tuple, then
   its read_gaps list is modified like the counted transaction had
   read the exact key of the tuple and found nothing. This creates
   a conflict.

2. If a concurrent transaction deletes a matching tuple, then the
   transaction that counted the tuple is inserted into the tuple
   reader list: it pretends to have read the tuple prior to the
   deletion. This creates a conflict.

The existing stories of matching dirty tuples are handled differently.
Since its's not stored directly whether the story is a product of an
insertion or a replacement, any matching visible tuple is marked as
read by the counting transaction and any matching... (continued)

68493 of 121801 branches covered (56.23%)

97 of 99 new or added lines in 3 files covered. (97.98%)

123 existing lines in 20 files now uncovered.

101207 of 116034 relevant lines covered (87.22%)

2452965.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10614108676.1 29 Aug 2024 11:38AM UTC 0
87.22
GitHub Action Run
Source Files on build 10614108676
Detailed source file information is not available for this build.
  • Back to Repo
  • 49e459ea on github
  • Prev Build on master (#10613874780)
  • Next Build on master (#10633873816)
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