[PATCH v2 2/3] ddl: don't use space_index from AlterSpaceOp::commit,rollback

Konstantin Osipov kostja at tarantool.org
Mon Jul 15 18:05:48 MSK 2019


* Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/10 16:13]:
> If there are multiple DDL operations in the same transactions, which is
> impossible now, but will be implemented soon, AlterSpaceOp::commit and
> rollback methods must not access space index map. To understand that,
> consider the following example:
> 
>   - on_replace: AlterSpaceOp1 creates index I1 for space S1
>   - on_replace: AlterSpaceOp2 moves index I1 from space S1 to space S2
>   - on_commit:  AlterSpaceOp1 commits creation of index I1
> 
> AlterSpaceOp1 can't lookup I1 in S1 by id, because the index was moved
> from S1 to S2 by AlterSpaceOp2. If AlterSpaceOp1 attempts to look it up,
> it will access a wrong index.
> 
> Fix that by storing pointers to old and new indexes in AlterSpaceOp if
> required.

Please make this comment more clear.

LGTM.


-- 
Konstantin Osipov, Moscow, Russia



More information about the Tarantool-patches mailing list