- Dec 10, 2019
-
-
Vladislav Shpilevoy authored
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
-
- Nov 21, 2019
-
-
Vladislav Shpilevoy authored
Functions are stored in lists inside module objects. Module objects are stored in a hash table, where key is a package name. But the key was a pointer at one of module's function definition object. Therefore, when that function was deleted, its freed package name memory was still in the hash key, and could be accessed, when another function was deleted. Now module does not use memory of its functions, and keep a copy of the package name.
-
- Jun 24, 2019
-
-
Kirill Shcherbatov authored
The function func object used to provide a call method only for C functions. In scope of this patch it reworked to be a uniform function call frontend both for C and Lua functions. Introduced classes func_c and func_lua, that provide own constructors which produce implementation-specific object with call and destroy methods. Needed for #4182, #1260
-
Kirill Shcherbatov authored
Re-factor box_lua_call and box_lua_eval so that they don't take call_request. This approach is more scalable: in case of a functional index, the user expects to see a tuple with field names so we should be able to pass not only raw msgpack, but also a tuple to a Lua call so we need an universal way to pass arguments to _call methods. To pass a tuple msgpack introduced a new port_msgpack: the port class with dump_lua method. A new method get_msgpack returns a content of a port as a msgpack data. The lifecycle of the returned value is implementation-specific: it may either be returned directly from the port, in which case the data will stay alive as long as the port is alive, or it may be allocated on the fiber()->gc, in which case the caller is responsible for cleaning up. Needed for #4182, #1260
-
Kirill Shcherbatov authored
Tarantool used to assume that func_new call must not fail and it used to build a new func object by given definition just on func cache replace operation. We need to fix it to perform user-dependent risky actions like Lua function assemble in further patches. The replace method is disallowed for _func space because it is redundant and difficult to maintain in case of functions that have pre-compiled runtime. Needed for #4182, #1260
-
- Jul 13, 2018
-
-
Kirill Shcherbatov authored
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!
-
- Aug 24, 2017
-
-
Vladislav Shpilevoy authored
Needed for #2652
-
- Aug 15, 2017
-
-
Georgy Kirichenko authored
This patch adds ability to reload C procedures on the fly without downtime. To achive that, Tarantool loads a new copy of shared library and starts routing all new request to the new version. The previous version remains active until all started calls are finished. All shared libraries are loaded with RTLD_LOCAL, therefore two or more copies can co-exist without any problems. From now box loads all external modules via an unique symlink to avoid caching inside dlopen(). If one of some module function is reloaded then all other functions from this module will be reloaded. Reviewed and heavily patched by Roman Tsisyk. Closes #910
-
- Aug 09, 2017
-
-
Roman Tsisyk authored
Mixing C-style error handling and C++ exceptions can lead to serious problems. In context of #910
-
Roman Tsisyk authored
Needed for #910
-
- Jun 19, 2017
-
-
Vladislav Shpilevoy authored
Need for #944
-
- May 20, 2016
-
-
Konstantin Osipov authored
-
- Nov 27, 2015
-
-
Konstantin Osipov authored
-
- Nov 26, 2015
-
-
Roman Tsisyk authored
* Extract high-level IPROTO_CALL code to box.cc * Move execute_c_call to func.cc * Prepare src/lua/call.cc to rewrite in C Incompatible changes: * #300 logic was reverted. An attempt to call an unexisting Lua function without universal execute permissions now cause "access denied" message instead of "function does not exist". Since there is no cache for Lua procedures, existence of a function can be checked only by attempt to execute it. Caller **must** have a permission to execute function in order to execute functions. It's obvious, isn't it? Anyway, this patch doesn't affect user experience with using stored procedures. The two steps still must be performed to allow Lua calls using the binary protocol: 1. A function must be defined in Lua 2. A function must be declared in box.schema and caller must have execute permission for this object or for entire "universe". The order actually doesn't matter - the both steps must be done.
-
- Aug 14, 2015
-
-
Roman Tsisyk authored
Introduce a layer of wrappers for a number of internal box functions, dealing with accss to spaces and indexes. These wrappers: * don't throw exceptions * have a common prefix box_ * are exported in the server development headers Rewrite Lua C bindings to use the public API described above. Rewrite Lua FFI bindings to do the same. Add test.
-
- Aug 12, 2015
-
-
Konstantin Osipov authored
-
- Jul 06, 2015
-
-
Konstantin Osipov authored
Implement basic support for stored functions in C/C++. - split away struct func from struct func_def (function object and function definition object). - extend box.schema.func.create() to accept 'language' argument. - move module API related cmake magic to its own file - add test/lib to gitignore - update to the new test-run - add a test
-
- Feb 20, 2015
-
-
Roman Tsisyk authored
Other changes: * Fix #708: catch exceptions in boxffi_iterator_next * Optimize index:get() to directly use index:findByKey() instead of box_process() + execute_select() + iterator->init() + iterator->next()
-
- Jan 19, 2015
-
-
Roman Tsisyk authored
Add a new IPROTO request type - EVAL. EVAL compiles and executes arbitrary Lua expression and returns raw result (without converting it to a list of tuples).
-
- Jan 13, 2015
-
-
Roman Tsisyk authored
-
- Jul 13, 2014
-
-
Konstantin Osipov authored
Refactor statement transaction lifecycle. Avoid nested statement transactions. Make sure there is no more than 1 statement transaction present in the system at the moment. Resolve the bugs this revealed: - in local hot standby we would parasite on the main or script fiber session to process requests. When an assert was added that there is no more than 1 transaction active at a given moment in time, it turned out that transactions running on behalf of local hot standby were running in the scope of session of the run_script or sched fibers. Create and use an own session there. - refactor session on_connect/on_disconnect trigger invocation: do not invoke these triggers for just any session, only for real connects/disconnects (iproto, admin). - split session creation/destruction and trigger invocation Conclude that session storage implementation needs to be done differently.
-
- Mar 03, 2014
-
-
Roman Tsisyk authored
-
- Feb 03, 2014
-
-
Roman Tsisyk authored
This patch add specialized versions of box.process for select, insert, replace, update and delete requests. This optimization reduces the number of Lua <-> C switches during request processing. New functions create struct request directly without allocating temporary buffer for entire request body.
-
- Dec 17, 2013
-
-
Konstantin Osipov authored
-
- Aug 21, 2013
-
-
Konstantin Osipov authored
The new server snapshot format is identical to format of XLOG, i.e. it contains REPLACE statements with BOX_INSERT flags for every tuple in a space. This allows to streamline recovery, since rows from a snapshot can be treated the same as rows from the write ahead log (XLOG). This is an incompatible change: - tarantool 1.5 won't be able to read data of tarantool 1.6 - tarantool 1.6, without extra effort, won't be able to read data of tarantool 1.5 (a conversion procedure is needed). This change as such doesn't break replication, but further changes are in the pipeline which will inevitably finish this matter up as well. Why this patch is necessary --------------------------- To create system spaces dict-v5 branch employs on_replace triggers mechanism, fired off by txn_replace(). Thus it's vital that all changes go into spaces using txn_replace(). What else this patch does ------------------------- - since now XLOG and SNAP have the same format, log_io.cc code has become a bit simpler - struct key_def is re-factored to simplify dynamic creation/deletion of keys - reference counting for tuple formats is added - a number of error messages is improved to provide part no in a multipart key. - space cache is split away from space.cc into a separate module, schema.[h,cc]
-
- Jul 18, 2013
-
-
Konstantin Osipov authored
Instead of populating Lua box.space[] table once at server start, update it with space data whenever it changes. This is a pre-requisite patch for the new data dictionary, which allows adding/dropping spaces on a running server. Generalize session triggers to be usable for on_commit/on_rollback events.
-
- Nov 29, 2012
-
-
Konstantin Osipov authored
-
- Nov 28, 2012
-
-
Dmitry E. Oboukhov authored
-
- Oct 14, 2012
-
-
Konstantin Osipov authored
-
- Sep 06, 2012
-
-
Konstantin Osipov authored
Fix style, add comments, expand the manual.
-
- Sep 04, 2012
-
-
Dmitry E. Oboukhov authored
-
- Aug 29, 2012
-
-
Dmitry E. Oboukhov authored
-
- Aug 28, 2012
-
-
Dmitry E. Oboukhov authored
-