- Sep 21, 2018
-
-
Sergei Voronezhskii authored
Until the bug in #3420 is fixed
-
Vladimir Davydov authored
The only difference between struct key_part_def and struct key_part is that the former stores only the id of a collation while the latter also stores a pointer to speed up tuple comparisons. It isn't worth keeping a separate struct just because of that. Let's use struct key_part everywhere and assume that key_part->coll is NULL if the part is needed solely for storing a decoded key part definition and isn't NULL if it is used for tuple comparisons (i.e. is attached to a key_def).
-
Kirill Shcherbatov authored
Start use tuple_field_by_part(_raw) routine in *extract, *compare, *hash functions. This new function use key_part to retrieve field data mentioned in key_part. Now it is just a wrapper for tuple_field_raw but with introducing JSON paths it would work in other way. Needed for #1012
-
Kirill Shcherbatov authored
To introduce JSON indexes we need changeable key_def containing key_part definition that would store JSON path and offset slot and slot epoch in following patches. Needed for #1012
-
Kirill Yukhin authored
-
- Sep 20, 2018
-
-
Alexander Turenko authored
The problem is that clang does not support -Wno-cast-function-type flag. It is the regression from 8c538963. Follow up of #3685. Fixes #3701.
-
Serge Petrenko authored
This patch rewrites all tests to grant only necessary privileges, not privileges to universe. This was made possible by bugfixes in access control, patches #3516, #3574, #3524, #3530. Follow-up #3530
-
Kirill Yukhin authored
-
- Sep 19, 2018
-
-
Vladimir Davydov authored
This patch adds some essential disk statistics that are already collected and reported on per index basis to box.stat.vinyl(). The new statistics are shown under the 'disk' section and currently include the following fields: - data: size of data stored on disk. - index: size of index stored on disk. - dump.in: size of dump input. - dump.out: size of dump output. - compact.in: size of compaction input. - compact.out: size of compaction output. - compact.queue: size of compaction queue. All the counters are given in bytes without taking into account disk compression. Dump/compaction in/out counters can be reset with box.stat.reset().
-
Vladimir Davydov authored
So that we can easily extend them to account the stats not only per LSM tree, but also globally, in vy_lsm_env.
-
Vladimir Davydov authored
Currently, there's no way to figure out whether compaction keeps up with dumps or not while this is essential for implementing transaction throttling. This patch adds a metric that is supposed to help answer this question. This is the compaction queue size. It is calculated per range and per LSM tree as the total size of slices awaiting compaction. We update the metric along with the compaction priority of a range, in vy_range_update_compact_priority(), and account it to an LSM tree in vy_lsm_acct_range(). For now, the new metric is reported only on per index basis, in index.stat() under disk.compact.queue.
-
Vladimir Davydov authored
Currently, we call memset() on vy_stmt_counter and vy_disk_stmt_counter directly, but that looks rather ugly, especially when a counter has a long name. Let's introduce helper functions for that.
-
Vladimir Davydov authored
There's no reason not to report pages and bytes_compressed under disk.stat.dump.out and disk.stat.compact.{in,out} apart from using the same struct for dump and compaction statistics (vy_compact_stat). The statistics are going to differ anyway once compaction queue size is added to disk.stat.compact so let's zap struct vy_compact_stat and report as much info as we can.
-
Vladimir Davydov authored
The code is difficult to follow when there are nested info tables, because info_table_end() doesn't refer to the table name. Let's annotate info_table_end() with a comment to make it easier to follow. No functional changes.
-
Vladimir Davydov authored
When a few ranges are coalesced, we "force" compaction of the resulting range by raising its compaction priority to max (slice count). There's actually no point in that, because as long as the shape of the resulting LSM tree is OK, we don't need to do extra compaction work. Moreover, it actually doesn't work if a new slice is added to the resulting range by dump before it gets compacted, which is fairly likely, because then its compaction priority will be recalculated as usual. So let's simply call vy_range_update_compact_priority() for the resulting range. When a range is split, the produced ranges will inherit its compaction priority. This is actually incorrect, because range split may change the shape of the tree so let's recalculate priority for each part the usual way, i.e. by calling vy_range_update_compact_priority(). After this patch, there's this only place where we can update compaction priority of a range - it's vy_range_update_compact_priority().
-
Vladimir Davydov authored
This patch addresses a few problems index.compact() is suffering from, namely: - When a range is split or coalesced, it should inherit the value of needs_compaction flag from the source ranges. Currently, the flag is cleared so that the resulting range may be not compacted. - If a range has no slices, we shouldn't set needs_compaction flag for it, because obviously it can't be compacted, but we do. - The needs_compaction flag should be cleared as soon as we schedule a range for compaction, not when all slices have been compacted into one, as we presently expect, because the latter may never happen under a write-intensive load.
-
- Sep 17, 2018
-
-
Serge Petrenko authored
If some error occured during execution of a function called from box.session.su(), we assumed that fiber diagnostics area was not empty, and tried to print an error message using data from the diagnostics. However, this assumption is not true when some lua error happens. Imagine such a case: box.session.su('admin', function(x) return #x end, 3) A lua error would be pushed on the stack but the diagnostics would be empty, and we would get an assertion failure when trying to print the error message. Handle this by using lua_error() instead of luaT_error(). Closes #3659
-
- Sep 15, 2018
-
-
Alexander Turenko authored
Fixed false positive -Wimplicit-fallthrough in http_parser.c by adding a break. The code jumps anyway, so the execution flow is not changed. Fixed false positive -Wparenthesis in reflection.h by removing the parentheses. The argument 'method' of the macro 'type_foreach_method' is just name of the loop variable and is passed to the macro for readability reasons. Fixed false positive -Wcast-function-type triggered by reflection.h by adding -Wno-cast-function-type for sources and unit tests. We cast a pointer to a member function to an another pointer to member function to store it in a structure, but we cast it back before made a call. It is legal and does not lead to an undefined behaviour. Fixes #3685.
-
- Sep 14, 2018
-
-
AKhatskevich authored
The test expected that http:get yields, however, in case of very fast unix_socket and parallel test execution, a context switch during the call lead to absence of yield and to instant reply. That caused an error during `fiber:cancel`. The problem is solved by increasing http server response time. Closes #3480
-
- Sep 13, 2018
-
-
Roman Khabibov authored
Add an ability to pass options to json.encode()/decode(). Closes: #2888. @TarantoolBot document Title: json.encode() json.decode() Add an ability to pass options to json.encode() and json.decode(). These are the same options that are used globally in json.cfg().
-
- Sep 10, 2018
-
-
Kirill Yukhin authored
Since addition of -fopenmp to compiler also means addition of -lgomp to the link stage, pass -fno-openmp to the linking stage in case of static build. In that case OMP functions are statically linked into libmisc. Also, emit error if trying to perform static build using clang.
-
- Sep 09, 2018
-
-
Vladimir Davydov authored
box.info.memory() gives you some insight on what memory is used for, but it's very coarse. For vinyl we need finer grained global memory statistics. This patch adds such: they are reported under box.stat.vinyl().memory and consist of the following entries: - level0: sum size of level-0 of all LSM trees. - tx: size of memory used by tx write and read sets. - tuple_cache: size of memory occupied by tuple cache. - page_index: size of memory used for storing page indexes. - bloom_filter: size of memory used for storing bloom filters. It also removes box.stat.vinyl().cache, as the size of cache is now reported under memory.tuple_cache.
-
Vladimir Davydov authored
Since commit 0c5e6cc8 ("vinyl: store full tuples in secondary index cache"), we store primary index tuples in secondary index cache, but we still account them as separate tuples. Fix that. Follow-up #3478 Closes #3655
-
Vladimir Davydov authored
Any LSM-based database design implies high level of write amplification so there should be more compaction threads than dump threads. With the default value of 2 for box.cfg.vinyl_write_threads, which we have now, we start only one compaction thread. Let's increase the default up to 4 so that there are three compaction threads started by default, because it fits better LSM-based design.
-
Vladimir Davydov authored
We must not schedule any background jobs during local recovery, because they may disrupt yet to be recovered data stored on disk. Since we start the scheduler fiber as soon as the engine is initialized, we have to pull some tricks to make sure it doesn't schedule any tasks: the scheduler fiber function yields immediately upon startup; we assume that it won't be woken up until local recovery is complete, because we don't set the memory limit until then. This looks rather flimsy, because the logic is spread among several seemingly unrelated functions: the scheduler fiber (vy_scheduler_f), the quota watermark callback (vy_env_quota_exceeded_cb), and the engine recovery callback (vinyl_engine_begin_initial_recovery), where we leave the memory limit unset until recovery is complete. The latter isn't even mentioned in comments, which makes the code difficult to follow. Think how everything would fall apart should we try to wake up the scheduler fiber somewhere else for some reason. This patch attempts to make the code more straightforward by postponing startup of the scheduler fiber until recovery completion. It also moves the comment explaining why we can't schedule tasks during local recovery from vy_env_quota_exceeded_cb to vinyl_engine_begin_initial_recovery, because this is where we actually omit the scheduler fiber startup. Note, since now the scheduler fiber goes straight to business once started, we can't start worker threads in the fiber function as we used to, because then workers threads would be running even if vinyl was unused. So we move this code to vy_worker_pool_get, which is called when a worker is actually needed to run a task.
-
Vladimir Davydov authored
It is not used anywhere anymore.
-
Vladimir Davydov authored
Using the same thread pool for both dump and compaction tasks makes estimation of dump bandwidth unstable. For instance, if we have four worker threads, then the observed dump bandwidth may vary from X if there's high compaction demand and all worker threads tend to be busy with compaction tasks to 4 * X if there's no compaction demand. As a result, we can overestimate the dump bandwidth and trigger dump when it's too late, which will result in hitting the limit before dump is complete and hence stalling write transactions, which is unacceptable. To avoid that, let's separate thread pools used for dump and compaction tasks. Since LSM tree based design typically implies high levels of write amplification, let's allocate 1/4th of all threads for dump tasks and use the rest exclusively for compaction.
-
Vladimir Davydov authored
Call vy_worker_pool_get() from vy_scheduler_peek_{dump,compaction} so that we can use different worker pools for dump and compaction tasks.
-
Vladimir Davydov authored
A worker pool is an independent entity that provides the scheduler with worker threads on demand. Let's factor it out so that we can introduce separate pools for dump and compaction tasks.
-
Vladimir Davydov authored
Background tasks are allocated infrequently, not more often than once per several seconds, so using mempool for them is unnecessary and only clutters vy_scheduler struct. Let's allocate them with malloc().
-
Vladimir Davydov authored
Needed solely to improve code readability. No functional changes.
-
- Sep 06, 2018
-
-
Konstantin Osipov authored
-
Georgy Kirichenko authored
A possibility to build tarantool with included library dependencies. Use the flag -DBUILD_STATIC=ON to build statically against curl, readline, ncurses, icu and z. Use the flag -DOPENSSL_USE_STATIC_LIBS=ON to build with static openssl Changes: * Add FindOpenSSL.cmake because some distributions do not support the use of openssl static libraries. * Find libssl before curl because of build dependency. * Catch all bundled libraries API and export then it in case of static build. * Rename crc32 internal functions to avoid a name clash with linked libraries. Notes: * Bundled libyaml is not properly exported, use the system one. * Dockerfile to build static with docker is included Fixes #3445
-
- Sep 04, 2018
-
-
Vladimir Davydov authored
-
Vladimir Davydov authored
Now box.cfg() doesn't return until 'quorum' appliers are in sync not only on initial configuration, but also on replication configuration update. If it fails to synchronize within replication_sync_timeout, box.cfg() returns without an error, but the instance enters 'orphan' state, which is basically read-only mode. In the meantime, appliers will keep trying to synchronize in the background, and the instance will leave 'orphan' state as soon as enough appliers are in sync. Note, this patch also changes logging a bit: - 'ready to accept request' is printed on startup before syncing with the replica set, because although the instance is read-only at that time, it can indeed accept all sorts of ro requests. - For 'connecting', 'connected', 'synchronizing' messages, we now use 'info' logging level, not 'verbose' as they used to be, because those messages are important as they give the admin idea what's going on with the instance, and they can't flood logs. - 'sync complete' message is also printed as 'info', not 'crit', because there's nothing critical about it (it's not an error). Also note that we only enter 'orphan' state if failed to synchronize. In particular, if the instnace manages to synchronize with all replicas within a timeout, it will jump from 'loading' straight into 'running' bypassing 'orphan' state. This is done for the sake of consistency between initial configuration and reconfiguration. Closes #3427 @TarantoolBot document Title: Sync on replication configuration update The behavior of box.cfg() on replication configuration update is now consistent with initial configuration, that is box.cfg() will not return until it synchronizes with as many masters as specified by replication_connect_quorum configuration option or the timeout specified by replication_connect_sync occurs. On timeout, it will return without an error, but the instance will enter 'orphan' state. It will leave 'orphan' state as soon as enough appliers have synced.
-
Olga Arkhangelskaia authored
In the scope of #3427 we need timeout in case if an instance waits for synchronization for too long, or even forever. Default value is 300. Closes #3674 @locker: moved dynamic config check to box/cfg.test.lua; code cleanup @TarantoolBot document Title: Introduce new configuration option replication_sync_timeout After initial bootstrap or after replication configuration changes we need to sync up with replication quorum. Sometimes sync can take too long or replication_sync_lag can be smaller than network latency we replica will stuck in sync loop that can't be cancelled.To avoid this situations replication_sync_timeout can be used. When time set in replication_sync_timeout is passed replica enters orphan state. Can be set dynamically. Default value is 300 seconds.
-
Olga Arkhangelskaia authored
In #3427 replication_sync_lag should be taken into account during replication reconfiguration. In order to configure replication properly this parameter is made dynamic and can be changed on demand. @locker: moved dynamic config check to box/cfg.test.lua @TarantoolBot document Title: recation_sync_lag option can be set dynamically box.cfg.recation_sync_lag now can be set at any time.
-
- Sep 03, 2018
-
-
Konstantin Osipov authored
Ensure box.ctl.wait_ro() and box.ctl.wait_rw() produce meaningful results even when invoked before box.cfg{}: wait for box.cfg{} to complete and the server to enter the right state. Add a test case. In scope of gh-3159
-
- Aug 31, 2018
-
-
Konstantin Osipov authored
-
Vladimir Davydov authored
-