Skip to content
Snippets Groups Projects
Commit 914a36da authored by Aleksandr Lyapunov's avatar Aleksandr Lyapunov Committed by Aleksandr Lyapunov
Browse files

txm: store pointers to indexes in story

There was a tricky problem in TX manager that could lead to a
crash after deletion of a space.

When a space is deleted, TX manager uses a special callback to
remove dirty tuples from indexes. It is necessary for correct
destruction of space and indexes.

The problem is that actual space drop works in several steps,
deletings secondary indexes and then deleting primary indexes.
Each step is an independend alter. And alters are tricky.

For example we had a struct space instance, namely S1, with
two indexes I1 and I2. At the first step we have to delete the
second index. By design, for that purpose a new instance of
space is created, namely S2, with one empty index I3. Then the
spaces exchanges their indexes, and S1 becomes with I3 and I2,
and S2 owns I1. After that S1 is deleted. That is good until we
try to make story cleanup - all the dirty tuples remain in S2.I1,
while we try to clean empty S1.I3.

The only way to fix it - story index pointer right in story to
make sure we are cleaning the right index.

Part of #6234
Closes #6274
parent 6571afcb
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