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 CD0576EC55; Mon, 23 Aug 2021 14:32:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CD0576EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629718350; bh=PzARrfynpC4KrILhmTRQ7QFMW78oSgZ/xlbWdhgIN48=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=opgxFDoNR3nMkUHYXzokEg90thpwuDXCBtoM+RJhysThLTVkAVe68HgVBxq/rbNcl EioktEnw5viv8gc/iaGwf4el9xBiw4mLj5Ewa+nRxSDtMTE6MV0h23ialMe+qJjl3s 6fta1nq1y8l0tDbR7t5YmUuB+DrV7MEIbay3trds= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 5C7806EC55 for ; Mon, 23 Aug 2021 14:32:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C7806EC55 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1mI8Bo-0000zM-Ew; Mon, 23 Aug 2021 14:32:28 +0300 To: Vladislav Shpilevoy , Cyrill Gorcunov , tml References: <20210804190752.488147-1-gorcunov@gmail.com> <20210804190752.488147-3-gorcunov@gmail.com> Message-ID: Date: Mon, 23 Aug 2021 14:32:27 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD906AB4890CDABF0C5CB76CEE71D3E4007182A05F538085040D8A0DA28A37357E06F22267E116098FDF47BA97CC4CCE94A37E2FD35DA33A4A0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F1942E6D70B4A2F0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063769AE3176B9E099158638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89BE49F8135A498E6B562731EBD46EC76117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF80095D1E57F4578A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE4B6963042765DA4B86750DBF4DC650F2D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE31E44367C8E80A7B4C0837EA9F3D19764C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006377F02F59195295693EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5D8D8E7AFB4FA7803DAF80B8566BC499287A9604A2CEBBCC7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758B25CD4253D1D611410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F507C2EA0814E4502F1908120888EFF62BEB766AEA9DDF032AD3D075E6A18600FC9B1FBE39CD73821D7E09C32AA3244C8897A2F928897803E96717F15212CC19E8FBBEFAE1C4874CFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojI3k9oWyT/lKkE3P4peFNMA== X-Mailru-Sender: 583F1D7ACE8F49BD31DE23046B3A8460657FAB91BEB34D985416C09E869A86DDDF952411F53DE12A6BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v10 2/4] limbo: order access to the limbo terms 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" 06.08.2021 02:29, Vladislav Shpilevoy via Tarantool-patches пишет: > Thanks for the patch! > >> diff --git a/src/box/applier.cc b/src/box/applier.cc >> index f621fa657..9db286ae2 100644 >> --- a/src/box/applier.cc >> +++ b/src/box/applier.cc >> @@ -856,7 +856,7 @@ apply_synchro_row_cb(struct journal_entry *entry) >> applier_rollback_by_wal_io(entry->res); >> } else { >> replica_txn_wal_write_cb(synchro_entry->rcb); >> - txn_limbo_process(&txn_limbo, synchro_entry->req); >> + txn_limbo_process_locked(&txn_limbo, synchro_entry->req); >> trigger_run(&replicaset.applier.on_wal_write, NULL); >> } >> fiber_wakeup(synchro_entry->owner); >> @@ -867,11 +867,13 @@ static int >> apply_synchro_row(uint32_t replica_id, struct xrow_header *row) >> { >> assert(iproto_type_is_synchro_request(row->type)); >> + int rc = 0; >> >> struct synchro_request req; >> if (xrow_decode_synchro(row, &req) != 0) >> goto err; >> >> + txn_limbo_term_lock(&txn_limbo); > Maybe you should hide the lock from the API. Instead, do similar to > what transactions do: > > int txn_limbo_process_begin(limbo *); > void txn_limbo_process_commit(limbo *, request *); > void txn_limbo_process_rollback(limbo *); > > begin would take the lock, commit would do the request and > unlock, rollback would only unlock. Commit and rollback you > call from apply_synchro_row_cb depend in on the WAL write > result. > > Then the locks would disappear from the API, right? > > In the next patch you would make txn_limbo_process_begin() > also take the request to validate it. Then the 'filtering' > would become internal to the limbo. I agree with Vlad here. txn_limbo_process_begin()/commit()/rollback looks more clean than calling lock()/unlock() manually. Let's stick with Vlad's proposal then. > >> struct replica_cb_data rcb_data; >> struct synchro_entry entry; -- Serge Petrenko