From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id F36096F3C8; Sat, 27 Mar 2021 19:54:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F36096F3C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616864095; bh=0e7QsWEQcmuhu2TKsQ3GGPjCsLveccAg+stkguaZoj4=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=zduS8KvSPk4jcy2YrKDKPYvM8FcJv35zNhpfbJVrqVX3gVxkyOKXjlpQSX0KoVPer F/LP0bYw2X+2kFI/Nhcm0FTOUZApTcNLUXBQgPcw554Jn00W/PFRdEUymWBU7wYXd+ YF1kPXARDoysCLM3wXAkCXxfehmKw21nElDzMi/U= Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EFC6F6F3C8 for ; Sat, 27 Mar 2021 19:54:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EFC6F6F3C8 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1lQCD7-0003Kl-Ch; Sat, 27 Mar 2021 19:54:53 +0300 To: Cyrill Gorcunov Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org References: <31d242da3f691029c6fc670c902290a77fe36ae1.1616588119.git.sergepetrenko@tarantool.org> Message-ID: Date: Sat, 27 Mar 2021 19:54:52 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E3294DD38BE31D7797EF84C856624A09E4809182A05F538085040726D3F1512980A91BDBB25F74C423370B571F5FC296F50202A929C0299B3E61B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE731D82F3F177D3BCDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371758572763D318798638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7428A34725AB662D7E61754EB5B5D90D4C24D30BAE0E12F6A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3543F342AA183667F117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF326391042396B1B4BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6376099FB6407AE4476E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249B372FE9A2E580EFC725E5C173C3A84C31BC2FD6A5287AC5335872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824AC8B6CDF511875BC4E8F7B195E1C9783197D7372EF6D2FEBB7F2A1029DE4F4808 X-C1DE0DAB: 0D63561A33F958A503152F13F00EB391610B259B8782D7D5D09F5EA31FDD65A6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34087368DEEB028F176983F09B828CBE46496598AC4165F60D6EDD4A47D8F4A0C6D4A796AD62FB51061D7E09C32AA3244C57F47A7CDDF66DC79DACF23612880E89C86C126E7119A0FEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhfg4BOnpz0q/B6en4U+TGw== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F80A214FB5B7BBA3C905183F6C67EB8B59A8BF8CD91361CE7B424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 2/7] applier: extract tx boundary checks from applier_read_tx into a separate routine X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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