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 BA54E6FC8B; Sun, 25 Apr 2021 18:47:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BA54E6FC8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619365650; bh=XDn463nA8kQZy38OYZzmaVMPOFfiIhpLiudH+bWaWKs=; 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=kM+IQKZAMdNxKn6e4rbwVnxQ4vygCCsvcrrGtn4nzAMHTKRnt2Ow8eElkPb0yy11l cN/olOcOC+Odq3zxiW95PXEBZcqWDoVVbBDj1eUIbhcoSM7yOgs8ubVV23rX2w+jr2 paqKUhoB/zuv+LSNLjZqQRhHTQLSCWd4hkd/oAYg= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 412726FC86 for ; Sun, 25 Apr 2021 18:47:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 412726FC86 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lagym-0005n6-H2; Sun, 25 Apr 2021 18:47:28 +0300 To: Serge Petrenko , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com References: <15101a51fcd1441813a384fef9f670150b522a3d.1619224125.git.v.shpilevoy@tarantool.org> Message-ID: <74b6725d-c087-bba4-d970-2ceae0ba95ce@tarantool.org> Date: Sun, 25 Apr 2021 17:47:27 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9203E2ABA940B754838BCE75048F11F6FD8B83E4765829057182A05F538085040C86D7009DF1742D64F70AFE7CF142DFB377316DF06477C3F412EE32A91520F59 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7952C4D7BD0BF3359EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377A2EA98384B91C6C8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B20493532B8EDC1D23342C8769F8BD1ED1CB629EEF1311BF91D2E47CDBA5A96583C09775C1D3CA48CFE478A468B35FE767117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE74A95F4E53E8DCE969FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E625235872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5443EC77964BEF37FFFF5BB20682E448DF1BF1E729BEB3B10D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AF61ACC197BF517AF03C91E3AC87663A4AF423CE9A91AF5A2B4CAFA7528D9E3ED178C62DD1D156451D7E09C32AA3244C92BE57D28D2F766230EF3AF1093E390397FE24653F78E668FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj08M52wfuxcGUPK1bLnysbQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822847FD2F0067F84488D5834ED9B5B0C803841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/1] txn: destroy commit and rollback triggers 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" Hi! Thanks for the review! >> diff --git a/src/box/txn.c b/src/box/txn.c >> index 03b39e0de..4dfe1ad82 100644 >> --- a/src/box/txn.c >> +++ b/src/box/txn.c >> @@ -150,7 +150,7 @@ txn_rollback_one_stmt(struct txn *txn, struct txn_stmt *stmt) >>       if (txn->engine != NULL && stmt->space != NULL) >>           engine_rollback_statement(txn->engine, txn, stmt); >>       if (stmt->has_triggers) >> -        txn_run_rollback_triggers(txn, &stmt->on_rollback); >> +        txn_run_rollback_triggers(txn); >>   } > > > 1. This piece ran stmt->on_rollback, and you run txn->on_rollback now. >    These are not the same, for example check txn_rollback_to_svp below. Indeed, I added a bug here, thanks for noticing. In v2 I removed these run_rollback/run_commit functions. For the statement triggers I added an assertion that they don't have a 'destroy' method. Because if they would have, on commit we would need to walk the statement list and for each statement destroy its rollback triggers, which would add notable complexity. >> diff --git a/src/box/vinyl.c b/src/box/vinyl.c >> index b53e97593..d381179d0 100644 >> --- a/src/box/vinyl.c >> +++ b/src/box/vinyl.c > ... > > > 2. There's also applier_txn_rollback_cb() in applier.cc >    You should probably  clear it as  well. In v2 I deleted all trigger clears. >> diff --git a/test/app-tap/gh-6025-box.on_commit-leak.test.lua b/test/app-tap/gh-6025-box.on_commit-leak.test.lua >> new file mode 100755 >> index 000000000..ec4e8b099 >> --- /dev/null >> +++ b/test/app-tap/gh-6025-box.on_commit-leak.test.lua > > 3. The test's cool, I wouldn't have come up with it myself. >    Shouldn't it be in box-tap though? Yes, this is about box, and I didn't think of box-tap. Moved there now. I've sent v2 since the patch is too different now and the diff would look not very easy to understand.