Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v1 0/3] box: persistent Lua functions
@ 2019-05-14 13:29 Kirill Shcherbatov
  2019-05-14 13:29 ` [PATCH v1 1/3] box: refactor box_lua_find helper Kirill Shcherbatov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kirill Shcherbatov @ 2019-05-14 13:29 UTC (permalink / raw)
  To: tarantool-patches, vdavydov.dev; +Cc: Kirill Shcherbatov

Lua functions managed by Tarantool are called 'persistent'.
They are stored in snapshoot and are available after server
restart. No regular Lua functions, nor C functions can't be
'persistent' because they depend on non-only snapshot environment
(libc, global variables etc.).
Some restrictions must be accounted writing such routines:
1. only limited set of Lua functions and modules are available:
-assert -error -pairs -ipairs -next -pcall -xpcall -type
-print -select -string -tonumber -tostring -unpack -math -utf8;
2. global variables are forbidden.

Persistent Lua functions are exported in box.schema.func.persistent
folder. They may be called via .call in exported object or via
netbox:call.

In scope of this patch, refactored func module API: in case of
persistent Lua function update may be insecure operation, so
we need a machinery to transactionally update the object.

http://github.com/tarantool/tarantool/tree/kshch/gh-4182-persistent-lua-functions
https://github.com/tarantool/tarantool/issues/4182

Kirill Shcherbatov (3):
  box: refactor box_lua_find helper
  schema: extend _func space to persist lua functions
  box: extend box.schema.func with persistent folder

 src/box/CMakeLists.txt            |   1 +
 src/box/alter.cc                  |  87 ++++++++----
 src/box/bootstrap.snap            | Bin 4374 -> 4393 bytes
 src/box/call.c                    |   2 +-
 src/box/func.c                    | 225 +++++++++++++++++++++++++++++-
 src/box/func.h                    |  21 ++-
 src/box/func_def.h                |  10 +-
 src/box/lua/call.c                | 122 +++++++---------
 src/box/lua/call.h                |   4 +-
 src/box/lua/init.c                |   2 +
 src/box/lua/schema.lua            |   8 +-
 src/box/lua/upgrade.lua           |  15 ++
 src/box/lua/util.c                | 102 ++++++++++++++
 src/box/lua/util.h                |  59 ++++++++
 src/box/schema.cc                 |  47 +++----
 src/box/schema.h                  |  31 ++--
 src/box/schema_def.h              |   1 +
 test/box-py/bootstrap.result      |   6 +-
 test/box/access_misc.result       |   4 +-
 test/box/persistent_func.result   | 185 ++++++++++++++++++++++++
 test/box/persistent_func.test.lua |  83 +++++++++++
 21 files changed, 858 insertions(+), 157 deletions(-)
 create mode 100644 src/box/lua/util.c
 create mode 100644 src/box/lua/util.h
 create mode 100644 test/box/persistent_func.result
 create mode 100644 test/box/persistent_func.test.lua

-- 
2.21.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-17 15:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 13:29 [PATCH v1 0/3] box: persistent Lua functions Kirill Shcherbatov
2019-05-14 13:29 ` [PATCH v1 1/3] box: refactor box_lua_find helper Kirill Shcherbatov
2019-05-17 12:33   ` [tarantool-patches] " Kirill Shcherbatov
2019-05-14 13:29 ` [PATCH v1 2/3] schema: extend _func space to persist lua functions Kirill Shcherbatov
2019-05-14 18:21   ` [tarantool-patches] " Konstantin Osipov
2019-05-17 12:33     ` [tarantool-patches] " Kirill Shcherbatov
2019-05-17 15:29       ` Konstantin Osipov
2019-05-14 13:29 ` [PATCH v1 3/3] box: extend box.schema.func with persistent folder Kirill Shcherbatov
2019-05-14 18:24   ` [tarantool-patches] " Konstantin Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox