From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [tarantool-patches] [PATCH] tarantoolctl: fix cat and play for empty body requests From: Serge Petrenko In-Reply-To: <20180913130441.36cmydekkvsjikyb@esperanza> Date: Fri, 14 Sep 2018 17:39:59 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <2BFFE4CA-A048-4F18-9D6E-824C518D5AE1@tarantool.org> References: <20180911161506.69921-1-sergepetrenko@tarantool.org> <20180913130441.36cmydekkvsjikyb@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: > 13 =D1=81=D0=B5=D0=BD=D1=82. 2018 =D0=B3., =D0=B2 16:04, Vladimir = Davydov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB= (=D0=B0): >=20 > On Tue, Sep 11, 2018 at 07:15:06PM +0300, Serge Petrenko wrote: >> If space.before_replace returns the old tuple, the operation turns = into >> no-op, but is still written to WAL as IPROTO_NOP for the sake of >> replication. Such a request doesn't have a body, and tarantoolctl = failed >> to parse such requests in `tarantoolctl cat` and `tarantoolctl play`. >> Fix this by skipping such requests, since they have no effect anyway. >>=20 >> Closes #3675 >> --- >> https://github.com/tarantool/tarantool/issues/3675 >> = https://github.com/tarantool/tarantool/tree/sp/gh-3675-tarantoolctl-cat-em= pty-body >>=20 >> extra/dist/tarantoolctl.in | 18 ++++++++++++------ >> 1 file changed, 12 insertions(+), 6 deletions(-) >=20 > Please add a test. >=20 >>=20 >>=20 >> + end >=20 > Nit: >=20 > local sid =3D record.BODY and record.BODY.space_id >=20 >> local rid =3D record.HEADER.replica_id >> - if (lsn < from) or >> + if (lsn < from) or sid =3D=3D nil or >=20 > I want to see BODY-less requests in the output while this code makes > tarantoolctl-cat ignore them AFAIU. >=20 >> (not spaces and sid and sid < 512 and not show_system) = or >>=20 >> - if (lsn < from) or >> + if (lsn < from) or sid =3D=3D nil or >> (not spaces and sid and sid < 512 and not show_system) = or >> - (spaces and (sid =3D=3D nil or not find_in_list(sid, = spaces))) or >> + (spaces and not find_in_list(sid, spaces)) or >> (replicas and not find_in_list(rid, replicas)) then >> -- pass this tuple >> elseif lsn >=3D to then >=20 Hi! I fixed all your comments and resent the patch as a part of a = patchset together with a patch regarding #3678.