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 A622A6E200; Fri, 18 Jun 2021 11:55:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A622A6E200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1624006557; bh=M9FxJPp4vaS+eyiakhiT2ivCeQY3h9MA+PshHxRUmvE=; 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=sWUmOqmjeSUza78mxYh3BMloFj23TymKumNJTyukN/3bYRJQ4ELN0MrjWgGagNQGf xFfZ04FWeMHeqaLddRY6yiiR+UkkmhZgsPsbRdfNONgcUtsZfJWZ6Wr9coI2LlVjpG Vtd1bT+RLet6L3vc106VIxjo+DJ52EK0Hj8d+xSE= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 3CBAC6E200 for ; Fri, 18 Jun 2021 11:55:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3CBAC6E200 Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1luAI7-0001YC-EH; Fri, 18 Jun 2021 11:55:55 +0300 To: Cyrill Gorcunov Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org References: Message-ID: Date: Fri, 18 Jun 2021 11:55:54 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91C2C07775F13263A080EBBC2798314FD6D883CD5D486D97500894C459B0CD1B9BD3978B1DC4B0631F9005D3709293EC0E264FE4A3DC9BCF13626EDF265A3AB3D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FDD1BFA4357CD022EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063702DFA59B3C994360EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404C57B5A77D19C5E05CADF0EA418EF0B3FCC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC81D471462564A2E19F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B53A69B3AC30C7B9475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5B35158A36ECE1A79A0CD6EB1BAF66D633288868473F45F43D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348E5EF936B2E46EBA967B212817CABF84E3DB0AC075859FDFDC0DDA926F320669C1DE909ED908D1161D7E09C32AA3244C48532BDCA8C2D2303E3261BF70AFF42C3A92A9747B6CC886FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0Roc5o5ut95Wg1Xms6YePA== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446E3F5343137DC6465F3EC0B355F2F749BBCACAA7F4E72D1FE424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 2/8] txn_limbo: fix promote term filtering 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" 18.06.2021 01:05, Cyrill Gorcunov пишет: > On Fri, Jun 18, 2021 at 12:07:36AM +0300, Serge Petrenko wrote: >> txn_limbo_process() used to filter out promote requests whose term was >> equal to the greatest term seen. This wasn't correct for PROMOTE entries >> with term 1. > ... >> + if (term > limbo->promote_greatest_term) { >> + limbo->promote_greatest_term = term; >> + } else if (req->type == IPROTO_PROMOTE && >> + limbo->promote_greatest_term > 1) { >> + /* PROMOTE for outdated term. Ignore. */ >> + say_info("RAFT: ignoring PROMOTE request from instance " >> + "id %"PRIu32" for term %"PRIu64". Greatest term seen " >> + "before (%"PRIu64") is bigger.", origin, term, >> + limbo->promote_greatest_term); >> + return; >> } > Serge, please don't use PRIx helper, they are completely unreadable. > As far as I remember we agreed to use %llu with explicit long long > conversion. Ie > > say_info("RAFT: ignoring PROMOTE request from instance " > "id %u for term %lld . Greatest term seen " > "before (%llu) is bigger.", origin, (long long)term, > (long long)limbo->promote_greatest_term); > > surely we can fix it on top of the series. Ok, sure. I thought this was fine. Let's change. ================================ diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index a5d1df00c..e91782b40 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -674,9 +674,9 @@ txn_limbo_process(struct txn_limbo *limbo, const struct synchro_request *req)                    limbo->promote_greatest_term > 1) {                 /* PROMOTE for outdated term. Ignore. */                 say_info("RAFT: ignoring PROMOTE request from instance " -                        "id %"PRIu32" for term %"PRIu64". Greatest term seen " -                        "before (%"PRIu64") is bigger.", origin, term, -                        limbo->promote_greatest_term); +                        "id %u for term %llu. Greatest term seen " +                        "before (%llu) is bigger.", origin, (long long)term, +                        (long long)limbo->promote_greatest_term);                 return;         } ================================ -- Serge Petrenko