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 524CC6FC8E; Mon, 26 Apr 2021 12:37:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 524CC6FC8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619429873; bh=4sdsgEbuRwRQHtKaE5xbf6qw/LDM/fmfAZPAWaa4oB0=; 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=MhggJHPrf8SlIHLK8T2i+gxztawNBM9aB1151/uiLIHSwrD826wkXMswqXelw9nsK SzXNxgy3l69lY86zXtqpn1IKyL8UiDwk/bcFNxPwo6uc8Dsg7FbzCkb1iAnKETzkPk qUklgLsWXUOQfCJa9uG2SusgjBTXW/ciuFyUFYNU= Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 E80A46FC8E for ; Mon, 26 Apr 2021 12:37:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E80A46FC8E Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1laxgd-0004vs-6B; Mon, 26 Apr 2021 12:37:51 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com References: Message-ID: <94d0fd7b-3e3f-c86a-f264-d7113ec5c71b@tarantool.org> Date: Mon, 26 Apr 2021 12:37:50 +0300 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; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9ECFD8CE5F05940103F64F7B2B6947DF2DC80D3601B233994182A05F5380850404B2FD3C0D1A5CF7A9A2808E4F0B60F6A81895AD7DB14C766047D024C9446EEDD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE731D82F3F177D3BCDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379428F6EA0D091379EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA6584D3528321563A013419F507A135AF725F6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249AEEA5BB16A939343CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C02F11D39E7306DD338941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B9773546858BEBD2CECBDC7B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FB28585415E75ADA968E75A379BAF682BB3661434B16C20AC78D18283394535A9E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9149C560DC76099D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5D3BBC8F100B9B961C18411EF60EB27523170350645766633D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A9873270276D433462F4D2285997DE004EC729AD9C2FF3D85A13D591E0FA5C15665D053A39AEC1CD1D7E09C32AA3244C067454A40E71DBF59E21B77D67257A25795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmUj/IHfqgKe+d+qpQTmoAQ== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F87D55713541A008EE022BC9A96C94D60F93F24E6368C5BC1F424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 25.04.2021 18:42, Vladislav Shpilevoy пишет: > They were not deleted ever. Worked fine for DDL and replication, > for which they were introduced in the first place, because these > triggers are on the region memory. > > But didn't work when the triggers became available in the public > API, because these are allocated on the heap. As a result, all the > box.on_commit() and box.on_rollback() triggers leaked. > > The patch ensures all the on_commit/on_rollback triggers are > destroyed. > > The statement triggers on_commit/on_rollback are left intact since > they are private and never need deletion, but the patch adds > assertions in case they ever would need to be destroyed. > > Another option was to force all the commit and rollback triggers > clear themselves. For example, in case of commit all the on_commit > triggers must clear themselves, and the rollback triggers are > destroyed. Vice versa when a rollback happens. This would allow > not to manually destroy on_commit triggers in case of commit. But > it didn't work because the Lua triggers all work via a common > runner lbox_trigger_run(), which can't destroy its argument in > most of the cases (space:on_replace, :before_replace, ...). It > could be patched but requires to add some work to the Lua triggers > affecting all of them, which in total might be not better. > > Closes #6025 > --- > Changes in v2: > - Fixed a bug about txn rollback triggers called at statement > rollback, added a test; > - Removed attempts to destroy and clear statement triggers; > > Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-6025-box.on_commit-leak > Issue: https://github.com/tarantool/tarantool/issues/6025 > Hi! Thanks for the fixes! LGTM. -- Serge Petrenko