Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why doesn't txn rollback invoke on_replace triggers for affected spaces? #7810

Closed
Gerold103 opened this issue Oct 14, 2022 · 2 comments · Fixed by #9370
Closed

Why doesn't txn rollback invoke on_replace triggers for affected spaces? #7810

Gerold103 opened this issue Oct 14, 2022 · 2 comments · Fixed by #9370
Assignees
Labels
3.0 Target is 3.0 and all newer release/master branches box The database and relevant APIs bug Something isn't working triggers

Comments

@Gerold103
Copy link
Collaborator

Rollback reverts all changes in reversed order. Makes space:replace(old_tuple) basically. Shouldn't these rollbacks also trigger on_replace triggers?

The question is mostly about savepoints problem. Assume I did a savepoint and then made a few changes. Then I rollback to the savepoint. From this moment the made changes won't appear in neither on_commit nor on_rollback triggers. For these statements I was unable to track whether they were committed or rolled back after all.

I faced this problem when trying to implement extra-secure control over _bucket content in vshard. I wanted to reject all invalid updates in on_replace + do some work like if a bucket turned from active to sending then I set rw_lock = true. If the transaction is rolled back (so the state goes back from sending to active), then I want to revert rw_lock back to false.

With the current API I would have been able to do it via on_replace + on_rollback if not for the savepoints. If I rollback this particular statement via a savepoint, then it is untrackable.

@Gerold103 Gerold103 added bug Something isn't working question Further information is requested box The database and relevant APIs labels Oct 14, 2022
@kostja
Copy link
Contributor

kostja commented Oct 16, 2022

Rollback can't fail. And shouldn't yield.

@kostja
Copy link
Contributor

kostja commented Oct 16, 2022

Perhaps there could be on_savepoint_rollback.

@kyukhin kyukhin removed the question Further information is requested label Aug 14, 2023
@Gumix Gumix self-assigned this Oct 25, 2023
@Gumix Gumix added the 3.0 Target is 3.0 and all newer release/master branches label Oct 25, 2023
@Gumix Gumix removed the 3.0 Target is 3.0 and all newer release/master branches label Nov 14, 2023
Gumix added a commit to Gumix/tarantool that referenced this issue Nov 14, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes tarantool#7810

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Nov 14, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes tarantool#7810

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Nov 14, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes tarantool#7810

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Nov 16, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes tarantool#7810

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Nov 20, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes tarantool#7810

NO_DOC=bugfix
locker pushed a commit that referenced this issue Nov 21, 2023
Currently, if a statement is rolled back during rollback to a savepoint, it
does not appear in neither on_commit nor on_rollback triggers. Fix this by
running on_rollback triggers during the rollback to the savepoint.

Closes #7810

NO_DOC=bugfix
@locker locker added the 3.0 Target is 3.0 and all newer release/master branches label Nov 21, 2023
@Gumix Gumix added the triggers label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Target is 3.0 and all newer release/master branches box The database and relevant APIs bug Something isn't working triggers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants