From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 12 Jul 2018 12:31:21 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v1 1/1] box: support reload whole module Message-ID: <20180712093121.zk2iya5avjc5fusp@esperanza> References: <8846b566-24c5-9f11-ca29-18baed551921@tarantool.org> <20180711124656.pzuh254bjku3k2xc@esperanza> <20180711155705.zkwqen2q5aeozzkq@esperanza> <0c098b97-27f4-bd1f-23a0-6b136361d16f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c098b97-27f4-bd1f-23a0-6b136361d16f@tarantool.org> To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org List-ID: 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.