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 4219F6B95D; Tue, 13 Apr 2021 16:41:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4219F6B95D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618321267; bh=PzEsq1gri1o0LN7pmWnaYCqJVSd7Q9XODQXbWAaV1/s=; 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=d4zE6XSDBMFnBM9759zzl79XhTGgDwQm9WVhvKlMUB6f84tdHfm4mtGnnqhutkJqQ Vt7AcX+XO0rNUDyT4u7RA2wRLquX1Y0kir+eZ75ELJ8kbCxPQEGlAYYs6xGK44Elek m5EP9dPiqTT6gp6QuOn3sBwdLIHERRUoFHLJK0Ps= Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (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 9660C6B966 for ; Tue, 13 Apr 2021 16:29:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9660C6B966 Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1lWJ6Q-0000nk-2j; Tue, 13 Apr 2021 16:29:14 +0300 To: Cyrill Gorcunov Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org References: <0d29b025b7213b5c9596715d849b4b371e1fef32.1618256019.git.sergepetrenko@tarantool.org> Message-ID: <3b506907-d9e0-8e6e-f88c-3e6f9fab3b07@tarantool.org> Date: Tue, 13 Apr 2021 16:29:12 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.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: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D0F00AE41BB9A5343182A05F538085040251FA89BA5D7BD4F39B853ECAC5E5DD9E3E07DCE67CECBDA07CB5D7B673B41D4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE749E89BD568380EECC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7BA0D57D3459E5640EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA6584CA0D64092704E83D94F8AC85474C5D4F6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249B737A621A50BC793CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0B272A53F9BBAC8E28941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD26923F8577A6DFFEA7C1B940EDA0DFB05357B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FCCD848CCB6FE560C8FBB52F5C7ECD1BBB3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6753C3A5E0A5AB5B7089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A506EB374EAD467112CBE350F5958ABCCE405A963557078FE6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349C39CCCDAABCB54B8D6F52DEE51DD1A11C2D4E83A9B4B4E49F1EF3D000B0858DE4453022B7D052E01D7E09C32AA3244C8A229FE9CBD778217E51AD6AF2DD3A8E1E098CBE561D6343FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnA7/qPBUIXEul1IvZ1+dkg== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8454B5532F956633DB881C62FDB28E43DE9438CDA4132709F424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 1/9] wal: enrich row's meta information with sync replication flags 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" 13.04.2021 16:09, Cyrill Gorcunov пишет: > On Mon, Apr 12, 2021 at 10:40:14PM +0300, Serge Petrenko wrote: >> @@ -996,7 +996,13 @@ wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base, >> first_glob_row = row; >> } >> (*row)->tsn = tsn == 0 ? (*start)->lsn : tsn; >> - (*row)->is_commit = row == end - 1; >> + if (row < end - 1) >> + continue; > These two lines ^^ > Serge, why we need `continue` here at all? Why can't we simply drop the > above `if` saving a branch? > >> + /* Tx meta is stored in the last tx row. */ >> + if (row == end - 1) { >> + (*row)->opt_flags = entry->opt_flags; >> + (*row)->is_commit = true; >> + } > IOW, I mean > > (*row)->tsn = tsn == 0 ? (*start)->lsn : tsn; > (*row)->is_commit = row == end - 1; > if (row == end - 1) { > // Save meta > } Thanks for noticing! That's strange, indeed. Removed: diff --git a/src/box/wal.c b/src/box/wal.c index b7c69fc59..4ec8034a3 100644 --- a/src/box/wal.c +++ b/src/box/wal.c @@ -996,8 +996,6 @@ wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base,                                 first_glob_row = row;                         }                         (*row)->tsn = tsn == 0 ? (*start)->lsn : tsn; -                       if (row < end - 1) -                               continue;                         /* Tx meta is stored in the last tx row. */                         if (row == end - 1) {                                 (*row)->opt_flags = entry->opt_flags; -- Serge Petrenko