Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing
Date: Fri, 19 Jun 2020 20:35:02 +0300	[thread overview]
Message-ID: <a92e05c9-98d7-db08-7f9b-10c46b5c71eb@tarantool.org> (raw)
In-Reply-To: <4229c1b6-54e1-3c84-c902-37d49d3658c6@tarantool.org>


19.06.2020 01:15, Vladislav Shpilevoy пишет:
> Thanks for the patch!

Thanks for the review!

>
>> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
>> index a715a136e..c55f5bda1 100644
>> --- a/src/box/txn_limbo.c
>> +++ b/src/box/txn_limbo.c
>> @@ -84,6 +84,16 @@ txn_limbo_remove(struct txn_limbo *limbo, struct txn_limbo_entry *entry)
>>   	rlist_del_entry(entry, in_queue);
>>   }
>>   
>> +static inline void
>> +txn_limbo_pop(struct txn_limbo *limbo, struct txn_limbo_entry *entry)
>> +{
>> +	assert(!rlist_empty(&entry->in_queue));
>> +	assert(rlist_last_entry(&limbo->queue, struct txn_limbo_entry,
>> +				 in_queue) == entry);
>> +	(void) limbo;
>> +	rlist_del_entry(entry, in_queue);
>> +}
> txn_limbo_remove is exactly the same as txn_limbo_pop. I suggest to keep
> one of them.
>
> Everything else looks nice.

Assertions are different. I wanted to stress  that `pop` removes entries 
starting

from the tail, and `remove`, on the contrary,  removes them starting 
from the

head.

Looks strange, though, I agree.

If  you merge the functions and put an assertion

`rlist_first_entry == ... || rlist_last_entry == ...`

you'll lose some strictness in their use.

Feel free to decide what to do.


-- 
Serge Petrenko

  reply	other threads:[~2020-06-19 17:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 12:13 [Tarantool-patches] [PATCH 0/4] sync replication: add rollback processing Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 1/4] xrow: fix comment typo Serge Petrenko
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-19 17:28     ` Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 2/4] xrow: add ability to encode/decode ROLLBACK requests Serge Petrenko
2020-06-18 14:46   ` Cyrill Gorcunov
2020-06-19 17:30     ` Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 3/4] txn_limbo: add timeout when waiting for acks Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing Serge Petrenko
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-19 17:35     ` Serge Petrenko [this message]
2020-06-21 15:53       ` Vladislav Shpilevoy
2020-06-19 17:53   ` Serge Petrenko
2020-06-23  8:37   ` Serge Petrenko
2020-06-25 22:14   ` Vladislav Shpilevoy
2020-06-25 22:43     ` 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=a92e05c9-98d7-db08-7f9b-10c46b5c71eb@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing' \
    /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