[Tarantool-patches] [PATCH 1/1] qsync: handle async txns right during CONFIRM

Serge Petrenko sergepetrenko at tarantool.org
Tue Jun 1 10:37:15 MSK 2021



28.05.2021 22:13, Vladislav Shpilevoy пишет:
> Hi! Thanks for the review!
>
>>> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
>>> index f287369a2..05f0bf30a 100644
>>> --- a/src/box/txn_limbo.c
>>> +++ b/src/box/txn_limbo.c
>>> @@ -389,6 +389,27 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn)
>>>                 */
>>>                if (e->lsn == -1)
>>>                    break;
>>> +        } else if (e->txn->signature < 0) {
>>> +            /*
>>> +             * A transaction might be covered by the CONFIRM even if
>>> +             * it is not written to WAL yet when it is an async
>>> +             * transaction. It could be created just when the
>>> +             * CONFIRM was being written to WAL.
>>> +             */
>>> +            assert(e->txn->status == TXN_PREPARED);
>>> +            /*
>>> +             * Let it complete normally as a plain transaction.
>>> +             */
>>> +            txn_clear_flags(e->txn, TXN_WAIT_SYNC | TXN_WAIT_ACK);
>> AFAICS it's enough to clear WAIT_SYNC here.
>> Asynchronous transactions never have WAIT_ACK set, do they?
> Yes, sorry, I was in a big hurry when sent this patch. Fixed:
>
> ====================
> @@ -400,7 +400,7 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn)
>   			/*
>   			 * Let it complete normally as a plain transaction.
>   			 */
> -			txn_clear_flags(e->txn, TXN_WAIT_SYNC | TXN_WAIT_ACK);
> +			txn_clear_flags(e->txn, TXN_WAIT_SYNC);
>   			txn_limbo_remove(limbo, e);


Hi! Thanks for the fixes! LGTM.

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list