Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] box: sql prepare and execute statistics should be reflected in box.stat()
Date: Thu, 27 Feb 2020 16:21:13 +0300	[thread overview]
Message-ID: <20200227132113.GC12687@tarantool.org> (raw)
In-Reply-To: <11433298-80bb-336c-06a2-ce310634960f@tarantool.org>

On 27 Feb 01:08, Vladislav Shpilevoy wrote:
> Good catch, and shame on me for lgtming the patch!
> 
> On 26/02/2020 16:50, Maria Khaydich wrote:
> > Hey, I’ve been doing the 2.2 version for the same issue and realized there’s a bug in the commit that was already merged to master.
> >  
> >> 1. Nikita is right, this is called when IPROTO_EXECUTE arrives. You can
> > see that in iproto.cc. This is a separate question, why do we collect
> > IPROTO_* statistics out of iproto. For now lets just use IPROTO_EXECUTE
> > here. 
> >  
> > The reason I was collecting stats for box.prepare here in the first place is because it looked to me like the execution of method sql_prepare_and_execute implied the user is preparing _and_ executing something at the same time,
> 
> From what I know, this method is invoked when we execute a non prepared
> statement. Such a query is not cached in the prep statements cache, and
> was not sent as PREPARE. So this would be a surprise for a user to see
> increased PREPARE after a usual execute().
> 
> > and whereas all other methods boiled down to either sql_prepare or sql_execute in the end, this one collected statistics only for IPROTO_EXECUTE, so I thought it was necessary to cover IPROTO_PREPARE as well. But your argument was aimed at something a bit different, so I missed the global picture here. 
> > The point is, there’s no need to do another rmean_collect(), as it happens later when sql_execute is being called. Otherwise the stats would have been collected twice for each executed statement as it was obvious in different tests (that I also added in the follow up patch).
> >  
> > Also, I’m wondering if we need to collect the stats for IPROTO_PREPARE in sql_reprepare as well?

sql_reprepare is a part of sql_prepare so we shouldn't account it.

> > It seems relevant due the nature of this method: «Re-compile statement and refresh global prepared statement cache with the newest value». Meaning, it’s another instance of prepare, right? 
> 
> This would be good to account somewhere, but certainly not here.
> box.stat() is not for such internal things. This is just request counters.
> Only for explicit requests. Reprepare would be good to add to box.stat.sql()
> some day.
> 
> I propose to just drop rmean_collect() from sql_prepare_and_execute(). This
> would solve the problem.

Exactly. Please send smth like 'hotfix' for the last commit, I guess it
is too late to force push to master.

  reply	other threads:[~2020-02-27 13:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 18:35 Maria Khaydich
2020-02-10 23:06 ` Nikita Pettik
2020-02-13 21:44 ` Vladislav Shpilevoy
2020-02-19 16:37   ` Maria Khaydich
2020-02-19 17:16     ` Nikita Pettik
2020-02-25 11:08       ` Maria Khaydich
2020-02-25 13:02         ` Nikita Pettik
2020-02-25 20:29           ` Vladislav Shpilevoy
2020-02-26 15:50             ` Maria Khaydich
2020-02-27  0:08               ` Vladislav Shpilevoy
2020-02-27 13:21                 ` Nikita Pettik [this message]
2020-03-03 16:42                   ` Maria Khaydich
2020-03-03 22:39                     ` Vladislav Shpilevoy
2020-03-06 11:34                       ` Maria Khaydich
2020-03-06 14:32                         ` Nikita Pettik
2020-03-06 15:09                           ` Nikita Pettik
2020-03-04 13:47                     ` Nikita Pettik
2020-02-25 22:26 ` Kirill Yukhin
2020-02-25 23:30   ` Nikita Pettik

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=20200227132113.GC12687@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: sql prepare and execute statistics should be reflected in box.stat()' \
    /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