Skip to content
Snippets Groups Projects
Commit 87a2989b authored by Alexandr Lyapunov's avatar Alexandr Lyapunov Committed by Roman Tsisyk
Browse files

vinyl: fix rollback of prepared TX

Now if a prepared transaction is aborted, it expects to be the
latest prepared TX in TX manager. It's not true in two cases:

- The transaction failed during preparation. The TX is in partially
  prepared state and must rollback all the changes it made in mems
  but the preparation was not finished and thus the TX could not be
  considered as the latest in TX manager.

- It's a cascading rollback with more than on TX. It would be
  graceful for the latest aborted TX to set the previous TX as
  the latest after the abortion. But the TX does not know the
  previous prepared TX and simply set to NULL appropriate pointer;
  when the time comes for the previous TX to be aborted it
  does not see itself as the latest.

The TX must not expect itself to be the latest but must handle
the last_prepared_tx pointer only if it is the latest.

Fix it and add tests.

Fix #2588 (case 1)
Fix #2591 (case 2)
parent 4be1be77
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment