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 6C5E86FC8F; Fri, 16 Apr 2021 02:18:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6C5E86FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618528686; bh=BKvxhgbbObiSzaN05Vpg+w6OoxU7ziWWlD6e6i34RIA=; 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=Qcskg8AWAie782muG4T6LKaK8beacbJlw+aEH/p2NT6lgtEPepUossefsSai+2eoo jhtWRmpS/2F/cc+RS25yMkTabmqz6J9f6muWLTUZJvemuZsy6hemtol7716My/oi4O jBDqyHRKqqdjDhiJyiXIeVt8N1NWFJGo56swn9w8= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 DFBC26FC8F for ; Fri, 16 Apr 2021 02:18:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DFBC26FC8F Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1lXBFM-0001O4-9c; Fri, 16 Apr 2021 02:18:04 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <32099031-d261-5887-538a-86d770a15617@tarantool.org> Date: Fri, 16 Apr 2021 01:18:03 +0200 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 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D5E28B957962BB550182A05F5380850400C33652CAA3609E6F41202FA24F281E1E885B0A8DE3973BDEE1F9E6365DB88F7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728A881FD0F09D355EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A6C16C7015BEC7F48638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B23F971ECD3D16CA3A443E2D47602180D90E47C10036089472D2E47CDBA5A96583C09775C1D3CA48CF4964A708C60C975A117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7E4DF6D1C10F22F599FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE77E32032FFBECC12DD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0FDDE6B248FE68657CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C34B08FA16E56A400835872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD6C30AE2B5E62355B5BD24B616703BB92 X-C1DE0DAB: 0D63561A33F958A58DD1F6273746EB423CE18E0B13E53D818FD2511C3ABEE29CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34351729636A02D1DE0E819D270F16741BCF040DA5924C4413D8E385CD16E5A3E01A55DC83D4DE6CB21D7E09C32AA3244C21F521E16F1145EBFB8A16C8A3263C55A8CE788DE6831205FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3S6P1v0GIqSnqJOxHi7hlQ== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA3110B8B538DEEAEA8B2030EEC2B0CCEF94372241BB377472528A07784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 01/10] 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Good job on the patch! See 3 comments below. > diff --git a/src/box/journal.h b/src/box/journal.h > index 76c70c19f..3ce9c869e 100644 > --- a/src/box/journal.h > +++ b/src/box/journal.h > @@ -63,6 +63,7 @@ struct journal_entry { > * A journal entry completion callback argument. > */ > void *complete_data; > + uint8_t opt_flags; 1. I propose to call them just flags. There is no a third value like 'no flag'. They are either set or not, am I right? Also the member is missing a comment. The most important thing to say - these flags are only for the last row. > /** > * Asynchronous write completion function. > */ > @@ -97,6 +98,7 @@ journal_entry_create(struct journal_entry *entry, size_t n_rows, > entry->approx_len = approx_len; > entry->n_rows = n_rows; > entry->res = -1; > + entry->opt_flags = 0; 2. You could initialize it with IPROTO_FLAG_COMMIT right here and drop (*row)->is_commit = true from wal_assign_lsn. But this one up to you. Maybe it is not a good idea. > } > > /** > diff --git a/src/box/wal.c b/src/box/wal.c > index 34af0bda6..4ec8034a3 100644 > --- a/src/box/wal.c > +++ b/src/box/wal.c > @@ -962,14 +962,14 @@ out: > */ > static void > wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base, > - struct xrow_header **row, > - struct xrow_header **end) > + struct journal_entry *entry) 3. This part could be a separate commit, otherwise it is hard to see the functional changes. Up to you if you want to split. > { > int64_t tsn = 0; > - struct xrow_header **start = row; > - struct xrow_header **first_glob_row = row; > + struct xrow_header **start = entry->rows; > + struct xrow_header **end = entry->rows + entry->n_rows; > + struct xrow_header **first_glob_row = entry->rows; > /** Assign LSN to all local rows. */ > - for ( ; row < end; row++) { > + for (struct xrow_header **row = start; row < end; row++) { > if ((*row)->replica_id == 0) { > /* > * All rows representing local space data