Skip to content

box: deprecate triggers during recovery#11775

Merged
locker merged 1 commit intotarantool:masterfrom
nshy:deprecate-on-recovery-triggers
Aug 27, 2025
Merged

box: deprecate triggers during recovery#11775
locker merged 1 commit intotarantool:masterfrom
nshy:deprecate-on-recovery-triggers

Conversation

@nshy
Copy link
Contributor

@nshy nshy commented Aug 25, 2025

See the issue for motivation.

Now if compat.box_recovery_triggers_deprecation is 'new' we do not trigger space and transactional events during recovery.

Closes #11756

@TarantoolBot document
Title: Deprecate triggers during recovery

Deprecate space and transactional triggers during recovery.

(Please create https://tarantool.io/compat/box_recovery_triggers_deprecation)

We are planning to switch the compat option to the new behavior starting from Tarantool 4.0 with the ability to revert to the old behavior. Starting from Tarantool 5.0 there will be no option to trigger events during recovery.

@nshy nshy requested review from a team and Totktonada as code owners August 25, 2025 10:17
@coveralls
Copy link

coveralls commented Aug 25, 2025

Coverage Status

coverage: 87.615% (-0.006%) from 87.621%
when pulling 66baf79 on nshy:deprecate-on-recovery-triggers
into e454545
on tarantool:master
.

@nshy nshy requested a review from locker August 25, 2025 11:04
@locker locker assigned nshy and unassigned locker Aug 25, 2025
@nshy nshy force-pushed the deprecate-on-recovery-triggers branch from 894a2d6 to f74fba9 Compare August 26, 2025 13:07
@nshy nshy assigned locker and unassigned nshy Aug 26, 2025
@locker locker assigned nshy and unassigned locker Aug 26, 2025
Copy link
Contributor

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections from my side.

There are a number of arguments to deprecate triggers on recovery:

- One has to write triggers with this peculiarity in mind. For example, if
a trigger is used for some kind of data exporting, it should be skipped
during recovery because the data must have already been exported before
restart.

- These triggers do not work with other engines. For example, in case of
Vinyl, the behavior is undefined: a trigger may or may not run for
a statement recovered from an xlog, depending on whether it was dumped
to disk before restart.

- Using `before_replace` triggers on recovery is dangerous because it may
break recovery. Even if it doesn't, one may get a database state, in
which the in-memory data is different from on-disk data, which may
result in weird breakages later.

- Supporting triggers on recovery slows down startup because we have to
run all statements recovered from the snapshot through the transaction
manager, see tarantool#11452 (Recovery performance regression (-1.5x on SSD)).

- Handling the triggers complicates our code. We have to disable certain
features if triggers are set, e.g. see tarantool#10847 (Save order of secondary
indexes to snapshot).

Now if `compat.box_recovery_triggers_deprecation` is 'new' we do not
trigger space and transactional events during recovery.

Closes tarantool#11756

@TarantoolBot document
Title: Deprecate triggers during recovery

Deprecate space and transactional triggers during recovery.

(Please create https://tarantool.io/compat/box_recovery_triggers_deprecation)

We are planning to switch the compat option to the new behavior starting
from Tarantool 4.0 with the ability to revert to the old behavior.
Starting from Tarantool 5.0 there will be no option to trigger events
during recovery.
@nshy nshy force-pushed the deprecate-on-recovery-triggers branch from f74fba9 to 66baf79 Compare August 27, 2025 07:53
@nshy nshy assigned locker and unassigned nshy Aug 27, 2025
@locker locker assigned nshy and unassigned locker Aug 27, 2025
@nshy nshy added the full-ci Enables all tests for a pull request label Aug 27, 2025
@nshy nshy assigned locker and unassigned nshy Aug 27, 2025
@locker locker merged commit e924e93 into tarantool:master Aug 27, 2025
58 of 59 checks passed
@nshy nshy deleted the deprecate-on-recovery-triggers branch August 27, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not run space replace triggers during recovery

5 participants