From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] limbo: introduce request processing hooks
Date: Mon, 12 Jul 2021 10:03:32 +0200 [thread overview]
Message-ID: <4965b115-dd42-0129-0086-a0ff711fa648@tarantool.org> (raw)
In-Reply-To: <YOs27RWrVzEdr/M3@grain>
>> This simply should not be possible. The term map is updated only
>> after WAL write is done. At least this is how it works now, doesn't
>> it? Why did you change it? (In case you did, because I am not sure,
>> I didn't review the code throughly).
>
> Look, I think this maybe not explicitly seen from the patch since
> diff is big enough. But here is a key moment. Current code is called
> after WAL is updated
>
> void
> txn_limbo_process(struct txn_limbo *limbo, const struct synchro_request *req)
> {
> uint64_t term = req->term;
> uint32_t origin = req->origin_id;
> if (txn_limbo_replica_term(limbo, origin) < term) {
> vclock_follow(&limbo->promote_term_map, origin, term);
> if (term > limbo->promote_greatest_term) {
> limbo->promote_greatest_term = term;
> } else if (req->type == IPROTO_PROMOTE) {
> /*
> * PROMOTE for outdated term. Ignore.
> */
> --> return;
> }
> }
>
> we exit early without any error.
>
> In new approach we start reporting an error if this situation is
> happening, 'cause it is a split brain. But we shall not write this
> term into our WAL file, thus we should validate incoming packet
> earlier.
>
> Now imagine the following: we validated the incoming packet and
> remember its term in promote_term_map, then we start writting
> this packet into our WAL and write procedure failed.
That is the core problem of your entire approach - why do you imagine
we update promote_term_map before writing to WAL? We do not do that.
And you should not do that. Before WAL write there should no be any
changes. **Zero changes before WAL write**. Before you write to WAL,
you can only validate requests. Using `const struct txn_limbo *`. With
zero changes.
next prev parent reply other threads:[~2021-07-12 8:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-10 22:28 Cyrill Gorcunov via Tarantool-patches
2021-07-11 14:00 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-11 18:22 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 8:03 ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-07-12 8:09 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 21:20 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-12 22:32 ` Cyrill Gorcunov via Tarantool-patches
2021-07-13 19:32 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-12 8:01 ` Serge Petrenko via Tarantool-patches
2021-07-12 8:04 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-12 8:12 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 8:23 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 21:20 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-12 22:34 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 9:43 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 15:48 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 16:49 ` Serge Petrenko via Tarantool-patches
2021-07-12 17:04 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 21:20 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-12 21:52 ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 7:54 ` Serge Petrenko via Tarantool-patches
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=4965b115-dd42-0129-0086-a0ff711fa648@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=gorcunov@gmail.com \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH] limbo: introduce request processing hooks' \
/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