- Oct 25, 2017
-
-
Konstantin Osipov authored
-
- Oct 24, 2017
-
-
Vladislav Shpilevoy authored
Needed to remove monitoring fibers from shard and use only netbox api to track, if a connection is closed or reopened. Closes #2858
-
Vladislav Shpilevoy authored
Closes #2779
-
- Oct 19, 2017
-
-
Konstantin Nazarov authored
luarocks make <rockspec> allows one to build a rock from local directory. In addition to the "rocks make" argument, one additional option is needed in tarantoolctl: --chdir. This is because we need to build inside the rock directory, but output the result to <project_root>/.rocks. Implements #2846
-
Vladimir Davydov authored
> src/box/txn.c:454:40: error: '_Alignof' applied to an expression is a GNU extension [-Werror,-Wgnu-alignof-expression] > diag_set(OutOfMemory, sizeof(*svp) + alignof(*svp) - 1, > ^ Do not try to be smart and guess allocation size using alignof. > src/box/memtx_tree.c:391:11: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare] > if (type < 0 || type > ITER_GT) { /* Unsupported type */ > ~~~~ ^ ~ > src/box/vinyl_index.c:184:29: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare] > if (type > ITER_GT || type < 0) { > ~~~~ ^ ~ Move the check for illegal params (i.e. 'type < 0') to the box API. In index callbacks, only check that the iterator type is supported by the index.
-
Vladimir Davydov authored
Since we already have the index_create_iterator() method to create an iterator, the API basically consists of two functions: iterator_next() and iterator_delete(). While iterator_delete() is just a trivial wrapper around iterator::free callback, iterator_next() is more than that: it also checks schema version and invalidates the iterator in case there was a DDL that affected the index. Previously, this was done only by the box API, but the overhead of this check seems to be really negligible so it is compelling to do it from the internal API so that an internal API user doesn't need to care about DDL once he opened an iterator. Needed for #2776
-
Vladimir Davydov authored
This virtual method was added to make use of the 'position' optimization implemented in memtx. Since the optimization was removed recently, we don't need it anymore.
-
Vladimir Davydov authored
The primary reason for these methods to be implemented differently for memtx and vinyl was the 'position' optimization exploited by the memtx engine: since selects from memtx do not yield, we could use a preallocated iterator there. Now, as the 'position' optimization became redundant and was removed due to the switch to memory pools for iterator allocations, the only idiosyncrasy left in the memtx implementation is the count() optimization: count() falls back on size() for ITER_ALL. Since this optimization consists of just a few lines of code, we don't really need memtx_index_count() co-used by all memtx index implementations: we can implement it in each memtx index separately. That being said, let us: - implement generic versions of min(), max(), and count(); - make vinyl, memtx, and sysview engines use generic versions of the above-mentioned methods if appropriate; - Remove memtx_index.[hc] As a side-effect, this patch enables min(), max(), and count() in the sysview engine, but that is not bad considering that this engine implements general-purpose iterator for its indexes.
-
Vladimir Davydov authored
We don't need index_position() optimization any more as all iterators are allocated from memory pools. Remove it and merge iterator allocation and initialization procedures. Needed for #2776
-
Vladimir Davydov authored
Currently, index iterator allocation and initialization are separated. This is done in order to speed up iterator creation when the caller does not yield: there's 'position' method, which returns a preallocated iterator and can be used instead of costly 'alloc'; the iterator returned by this method needs to be initialized just like an iterator allocated normally, via 'alloc'. This looks ugly, because 'position' is engine-dependent, e.g. it can't be used in case of vinyl, because vinyl yields internally. Let's allocate all index iterators from memory pools. Since allocation from a memory pool is very cheap, this will allow us to get rid of the above-mentioned 'position' hack and simplify the iterator API.
-
Vladimir Davydov authored
Currently, index iterator allocation and initialization are separated. This is done in order to speed up iterator creation when the caller does not yield: there's 'position' method, which returns a preallocated iterator and can be used instead of costly 'alloc'; the iterator returned by this method needs to be initialized just like an iterator allocated normally, via 'alloc'. This looks ugly, because 'position' is engine-dependent, e.g. it can't be used in case of vinyl, because vinyl yields internally. We can get rid of the above-mentioned 'position' hack by simply using a mempool for allocating iterators. To do that, we need to access engine from index, so this patch adds a reference to struct engine to struct index.
-
Vladimir Davydov authored
Box functions were initially written as C wrappers around internal C++ API so they used try/catch to propagate errors. Now we can rewrite them without try/catch, as we have C API for DML/DQL.
-
Vladimir Davydov authored
Current internal tnx API is not particularly user-friendly in regards to error handling: if txn_begin_stmt(), txn_commit_stmt(), or txn_commit() fails, the txn state is undefined and the caller must rollback manually. To make the API easier to use, let's oblige these function rollback automatically in case of failure. Needed for #2776
-
Vladimir Davydov authored
Apart from executing a request, process_rw() may also: - replace nil with a sequence value; - rebind update to the primary key. Let's fold this logic in the internal space API so that it can be easily reused by SQL. Note, request_rebind_to_primary_key() must not fail, because it is called after the request was successfully executed, which implies that the engine performed all necessary checks, so replace exceptions with asserts there. Needed for #2776
-
- Oct 18, 2017
-
-
Roman Tsisyk authored
Fixes #2845
-
- Oct 15, 2017
-
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Preparation for converting txn to C. This will help removing exceptions from txn methods. Needed for #2776
-
Vladimir Davydov authored
To convert engine and space infrastructure to C, we need to make txn usable from C code. The only reason why we can't convert txn.cc to C right now is triggers: they are set from alter.cc and may throw exceptions. To handle this, let's make trigger_run() catch all exceptions and return an error code instead. For C++ code, introduce trigger_run_xc() which calls trigger_run() under the hood and throws the exception suppressed by it. Needed for #2776
-
Vladimir Davydov authored
Preparation for converting engine implementation to C. Needed for #2776
-
Vladimir Davydov authored
- Add a return code to both space_foreach() and its callback so that the caller can use it to propagate errors instead of throwing exceptions. - Make space_foreach() exception-free. - Export the function to C. Preparation for converting engine implementation to C. Needed for #2776
-
Vladimir Davydov authored
Preparation for converting engine implementation to C. This will help removing exceptions from engine callbacks. Needed for #2776
-
Vladimir Davydov authored
vy_set_timeout() and vy_set_max_tuple_size() are not supposed to fail. Remove the return code and diag_raise() in the engine wrapper.
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Preparation for converting class Engine to plain struct. Needed for #2776
-
Vladimir Davydov authored
engine::createFormat() wasn't such a good idea after all - it's difficult to convert it to C in a neat way: the problem is it may return NULL on success (which it does in case of sysview engine) so to make it exception-free we have to either return the format in an extra argument or allow the engine set this method to NULL. Both ways look ugly. Let's remove engine::createFormat() and oblige engine::createSpace() fully initialize a space, similarly to how it works for indexes. To ease its work, introduce space_create() which initializes engine independent fields (i.e. struct space). While we are at it, let's also - make memtx/vinyl space_vtab private to the engines and export functions to create a memtx/vinyl space; - make struct space initialization code exception-free - after all we are going to convert it to C. Needed for #2776
-
Vladimir Davydov authored
Vinyl engine initialization is done in two steps: first we create the engine class and then we call ->init() method, which creates vinyl environment. There's no reason not to create the environment right in the engine class constructor, so let's move it there and drop ->init(). Also, let's pass engine parameters to the engine constructor, just like we do in case of memtx, instead of reading the config from the engine implementation.
-
Vladimir Davydov authored
To find an engine object, we always use engine_find(), which raises an error if the engine was not found. Sometimes we know for sure that the engine we are looking for exists, in which case we don't need to raise an error. Let's introduce engine_by_name() that just looks up the engine and does nothing else and use it when we are sure that the engine must exist.
-
Vladimir Davydov authored
Rename MemtxEngine, VinylEngine, and SysviewEngine to memtx_engine, vinyl_engine, and sysview_engine as well. Preparation for converting class Engine to plain struct. Needed for #2776
-
Vladimir Davydov authored
IllegalParams and ErrorInjection are not used anymore. Delete them.
-
Vladimir Davydov authored
Preparation for converting space implementation to C. Needed for #2776
-
Vladimir Davydov authored
There are four such functions declared in space.h: space_new index_find_unique index_find_system access_check_space index_find_unique() and access_check_space() are used in the code that is about to be converted to C so for them add exception-free variants (without xc suffix). Preparation for converting space implementation to C. Needed for #2776
-
Vladimir Davydov authored
This function is very unreliable: - it crashes if the space doesn't have indexes; - it only works for memtx spaces, for other engines it throws an exception. Since it is only used in memtx, let's zap it and call index_size() directly.
-
Vladimir Davydov authored
Preparation for converting space implementation to C. Note, all methods that may throw have *_xc suffix. This will help removing exceptions from space callbacks. Needed for #2776
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Add index_build_xc() wrapper for C++ code. Preparation for converting index implementation to C. Needed for #2776
-
Vladimir Davydov authored
Preparation for converting index implementation to C. Needed for #2776
-
Vladimir Davydov authored
Add space_cache_find_xc() wrapper for C++ code. Preparation for converting index implementation to C. Needed for #2776
-
Vladimir Davydov authored
Needed for #2776
-