Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/5] [tosquash] replication: fix multiple rollbacks
Date: Sun, 5 Jul 2020 17:13:30 +0200	[thread overview]
Message-ID: <516cd472-e01e-78f2-baed-fa9def76ce46@tarantool.org> (raw)
In-Reply-To: <31755095-f5c6-cc73-f3d3-6bfe233b78c1@tarantool.org>

>>   src/box/txn_limbo.c                 | 25 +++++++++++++++++++++++++
>>   test/replication/qsync_basic.result |  2 +-
>>   2 files changed, 26 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
>> index 0402664cb..2cb687f4d 100644
>> --- a/src/box/txn_limbo.c
>> +++ b/src/box/txn_limbo.c
>> @@ -150,6 +157,24 @@ txn_limbo_wait_complete(struct txn_limbo *limbo, struct txn_limbo_entry *entry)
>>       bool timed_out = fiber_yield_timeout(txn_limbo_confirm_timeout(limbo));
>>       fiber_set_cancellable(cancellable);
>>       if (timed_out) {
>> +        assert(!txn_limbo_is_empty(limbo));
>> +        if (txn_limbo_first_entry(limbo) != entry) {
>> +            /*
>> +             * If this is not a first entry in the
>> +             * limbo, it is definitely not a first
>> +             * timed out entry. And since it managed
>> +             * to time out too, it means there is
>> +             * currently another fiber writing
>> +             * rollback. Wait when it will finish and
>> +             * wake us up.
>> +             */
> 
> Why isn't it the first timed out? Is it because once previous entry was confirmed, it
> is removed from the queue immediately?
> Looks fragile.

Нет, это не связано с конфирмами. Если в лимбо добавлены две записи, и стаймаутила
вторая, то логично, что раз первая лежит в лимбе еще дольше, она стаймаутила тоже.
А значит достаточно записать роллбек для нее, и это откатит все следующие.

  reply	other threads:[~2020-07-05 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 23:40 [Tarantool-patches] [PATCH 0/5] Qsync: local rows fixes Vladislav Shpilevoy
2020-07-02 23:40 ` [Tarantool-patches] [PATCH 1/5] [tosquash] replication: fix multiple rollbacks Vladislav Shpilevoy
2020-07-05  9:34   ` Serge Petrenko
2020-07-05 15:13     ` Vladislav Shpilevoy [this message]
2020-07-02 23:40 ` [Tarantool-patches] [PATCH 2/5] [tosquash] applier: remove unnecessary fiber name check Vladislav Shpilevoy
2020-07-05  8:40   ` Serge Petrenko
2020-07-02 23:40 ` [Tarantool-patches] [PATCH 3/5] [tosquash] txn_limbo: fix release build Vladislav Shpilevoy
2020-07-05  8:41   ` Serge Petrenko
2020-07-02 23:40 ` [Tarantool-patches] [PATCH 4/5] [tosquash] replication: rework how local transactions wait sync Vladislav Shpilevoy
2020-07-05  9:04   ` Serge Petrenko
2020-07-05 15:13     ` Vladislav Shpilevoy
2020-07-02 23:40 ` [Tarantool-patches] [PATCH 5/5] [tosquash] replication: add test on local row in the end of sync txn Vladislav Shpilevoy
2020-07-05  9:11   ` Serge Petrenko
2020-07-05 15:13     ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516cd472-e01e-78f2-baed-fa9def76ce46@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/5] [tosquash] replication: fix multiple rollbacks' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox