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 E7964BDDCD6; Thu, 15 Feb 2024 16:53:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E7964BDDCD6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1708005204; bh=NihTwoNwYZgCaeqtWofLIiHEXyZjfgHftGuq6qJ0hFY=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=DphOg5usNX3FHecx8jvE++rEY1XUMAg0Ugi7i4aEVmoddPRUKzSfJMCmbtx+lDt+3 wd7RVD/08kMO7HkgyOKbVEg0+83aHuaQxlgsrEOop6GiCR4e7Byi40bj8cmxXk/eSB X4H1syOYIKC1P5GBieKJFrk8/O3akqRjxWJ2s54Y= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [95.163.41.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0A047BDDCDC for ; Thu, 15 Feb 2024 16:53:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0A047BDDCDC Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1racAo-0000000ES2P-1CGQ; Thu, 15 Feb 2024 16:53:10 +0300 Date: Thu, 15 Feb 2024 13:41:43 +0000 To: Sergey Kaplun Message-ID: References: <20231211153520.9322-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231211153520.9322-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9001F8F2F6BAD20213FE3C35E3505503959F43E1962753F3400894C459B0CD1B91F0F93212C7ED14A09C7FE911581F5CCC35A15BB884DD151C22E05930F76FB476412C2FA36F3267F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75037DDE13FB75316EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D70459430292EC88638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8F40EE5B12D74D7207E1041AE5A7A86D3E5E175F23218DC50CC7F00164DA146DAFE8445B8C89999728AA50765F7900637DCE3DBD6F8E38AFD389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8A9FF340AA05FB58CF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C2A336C65186350916E0066C2D8992A164AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C32F36E1858E9CF555BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF17B107DEF921CE791DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C321259270BBF67A2035872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A504D5CC73387AA70E5002B1117B3ED69609497635A8B87232B74D9144D44E4FCF823CB91A9FED034534781492E4B8EEAD0AA277257C6A5E3DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF7DB222FC05F008B1C28A77939C9CD51D0BC1727E1F13EF36570822EDF9CC6B79E80DAFFC47B24EFF3168784816B2568486856F2DD503AC8D30BE43528131C9F4CD55FFE6E4EB68D8C226CC413062362A913E6812662D5F2A74A26541E23E71317A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojQ9gr3ZFpXEn0LKcIoqJfEg== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53108A766A982747F158BD48BD36611AD34A83B154706FE466369F61AECD8A390ADF5EE5212A79745119D086FC03DADA47A24EDF3BD9585A06DEEABBE9EE6587A054198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Emit sunk IR_NEWREF only once per key on snapshot replay. 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/3.0 and release/2.11. On 11.12.23, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > Thanks to Sergey Kaplun and Peter Cawley. > > (cherry-picked from commit 1761fd2ef79ffe1778011c7e9cb03ed361b48c5e) > > Assume we have the parent trace with the following IRs: > > | 0001 } tab TNEW #0 #0 > | 0002 } p32 NEWREF 0001 "key" > | 0003 } fal HSTORE 0002 false > | .... SNAP #1 [ ---- ---- 0001 ---- ] > | 0004 > num SLOAD #1 T > | .... SNAP #2 [ ---- ---- 0001 ] > | 0005 > num EQ 0004 0004 > | 0006 } tru HSTORE 0002 true > | .... SNAP #3 [ ---- ---- 0001 true ] > > The side trace for the third snapshot emits the following IRs: > > | 0001 tab TNEW #0 #0 > | 0002 p32 NEWREF 0001 "key" > | 0003 fal HSTORE 0002 false > | 0004 p32 NEWREF 0001 "key" > | 0005 tru HSTORE 0004 true > > As we can see, `NEWREF` is emitted twice. This is a violation of its > semantics, so the second store isn't noticeable. > > This patch prevents the second emitting of IR NEWREF by checking the last > one emitted NEWREF IR. There is no need to check NEWREFs beyond since > it guarantees the snapshot is taken after it, because it may cause table > rehashing, so all prior results are invalidated. > > Sergey Kaplun: > * added the description and the test for the problem > > Resolves tarantool/tarantool#7937 > Part of tarantool/tarantool#9145 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1128-double-ir-newref-on-restore-sunk > PR: https://github.com/tarantool/tarantool/pull/9466 > Related issues: > * https://github.com/LuaJIT/LuaJIT/issues/1128 > * https://github.com/tarantool/tarantool/issues/7937 > > src/lj_snap.c | 16 ++++ > ...-double-ir-newref-on-restore-sunk.test.lua | 81 +++++++++++++++++++ > 2 files changed, 97 insertions(+) > create mode 100644 test/tarantool-tests/lj-1128-double-ir-newref-on-restore-sunk.test.lua > > -- > 2.43.0 > -- Best regards, IM