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 92D6674173; Fri, 6 Aug 2021 02:30:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 92D6674173 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628206200; bh=o4YbyUBzp/PD53ILowCQ+bvW92dYog6tpBJtiXsPqNs=; 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=YwgBpO/kinDC0vAg407DFe0glPXnYIlqyGpY/BmslHwTHgEnzsV0p9MQqKqzMhXWr ByQwbwwWl0FWmsVw/AOeWgvigWZ4pypqncqQBfZ4Dea+tdxV6f0Oj0LIKH74+tSLdS 62cJ3cztIjxirYauvABx2bZFLtsa1xwLabx0hxII= 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 26C2E74173 for ; Fri, 6 Aug 2021 02:29:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 26C2E74173 Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1mBmoI-0002kk-Kf; Fri, 06 Aug 2021 02:29:59 +0300 To: Cyrill Gorcunov , tml References: <20210804190752.488147-1-gorcunov@gmail.com> <20210804190752.488147-3-gorcunov@gmail.com> Message-ID: Date: Fri, 6 Aug 2021 01:29:57 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210804190752.488147-3-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD94BB7C0677F3ED9D05EB08EAFC9298EA6182A05F5380850400CCC10C99D5380F8652D93397C110E39550497C8EA5689C0110936CF7A410949 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77BF46084C0059042EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A9545EB8D2325CAFEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2402942B37D33D03149135E2510141D59CC7F00164DA146DAFE8445B8C89999728AA50765F7900637DCE3DBD6F8E38AFD389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D166953D3EA3826BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C448B6BB855CD62D5C0837EA9F3D197644AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3138A1EA7309DD5C2BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE72F88032165008D51731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D94463893BF8742D0B8D654ABD2DA7417 X-C1DE0DAB: 0D63561A33F958A53B0EF3D43E111A8223D4CEB47A7E3BDBAA79252DCB82C87BD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7501A9DF589746230F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A5970F8A4685C8ABA871EA909001B1D11DEDBFC4C5C0263902E86ABF6D21E24182D96BF7B0B547361D7E09C32AA3244CBEC7CFFFCA76B77DC90C51DED1CAF5841DD47778AE04E04D729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojFhlvmGwdUwRves7lDPsXPQ== X-Mailru-Sender: 1F3202E75A95DDEFC23907419AE0C7D775C4FB212674149BA54C178819026EE328E5148A069DB2C507784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "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. > struct replica_cb_data rcb_data; > struct synchro_entry entry;