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

tarantool / tarantool / 7322625985
88%

Build:
DEFAULT BRANCH: master
Ran 25 Dec 2023 03:17PM UTC
Jobs 1
Files 509
Run time 43s
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

25 Dec 2023 03:05PM UTC coverage: 86.859% (+0.02%) from 86.839%
7322625985

push

github

alyapunov
box: introduce transactional event triggers

This patch introduces 3 new transaction-related events, that can be used
for setting user-defined triggers:

 * box.before_commit - triggered when a transaction is ready to commit;
 * box.on_commit - triggered when a transaction is committed;
 * box.on_rollback - triggered when a transaction is rolled back.

Each of them have 3 versions, e.g. `box.on_commit' event has:

 * box.on_commit - global version, called for all transactions;
 * box.on_commit.space.test - called for transactions that write to
   space "test";
 * box.on_commit.space[512] - called for transactions that write to
   space with id 512.

These triggers are implemented via the new trigger registry and work
independently from the core `on_commit' and `on_rollback' triggers.
One of the main advantages of the new triggers is that they can be set
for all transactions, rather than setting them within each transaction.

Space-specific triggers are called prior to global ones. If a trigger-
function fails, the remaining triggers for this event (including global)
are not executed.

If a space-specific trigger is added to the registry within an active
transaction, it may or may not be called on commit/rollback of this
transaction (the behavior is unspecified).

The trigger-function for each event may take an iterator parameter.
Similar to core triggers, the iterator goes through the effects of every
request that changed a space during the transaction.

`box.before_commit' trigger-function restrictions:

 * Yield is allowed (on memtx without mvcc it will abort the txn);
 * Allowed to write into database spaces;
 * If the function raises an error, the transaction is rolled back.

`box.on_commit' and `box.on_rollback' trigger-function restrictions:

 * Yield is forbidden (it will crash Tarantool);
 * The function should not access any database spaces;
 * If the function raises an error, the error is simply logged.

Closes #5717

NO_DOC=later (it depent... (continued)

66352 of 118591 branches covered (0.0%)

210 of 218 new or added lines in 5 files covered. (96.33%)

26 existing lines in 8 files now uncovered.

98615 of 113535 relevant lines covered (86.86%)

2669919.12 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7322625985.1 25 Dec 2023 03:17PM UTC 0
86.86
GitHub Action Run
Source Files on build 7322625985
Detailed source file information is not available for this build.
  • Back to Repo
  • c006620a on github
  • Prev Build on master (#7322582933)
  • Next Build on master (#7323487704)
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