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 8E0F46EC5F; Wed, 21 Apr 2021 01:30:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E0F46EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618957844; bh=bI9N1LdcbliaQL0mnzjvkQr6dpMmFrahHgxL5RhmYeg=; 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=rv9Th96u+7b9cpXI9/PjI2/Z93nIcl/FSpBJb62zaV0cuFX9U5KhYnCxiCcvuaFqX 3NixRgCgbWj3imGJ2/13lLqocBa5gkyOBihNlx9DjZAosH2nKhEiIi1UeVQnVheyXz 3xlLaculUQ28soNlzQLqK7KN4EHxyrAuYKYyXGXQ= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 72CA76EC5F for ; Wed, 21 Apr 2021 01:30:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 72CA76EC5F Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1lYyt2-00009i-Km; Wed, 21 Apr 2021 01:30:29 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <716a7e7c-0f4f-34bb-1d2e-f995f679d868@tarantool.org> Date: Wed, 21 Apr 2021 00:30:27 +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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748094FADAEB10E66ADA4C48BE3C291E66DA182A05F538085040630B2AB1453D66D01223C898633F10F36059B7951B1068E972BD419885B577D6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7911D8D445CDAD2FBEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B62B20346743B7D18638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2DB483265F91BBFB1579874F3E1A1082132051A2C76225635D2E47CDBA5A96583C09775C1D3CA48CF27ED053E960B195E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77FFCE1C639F4728C9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE701A9DF589746230F7B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FB28585415E75ADA9C5236E9430F51F07B3661434B16C20AC78D18283394535A9E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B654CE8ED7C2D004275ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD4A55790139E197E69C3B8C010BE0EF80 X-C1DE0DAB: 0D63561A33F958A57CB3F5FEF65C9ED7066D6E5B581818951C6BDF99A820ECCCD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3430FC2BC1B917F018F367310BF8B2BD00322D5AFDC22D7F6BB4CC76F70F45405BE469E5953EB0DD201D7E09C32AA3244C23DC65990FF8A7BFCE1B6508B340DFF03E8609A02908F271FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlPRl29Bx4WGeiL9uVtiXsw== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA311094DE23CA03102C42E07CAFAFBB6346EEFA5A2C35B8A07CEC07784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 05/12] box: make clear_synchro_queue() write a PROMOTE entry instead of CONFIRM + ROLLBACK 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" Thanks for the patch! Consider this commit on top of yours on the branch sp/gh-5445-election-fixes-review: ==================== [tosquash] Pass args explicitly to read_promote Firstly, to be consistent with the other read_*() functions. Secondly, one of the next patches is going to change promote lsn, and it should not change the original struct synchro_request or copy it for a change. diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 0d2d274f6..8668eb964 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -487,13 +487,13 @@ txn_limbo_write_promote(struct txn_limbo *limbo, int64_t lsn, uint64_t term) * rollback all entries > @a req.lsn. */ static void -txn_limbo_read_promote(struct txn_limbo *limbo, - const struct synchro_request *req) +txn_limbo_read_promote(struct txn_limbo *limbo, uint32_t replica_id, + int64_t lsn) { - txn_limbo_read_confirm(limbo, req->lsn); - txn_limbo_read_rollback(limbo, req->lsn + 1); + txn_limbo_read_confirm(limbo, lsn); + txn_limbo_read_rollback(limbo, lsn + 1); assert(txn_limbo_is_empty(&txn_limbo)); - limbo->owner_id = req->origin_id; + limbo->owner_id = replica_id; limbo->confirmed_lsn = 0; } @@ -660,7 +660,7 @@ txn_limbo_process(struct txn_limbo *limbo, const struct synchro_request *req) txn_limbo_read_rollback(limbo, req->lsn); break; case IPROTO_PROMOTE: - txn_limbo_read_promote(limbo, req); + txn_limbo_read_promote(limbo, req->origin_id, req->lsn); break; default: unreachable();