Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com, Serge Petrenko <sergepetrenko@tarantool.org>
Subject: Re: [tarantool-patches] [PATCH v2 1/2] tarantoolctl: fix cat and play for empty body requests
Date: Wed, 26 Sep 2018 01:31:34 +0300	[thread overview]
Message-ID: <20180925223134.GC3137@chai> (raw)
In-Reply-To: <e39c3b8c1f8e3a8f267b34ce6d1e5b57a9cf202a.1537797732.git.sergepetrenko@tarantool.org>

* Serge Petrenko <sergepetrenko@tarantool.org> [18/09/24 18:11]:
> 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 checking whether a request has a body. Also skip such
> requests in `play`, since they have no effect, and, while we're at it,
> make sure `play` and `cat` do not read excess rows with lsn>=to in case
> these rows are skipped.
> 
> Closes #3675
> ---
>  extra/dist/tarantoolctl.in         | 32 ++++++++++++++++++------------
>  test/app-tap/tarantoolctl.test.lua | 14 ++++++++++---
>  2 files changed, 30 insertions(+), 16 deletions(-)
> 
> diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
> index 3d7ff3ec5..588ca1729 100755
> --- a/extra/dist/tarantoolctl.in
> +++ b/extra/dist/tarantoolctl.in
> @@ -373,6 +373,12 @@ write_lua_table = function(tuple)
>  end
>  
>  local function cat_lua_cb(record)
> +    -- Ignore both versions of IPROTO_NOP: the one without a
> +    -- body (new), and the one with empty body (old).
> +    if record.HEADER.type == 'NOP' or record.BODY == nil or
> +       record.BODY.space_id == nil then
> +        return
> +    end

This comment doesn't match the code. You ignore all records with
an empty body, not just NOP records. This is obviously incorrect.

> 

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2018-09-25 22:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 14:08 [PATCH v2 0/2] fix bodiless requests handling Serge Petrenko
2018-09-24 14:08 ` [PATCH v2 1/2] tarantoolctl: fix cat and play for empty body requests Serge Petrenko
2018-09-25 22:31   ` Konstantin Osipov [this message]
2018-09-24 14:08 ` [PATCH v2 2/2] recovery: fix incorrect handling of empty-body requests Serge Petrenko
2018-09-25 22:33   ` [tarantool-patches] " Konstantin Osipov
2018-09-25 14:37 ` [PATCH v2 0/2] fix bodiless requests handling Vladimir Davydov

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=20180925223134.GC3137@chai \
    --to=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] [PATCH v2 1/2] tarantoolctl: fix cat and play for empty body requests' \
    /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