Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] Re: [PATCH v1 1/1] box: support reload whole module
Date: Thu, 12 Jul 2018 12:31:21 +0300	[thread overview]
Message-ID: <20180712093121.zk2iya5avjc5fusp@esperanza> (raw)
In-Reply-To: <0c098b97-27f4-bd1f-23a0-6b136361d16f@tarantool.org>

On Thu, Jul 12, 2018 at 11:27:13AM +0300, Kirill Shcherbatov wrote:
> > During our verbal discussion with Kirill, he noticed that the fact that
> > box.schema.func.reload() reloads the whole module when it is passed a
> > function name is rather confusing: the user may not know that and call
> > box.schema.func.reload() once per each used function, in which case he
> > will effectively reload the whole module that contains those functions
> > multiple times, which is pointless. Turns out Kirill isn't the only one
> > who finds such an API weird, see
> > 
> >   https://github.com/tarantool/tarantool/issues/910#issuecomment-331435227
> > 
> > I talked to Kostja and he doesn't mind banning this API, i.e. making
> > box.schema.func.reload() interpret its argument only as a module name.
> > 
> > So let's rework this patch so that box_func_reload() directly calls
> > module_reload(), and remove func_reload() altogether. As for the access
> > checks, box_func_reload() should work only if the caller has the global
> > execute privilege.
> 
> Closes #2946.
> 
> @TarantoolBot document
> Title: fixed module reload
> There was a bug in tarantool documentation:
> https://tarantool.io/en/doc/1.7/book/box/
> box_schema/#lua-function.box.schema.func.reload
> Now it is allowed to reload all functions in loadable
> module via one method. Legacy method including finction
> name is forbidden.
> box.schema.func.reload("utils")       -- ok since now
> box.schema.func.reload("utils.func1") -- forbidden since now
> 
> Global reload is still unsupported because it seems
> to be useless.
> box.schema.func.reload()              -- invalid!
> ---
> https://github.com/tarantool/tarantool/compare/kshch/gh-2946-module-reload
> https://github.com/tarantool/tarantool/issues/2946
> 
>  src/box/call.c                | 23 +++++++++++++----------
>  src/box/call.h                |  9 ++++++++-
>  src/box/errcode.h             |  1 +
>  src/box/func.c                | 16 ----------------
>  src/box/func.h                | 11 ++++++++++-
>  src/box/lua/call.c            |  6 +++---
>  src/box/lua/schema.lua        |  2 +-
>  test/box/func_reload.result   | 23 ++++++++---------------
>  test/box/func_reload.test.lua | 14 ++++++--------
>  test/box/misc.result          |  1 +
>  10 files changed, 51 insertions(+), 55 deletions(-)

Looks good to me.

  reply	other threads:[~2018-07-12  9:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 16:54 [tarantool-patches] " Kirill Shcherbatov
2018-07-09 18:06 ` [tarantool-patches] " Vladislav Shpilevoy
2018-07-10  6:49   ` Kirill Shcherbatov
2018-07-11  5:25     ` Georgy Kirichenko
2018-07-11 12:46     ` Vladimir Davydov
2018-07-11 12:52       ` Kirill Shcherbatov
2018-07-11 12:59         ` Vladimir Davydov
2018-07-11 14:50           ` Kirill Shcherbatov
2018-07-11 15:57       ` Vladimir Davydov
2018-07-12  8:27         ` Kirill Shcherbatov
2018-07-12  9:31           ` Vladimir Davydov [this message]
2018-07-13  6:16 ` Kirill Yukhin

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=20180712093121.zk2iya5avjc5fusp@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] Re: [PATCH v1 1/1] box: support reload whole module' \
    /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