- Mar 30, 2018
-
-
Konstantin Belyavskiy authored
Stay in orphan (read-only) mode until local vclock is lower than master's to make sure that datasets are the same across replicaset. Update replication/catch test to reflect the change. Suggested by @kostja Needed for #3210
-
Vladimir Davydov authored
Closes #3148
-
Vladimir Davydov authored
EV_USE_REALTIME and EV_USE_MONOTONIC, which force libev to use clock_gettime, are enabled automatically on Linux, but not on OS X. We used to forcefully enable them for performance reasons, but this broke compilation on certain OS X versions and so was disabled by commit d36ba279 ("Fix gh-1777: clock_gettime detected but unavailable in macos"). Today we need these features enabled not just because of performance, but also to avoid crashes when time changes on the host - see issue #2527 and commit a6c87bf9 ("Use ev_monotonic_now/time instead of ev_now/time for timeouts"). Fortunately, we have this cmake defined macro HAVE_CLOCKGETTIME_DECL, which is set if clock_gettime is available. Let's enable EV_USE_REALTIME and EV_USE_MONOTONIC if this macro is defined. Closes #3299
-
- Mar 29, 2018
-
-
Ilya Markov authored
The bug was that logging we passed to function write number of bytes which may be more than size of buffer. This may happen because formatting log string we use vsnprintf which returns number of bytes would be written to buffer, not the actual number. Fix this with limiting number of bytes passing to write function. Close #3248
-
Ilya Markov authored
* Refactor tests. * Add ev_async and fiber_cond for thread-safe log_rotate usage. Follow up #3015
-
Ilya Markov authored
Fix race condition in test on log_rotate. Test opened file that must be created by log_rotate and read from it. But as log_rotate is executed in separate thread, file may be not created or log may be not written yet by the time of opening in test. Fix this with waiting creation and reading the line.
-
Kirill Shcherbatov authored
Netbox does not need nullability or collation info, but some customers do. Lets fill index parts with these fields. Fixes #3256
-
- Mar 27, 2018
-
-
Georgy Kirichenko authored
* session_run_on_disconnect_triggers is called only if there are corresponding triggers so move session_storage_cleanup to session_destroy. * fix session storage cleanup path: use "box.session.aggregate_storage[sid]" instead of "session.aggregate_storage[sid]" (what was wrong) Fixed #3279
-
- Mar 22, 2018
-
-
Konstantin Osipov authored
-
Alec Larson authored
Empty strings should be ignored, rather than throw an error. Passing only empty strings (or nothing) to `pathjoin` will return '.' which means the current directory Every path part passed to `pathjoin` is now converted to a string The `gsub('/+', '/')` call already does what the removed code does, so avoid the unnecessary work Simply check if the result equals '/' before removing a trailing '/'. The previous check did extra work for no gain.
-
- Mar 21, 2018
-
-
Vladislav Shpilevoy authored
-
- Mar 20, 2018
-
-
Vladislav Shpilevoy authored
It is possible to discard non-sent responses using a special sequence of requests and yields. In details: if DML requests yield on commit too long, there are fast read requests, and a network is saturated, then some non-sent DML responses are discarded. Closes #3255
-
Vladislav Shpilevoy authored
A vinyl space can be altered in such a way, that key definitions of indexes are not changed, but comparators do. It is because space format reset can make some indexed fields optional. To be able update key definitions in place, they must not be used in a worker thread. So lets copy key_defs for a worker, and update index key definitions in place. An alternative is key_defs reference counting, but there is open questions what to do in key_defs in mems, ranges, iterators, runs, slices. Now lets do a hotfix of a crash, and then refactoring. Closes #3229
-
Vladislav Shpilevoy authored
Use key_def_delete instead. It is more safe to use one destructor everywhere for a case, if in a future key_def will not be deleted by simple free().
-
Konstantin Belyavskiy authored
Under FreeBSD getline prototype is not provided by default due to compatibility problems. Get rid of getline (use fgets instead). Based on @locker proposal. Closes #3217.
-
Konstantin Belyavskiy authored
-
- Mar 13, 2018
-
-
imarkov authored
log_rotate writes informational message only in plain format, which is inappropriate when logger is configured to log in json format. Fix it with replacing write with say_info which is safe because it is ev signal callback not signal handler. Fix bug say_format in json formatting, Log message was invalid in several cases. Closes #2987
-
IlyaMarkovMipt authored
Current log rotation is not async signal safe. In order to make it so refactor signal handling with ev_signal. Log rotation for each logger performs in separate coio_task to provide async and thread-safe execution. Relates #3015
-
imarkov authored
Remove yielding and waiting task complete in coio_task_post in case if timeout is zero. This patch is inspired by the need in log_rotate posting coio task. This post should not yield there because the implementation of multiple loggers works with linked list structure of loggers which is not fiber-safe.
-
Vladislav Shpilevoy authored
-
Vladislav Shpilevoy authored
When a space format is updated, a new min field count must be calculated before a new format construction to check that some of fields became optional. Part of #3229
-
- Mar 11, 2018
-
-
Konstantin Osipov authored
-
Konstantin Osipov authored
-
Konstantin Osipov authored
-
- Mar 07, 2018
-
-
Vladimir Davydov authored
When scanning a secondary index, we actually track each tuple in the transaction manager twice - as a part of the interval read from the secondary index and as a point in the primary index when retrieving the full tuple. This bloats the read set - instead of storing just one interval for a range request, we also store each tuple returned by it, which may count to thousands. There's no point in this extra tracking, because whenever we change a tuple in the primary index, we also update it in all secondary indexes. So let's remove it to save us some memory and cpu cycles. This is an alternative fix for #2534 It should also mitigate #3197
-
Vladimir Davydov authored
We never use vy_point_lookup directly, instead we open vy_read_iterator, which automatically falls back on vy_point_lookup if looking for exact match (EQ + full key). Due to this we can't add a new point lookup specific argument (we would have to propagate it through the read iterator, which is ugly). Let's call vy_point_lookup directly when we know that vy_read_iterator will fall back on it anyway.
-
Vladimir Davydov authored
This reverts commit a31c2c10. The commit reverted by this patch forces all autocommit SELECTs to open a read view immediately, as a result they can't update tuple cache. Turned out that one of our customers intensively uses such SELECTs, and disabling cache for them results in performance degradation. The reason why that commit was introduced in the first place was to avoid read set bloating for big SELECTs (e.g. space.count()): currently we track not only read interval boundaries, but also each tuple fetched from the primary index if it is a secondary index that is being scanned. However, it doesn't seem that we really need to do that - tracking an interval read from a secondary index guarantees that if a tuple returned by the iterator is modified the transaction will be aborted and so there's no need to track individual tuples read from the primary index. That said, let's revert this commit and instead remove point lookup tracking in case it is a secondary index that is being scanned (done later in the series).
-
Vladislav Shpilevoy authored
The first reason of the patch is that vinyl iterators are virtual already, and 'if's about constant index attributes (like index->id) can be replaced by new next() implementation. Now in next() index->id is checked to detect necessity of primary index lookup. Lets split next() in 2 functions: primary_next() and secondary_next() to remove 'if'. The second reason, that in #2129 logic of secondary index lookup complicates a lot. For example, there is raw idea to do not add statements into a cache before looking up in a primary index, because after #2129 any tuple, read from a secondary index, can be dirty. Needed for #2129
-
Konstantin Osipov authored
-
- Mar 06, 2018
-
-
Georgy Kirichenko authored
In most cases a tarantool yields on test_run connection and current transactions rollback, but some times a tarantool console already has more input to execute and select returns different results. Fixed #3145
-
Vladimir Davydov authored
We don't write empty run files anymore. Remove the dead code.
-
Vladimir Davydov authored
Run iterator uses curr_pos (i.e. page number plus offset) as pointer to the current position. Whenever it needs to get a statement at curr_pos, it calls vy_run_iterator_read(), which allocates a new statement. It doesn't try to cache the last allocated statement, which results in multiple pointless reallocations of the same statement. For instance, vy_run_iterator_next_key() rereads the current statement, then moves to the next key, then calls vy_run_iterator_find_lsn(), which rereads the current statement again. This is just stupid. To avoid that, let's keep vy_run_iterator->curr_stmt in sync with curr_pos. This simplifies the code quite a bit and makes it more efficient.
-
Vladimir Davydov authored
vy_run_iterator_get() remembers the position of the last statement returned by the iterator in curr_stmt_pos. It then uses it to skip a disk read in case it is called again for the same iterator position. The code is left from the time when iterators had public virtual method 'get', which could be called several times without advancing the iterator. Nowadays, vy_run_iterator_get() is never called twice for the same iterator position (check coverity scan) so we can zap this logic.
-
Vladimir Davydov authored
vy_run_iterator_load_page() keeps two most recently read pages. This makes sense, because we often probe a page for a better match. Keeping two pages rather than just one makes sure we won't throw out the current page if probing fails to find a better match. What doesn't make sense though is cache promotion logic: we keep promoting the page containing the current key. The comment says: /* * The cache is at least two pages. Ensure that * subsequent read keeps the cur_key in the cache * by moving its page to the start of LRU list. */ vy_run_iterator_cache_touch(itr, cur_key_page_no); The comment is quite misleading. The "cache" contains at most two pages. Proudly calling this travesty of a cache LRU is downright ridiculous. Anyway, touching the current page will simply swap the two cached pages if a key history spans less than two pages, resulting in no performance gain or loss whatsoever. However, if a key history spans more than two pages, it will evict a page that is about to be read. That said, let's get rid of this piece of crap.
-
Vladimir Davydov authored
vy_run_iterator_next_key() has to special-case LE/LT for the first and the last page. This is needed, because this function is used by vy_read_iterator_seek() for starting iteration. Actually, there's no point for vy_read_iterator_seek() to use vy_read_iterator_next_key() - vy_read_iterator_next_pos() + vy_read_iterator_find_lsn() would be enough. Bearing this in mind, simplify vy_run_iterator_next_key().
-
Konstantin Osipov authored
-
- Mar 05, 2018
-
-
Vladislav Shpilevoy authored
Inside a docker 'Connection refused' error turns into 'Cannot assign requested address' - because of it netbox test fails, which searches for 'Connection refused' in logs. Let search for both. Follow up #3164
-
Vladislav Shpilevoy authored
When reconnect fails, it prints error to log. But reconnect can fail again and again very many times until the connection is closed. Lets print the first error message under warn log level, and the following ones under verbose log level until error will not be changed. Closes #3175
-
Vladislav Shpilevoy authored
If a connection has reconnect_after > 0, then it is never deleted until it is explicitly closed or reconnect_after is reset. It is because worker fiber of such connection holds all references during yield. Fix it by do not waiting for a next reconnection inside a state machine - protocol_sm() function must not be infinite in a case of error. Closes #3164
-
Konstantin Osipov authored
-