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 0F5FC6FC86; Sun, 25 Apr 2021 11:09:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0F5FC6FC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619338167; bh=MVzcfVwE/93d+VMN2tRTxLmxVWH0Gbsw3/yHW3SkVs0=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=u3Dv3Det7iI+dHl64r6sQDM0Wb/NKBPIQUILS5mDURsHn3Zf+5oeCIKpuH6ddLB2g tkjoUvFLpNNIR6qCO7cj6v1+CWihjIgdj/zSIc5Ih9jrp08NqWD3gH5TdnmVpV5xOz 9eiI7bnEYa+02hEu2/Z2FKzBpkI/7/0CcUZqLxTI= Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 16E6E6FC86 for ; Sun, 25 Apr 2021 11:09:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 16E6E6FC86 Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1laZpT-0002a1-Rd; Sun, 25 Apr 2021 11:09:24 +0300 To: Cyrill Gorcunov , tml References: <20210419083719.29689-1-gorcunov@gmail.com> <20210419083719.29689-3-gorcunov@gmail.com> Message-ID: Date: Sun, 25 Apr 2021 11:09:23 +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: <20210419083719.29689-3-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9203E2ABA940B7548DB5D504FB17EC32432A3176CEA2677EC182A05F5380850405245583F9F575CDF7DC0BCF64D2CCE5B6F69746D4D4C6F7F77CA8DA3A3093C6C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78C6616F30072131EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CE17C7754E00FC028638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B20404F90D6BEB8BC8C916BE1F3AD2317E79373A8315E4CF65D2E47CDBA5A96583C09775C1D3CA48CF253F27DA5A70FAF3117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7E4CD18687D5AE3809FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE78BD0D9EB147C554FD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C00CB8D3112395442FB3661434B16C20AC78D18283394535A9E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BCB5A162A2BD0125875ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD695C2ACC024BF1FE37F8FA56FA96C5DA X-C1DE0DAB: 0D63561A33F958A5C063703B2EB9A2A8E21B165F6BD2EB849BA34FA4E61DF2D2D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345CB6DE26F1654667533035F6479615BE80E867154E92C797E127AAEFD4261E4CEF98BF79CDDD927A1D7E09C32AA3244C4354D74C46A34EA705190C1066955032D9ADFF0C0BDB8D1F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj08M52wfuxcGOxi/sB8tJsg== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F845F9B4EE1913C220BC8CC8146BAC59200A224D6C2D12490E424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 2/3] txn_limbo: simplify owner migration condition 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 Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 19.04.2021 11:37, Cyrill Gorcunov пишет: > When limbo owner is about to change the state we should check > if there are some pending transactions which are not yet processed, > iow if queue is empty. No need to test if current limbo owner > is zero. The owner is set to zero once -- when limbo is created > during initialization. > > After all I think even if owner would ever zero and we're about > to change it the queue simply must be empty, that is the only > safe state. > > Acked-by: Vladislav Shpilevoy > Signed-off-by: Cyrill Gorcunov > --- > src/box/txn_limbo.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c > index addcb0f97..2a10bd0ae 100644 > --- a/src/box/txn_limbo.c > +++ b/src/box/txn_limbo.c > @@ -94,8 +94,7 @@ txn_limbo_append(struct txn_limbo *limbo, uint32_t id, struct txn *txn) > id = instance_id; > bool make_ro = false; > if (limbo->owner_id != id) { > - if (limbo->owner_id == REPLICA_ID_NIL || > - rlist_empty(&limbo->queue)) { > + if (rlist_empty(&limbo->queue)) { > limbo->owner_id = id; > limbo->confirmed_lsn = 0; > if (id != instance_id) Thanks for the patch! LGTM. -- Serge Petrenko