Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Emit sunk IR_NEWREF only once per key on snapshot replay.
Date: Thu, 15 Feb 2024 13:41:43 +0000	[thread overview]
Message-ID: <Zc4Ul2jlsh6GzaZt@tarantool.org> (raw)
In-Reply-To: <20231211153520.9322-1-skaplun@tarantool.org>

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 <mike>
> 
> 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
> 

<snipped>

> -- 
> 2.43.0
> 

-- 
Best regards,
IM

      parent reply	other threads:[~2024-02-15 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 15:35 Sergey Kaplun via Tarantool-patches
2023-12-12  9:44 ` Maxim Kokryashkin via Tarantool-patches
2023-12-12 10:10   ` Sergey Kaplun via Tarantool-patches
2023-12-12 11:45     ` Maxim Kokryashkin via Tarantool-patches
2024-01-16 11:54 ` Sergey Bronnikov via Tarantool-patches
2024-02-15 13:41 ` Igor Munkin via Tarantool-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zc4Ul2jlsh6GzaZt@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Emit sunk IR_NEWREF only once per key on snapshot replay.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox