[Tarantool-patches] [PATCH 4/4] box/txn: fix nil dereference in txn_rollback

Konstantin Osipov kostja.osipov at gmail.com
Mon Feb 17 23:01:17 MSK 2020


* Cyrill Gorcunov <gorcunov at gmail.com> [20/02/17 22:07]:
> b) error during journal_write
> 
> txn_write
>   txn_write_to_wal
>     journal_write
>       wal_write
>         ...
>         entry->res = -1;
>         return -1;
>   txn_rollback(with fiber.txn != NULL), which
>   is fine.

After you remove journal_entry_complete_cb from fail: branch of
wal_write(), if you set txn to null only after successful journal_write, you'll
be fine. On failure, the rollback will be done by txn_write().

> Guys, do I miss something obvious? The key moment
> is dropping journal_entry_complete call from wal.c
> on error path and defer setting fiber.txn = NULL
> until journal_write passed without errors.

Don't know how obvious this is, but it is something both me and
Georgy are suggesting it seems.

 

-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list