From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Cyrill Gorcunov <gorcunov@gmail.com> Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v2 2/7] applier: extract tx boundary checks from applier_read_tx into a separate routine Date: Sat, 27 Mar 2021 19:54:52 +0300 [thread overview] Message-ID: <d81c395a-1960-3f05-b668-969c000c7403@tarantool.org> (raw) In-Reply-To: <YF3VHtksAUxyc3/k@grain> 26.03.2021 15:35, Cyrill Gorcunov пишет: > On Wed, Mar 24, 2021 at 03:24:12PM +0300, Serge Petrenko wrote: >> Introduce a new routine, set_next_tx_row(), which checks tx boundary >> violation and appends the new row to the current tx in case everything >> is ok. >> >> set_next_tx_row() is extracted from applier_read_tx() because it's a >> common part of transaction assembly both for recovery and applier. >> >> The only difference for recovery will be that the routine which's >> responsible for tx assembly won't read rows. It'll be a callback ran on >> each new row being read from WAL. >> >> Prerequisite #5874 >> Part-of #5566 >> --- >> src/box/applier.cc | 117 +++++++++++++++++++++++---------------------- >> 1 file changed, 60 insertions(+), 57 deletions(-) >> >> diff --git a/src/box/applier.cc b/src/box/applier.cc >> index 326cf18d2..65afa5e98 100644 >> --- a/src/box/applier.cc >> +++ b/src/box/applier.cc >> @@ -657,6 +657,64 @@ applier_read_tx_row(struct applier *applier) >> return tx_row; >> } >> >> +static inline int64_t >> +set_next_tx_row(struct stailq *rows, struct applier_tx_row *tx_row, int64_t tsn) > Serge, why it is "inline"? I propose to not use inline until really needed. > The compiler may ignore inline word, same time if function is small the > compiler may inline it as a part of optimisation stage. > > Not a big deal, feel free to ignore, but I see "inline" is used too much all over the code :( > > https://www.kernel.org/doc/html/v4.10/process/coding-style.html#the-inline-disease Thanks for the review! No problem. diff --git a/src/box/applier.cc b/src/box/applier.cc index 65afa5e98..00869d480 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -657,7 +657,7 @@ applier_read_tx_row(struct applier *applier) return tx_row; } -static inline int64_t +static int64_t set_next_tx_row(struct stailq *rows, struct applier_tx_row *tx_row, int64_t tsn) { struct xrow_header *row = &tx_row->row; -- Serge Petrenko
next prev parent reply other threads:[~2021-03-27 16:54 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-24 12:24 [Tarantool-patches] [PATCH v2 0/7] applier: handle synchronous transactions during final Serge Petrenko via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 1/7] replication: fix a hang on final join retry Serge Petrenko via Tarantool-patches 2021-03-26 20:44 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-27 16:52 ` Serge Petrenko via Tarantool-patches 2021-03-29 21:50 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 2/7] applier: extract tx boundary checks from applier_read_tx into a separate routine Serge Petrenko via Tarantool-patches 2021-03-26 12:35 ` Cyrill Gorcunov via Tarantool-patches 2021-03-27 16:54 ` Serge Petrenko via Tarantool-patches [this message] 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 3/7] applier: extract plain tx application from applier_apply_tx() Serge Petrenko via Tarantool-patches 2021-03-26 20:47 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-27 17:34 ` Serge Petrenko via Tarantool-patches 2021-03-27 18:30 ` [Tarantool-patches] [PATCH v2 3.5/7] applier: fix not releasing the latch on apply_synchro_row() fail Serge Petrenko via Tarantool-patches 2021-03-29 21:50 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-30 8:15 ` Serge Petrenko via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 4/7] applier: remove excess last_row_time update from subscribe loop Serge Petrenko via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 5/7] applier: make final join transactional Serge Petrenko via Tarantool-patches 2021-03-26 20:49 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-27 19:05 ` Serge Petrenko via Tarantool-patches 2021-03-29 21:51 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-30 8:15 ` Serge Petrenko via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 6/7] replication: tolerate synchro rollback during final join Serge Petrenko via Tarantool-patches 2021-03-24 12:45 ` Serge Petrenko via Tarantool-patches 2021-03-26 20:49 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-27 19:23 ` Serge Petrenko via Tarantool-patches 2021-03-24 12:24 ` [Tarantool-patches] [PATCH v2 7/7] replication: do not ignore replica vclock on register Serge Petrenko via Tarantool-patches 2021-03-26 20:50 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-27 20:13 ` Serge Petrenko via Tarantool-patches 2021-03-29 21:51 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-30 8:16 ` Serge Petrenko via Tarantool-patches 2021-03-30 12:33 ` Serge Petrenko via Tarantool-patches 2021-03-26 13:46 ` [Tarantool-patches] [PATCH v2 0/7] applier: handle synchronous transactions during final Cyrill Gorcunov via Tarantool-patches 2021-03-30 20:13 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-05 16:15 ` Kirill Yukhin 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=d81c395a-1960-3f05-b668-969c000c7403@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=gorcunov@gmail.com \ --cc=sergepetrenko@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v2 2/7] applier: extract tx boundary checks from applier_read_tx into a separate routine' \ /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