- Oct 28, 2019
-
-
Alexander Turenko authored
Added --exclude option (#54). (cherry picked from commit c17c10a4)
-
Alexander Turenko authored
This allows to overcome problems when CMake chooses one toolchain to build tarantool, but a library (libluajit.a or libcurl.a) is built using another (incompatible) toolchain. Fixes #4587. (cherry picked from commit 1eead75e)
-
Alexander Turenko authored
FreeBSD has OpenSSL as part of the base system: libraries are located in /usr/lib, headers are in /usr/include. However a user may install the library into /usr/local/{lib,include} from ports / pkg. In this case tarantool did choose /usr/local version, while libcurl will pick up a base system library. This is fixed by passing --with-ssl option with an argument (/usr/local or /usr if custom -DOPENSSL_ROOT_DIR=<...> is not passed). Now the behaviour is the following. If -DOPENSSL_ROOT_DIR=<...> is passed, then try to use OpenSSL from it. Otherwise find the library in /usr/local and then in /usr. This is right as for tarantool's crypto module as well as for libcurl submodule. There is a flaw here: a user is unable to choose a base system library if a ports / pkg version of OpenSSL is installed. The reason here is that tarantool's crypto module depends on other libraries and -I/usr/local/include may be added to build options. I have no good solution for that, so `cmake . -DOPENSSL_ROOT_DIR=/usr` will give a warning on FreeBSD and `gmake` likely will fail if libraries are of different versions (see cmake/os.cmake comments for more information). See also a [discussion][1] in FreeBSD community about all those /usr and /usr/local problems. There were two other problems that may fail tarantool build on FreeBSD: they are fixed in this commit and described below. First, libcurl's configure script chooses GCC by default if it exists (say, installed from ports / pkg). It is unexpected behaviour when tarantool sources itself are built with clang. Now it is fixed by passing a compiler explicitly to the libcurl's configure script: the library will use base system clang by default or one that a user pass to tarantool's cmake. Side note: GCC has /usr/local/include in its default headers search paths; libcurl's configure script chooses GCC as a compiler and OpenSSL from a base system by default (when CC and --with-ssl=<...> are not set) that leads to OpenSSL header / library mismatch. It is the primary reason of the build fail that was fixed in 1f2338bd ('build: FreeBSD packages installation'). It is not much relevant anymore, because we don't try to link with a base system OpenSSL if /usr/local one exists (however if it is asked explicitly with -DOPENSSL_ROOT_DIR=<...> we'll do, but will give a warning). Anyway, it is important to know such details if we'll change build scripts in a future. Second, backtraces are not supported on FreeBSD, but were enabled if libunwind headers is found. This leads to an error on cmake stage, because of inability to find a right library (this is a bug). Now we disable backtraces on FreeBSD by default even if libunwind is found. See When CC is passed to libcurl's configure script, the new problem opens on Mac OS. CMake chooses XCode toolchain by default (at least on a particular system where I tried it), which requires -isysroot=<SDK_PATH> option to be passed to a preprocessor and a compiler in order to find system headers. See [2] for more information. [1]: https://wiki.freebsd.org/WarnerLosh/UsrLocal [2]: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035623 Follows up #4490. (cherry picked from commit ea5929db)
-
Vladislav Shpilevoy authored
Before the patch there was a race in replication password configuration. It was possible that a replica connects to a master with a custom password before that password is actually set. The replica treated the error as critical and exited. But in fact it is not critical. Replica even can withstand absence of a user and keeps reconnecting. Wrong password situation arises from the same problem of non atomic configuration and is fixed the same - keep reconnect attempts if the password was wrong. Closes #4550 (cherry picked from commit aa2e2c56)
-
Vladislav Shpilevoy authored
The previous patch introduced a way to set box.cfg options in a strict order, even on a reconfiguration. It was used to set listen before replication. The same order problem existed for replication settings. A user could do box.cfg{ replication_connect_quorum = 0, replication = {...} } and expect, that due to quorum 0 the cfg() will return immediately. But actually the behaviour was undefined - due to arbitrary order of keys in a Lua table, replication could be applied before quorum. The patch makes all replication settings be applied before replication. Follow up #4433 Part of #3760 (cherry picked from commit 00c6c437)
-
Vladislav Shpilevoy authored
Before the patch the nil UUID was ignored and a new random one was generated. This was because internally box treats nil UUID as its absence. Now a user will see an explicit message that nil UUID is a reserved value. Closes #4282 (cherry picked from commit a8ebd334)
-
- Oct 24, 2019
-
-
Alexander V. Tikhonov authored
Added Ubuntu 19.10 Eoan Ermine into CI. Close #4583 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit c6cd2e62)
-
Oleg Babin authored
Before this patch RUN_TESTS condition in Dockerfile.staticbuild was ignored and always was true. However adding of brackets solves only part of problem. If RUN_TESTS is empty `sh -c` returns 1 and build fails. However if we run tests we should fail build if tests are not passed. Ternary logic was rewritten to fair if-else. This patch fixes it and allows build tarantool statically without running tests. @Totktonada: Fixed .gitlab.mk to pass RUN_TESTS environment variable to docker build arguments. Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 8c85dbc7)
-
- Oct 23, 2019
-
-
Serge Petrenko authored
After we started using bundled version of libyaml by default (see commit 47b91e90), we can remove it from building dependencies for RPM and DEB packages. Closes #4442 Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 1d4e584a)
-
- Oct 21, 2019
-
-
Kirill Shcherbatov authored
Is_nullable JSON-path indexes used to lose is_nullable property being defined on a space having format. This patch fixes this problem. Closes #4520 (cherry picked from commit 3d01b3af)
-
Kirill Shcherbatov authored
Functional index extractor code used to raise an invalid error message when the user-defined extractor function returns a scalar instead of a table. Closes #4553 (cherry picked from commit 260a3b3a)
-
Ilya Kosarev authored
Wrap throwing lua_newthread in luaT_newthread using luaT_cpcall to process arising error properly. Closes #4556 (cherry picked from commit 54e23d6d)
-
Ilya Kosarev authored
End recovery (which means building secondary indexes) just after last known log file was read. This allows fast switch to hot standby instance without any delay for secondary index to be built. Due to engine_end_recovery carryover, xdir_collect_inprogress, previously being called from it, is now moved to garbage collector. Closes #4135 (cherry picked from commit 5aa243de)
-
- Oct 17, 2019
-
-
Vladislav Shpilevoy authored
Console client's eval() method in case of an error at reading from a socket was trying to return a variable declared in a different view scope. Instead, the error should be raised to drop the connection. Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 89ec1d97)
-
Cyrill Gorcunov authored
When we handle unix console connection we should setup eos if only we meet "\set output" command in a stream. For example there could be "\set language" which should not affect eos settings. Closes #4568 Reported-by:
Alexander Turenko <alexander.turenko@tarantool.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 092cd675)
-
Cyrill Gorcunov authored
This will allow us to reuse this map in other routines and same time optimize memory allocation a bit. Part-of #4568 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> (cherry picked from commit 44bfb4f1)
-
Vladislav Shpilevoy authored
Rows_per_wal option was deprecated because it can be covered by wal_max_size. In order not to complicate WAL code with that option's support this commit drops it completely. In some tests the option was used to create several small xlog files. Now the same is done via wal_max_size. Where it was needed, number of rows per wal is estimated as wal_max_size / 50. Because struct xrow_header size ~= 50 not counting paddings and body. Note, file box/configuration.result was deleted here, because it is a stray result file, and it contained the rows_per_wal option mentioning. Its test was dropped much earlier in fdc3d1dd. Closes #3762 (cherry picked from commit c6012920)
-
Vladislav Shpilevoy authored
In patch c6bea65f I added a bug - replication/misc leaves a bad value in box.cfg.replication. Before that patch the test was resetting this to empty replication. In my patch I forgot about that, and left there the value {box.cfg.listen, "12345"} This patch cleans it up. Follow up #3760 (cherry picked from commit 399899a1)
-
- Oct 15, 2019
-
-
Alexander Turenko authored
test_run:wait_upstream() and test_run:wait_downstream() now wait until an upstream / a downstream appears. This prevents an attempt to index a nil value when one of those functions are called before a record about a peer appears in box.info.replication. It was observed on replication/show_error_on_disconnect test after commit c6bea65f ('replication: recfg with 0 quorum returns immediately'). Fixes #4563. (cherry picked from commit 18864835)
-
- Oct 12, 2019
-
-
Vladislav Shpilevoy authored
Replication quorum 0 not only affects orphan status, but also, according to documentation, makes box.cfg() return immediately regardless of whether connections to upstreams are established. It was not so before the patch. What is worse, even with non 0 quorum the instance was blocked on reconfiguration for connect timeout seconds, if at least one node is not connected. Now quorum is respected on reconfiguration. On a bootstrap it is still impossible to return earlier than replication_connect_timeout, because nodes need to choose some cluster settings. Too early start would make it impossible - cluster's participants will just start and choose different cluster UUIDs. Closes #3760 (cherry picked from commit c6bea65f)
-
- Oct 09, 2019
-
-
Serge Petrenko authored
A successfully fetched remote instance ballot isn't updated during bootstrap procedure. This leads to a case when different instances choose different masters as their bootstrap leaders. Imagine such a situation. You start instance A without replication set up. Instance A successfully bootstraps. You also have instances B and C both with replication set up to {A, B, C} and replication_connect_quorum set to 3 You first start instance B. It doesn't proceed to choosing a leader until one of the events happens: either the replication_connect_timeout runs out, or instance C is up and starts listening on its port. B has established connection to A and fetched its ballot, with some vclock, say, {1: 1}. B retries connection to C every replication_timeout seconds. Then you start instance C. Instance C succeeds in connecting to A and B right away and bootstraps from instance A. Instance A registers C in its _cluster table. This registration is replicated to instance C. Meanwhile, instance C is trying to sync with quorum instances (which is 3), and stays in orphan mode. Now replication_timeout on instance B finally runs out. It retries a previously unsuccessful connection to C and succeeds. C sends its ballot to B with vclock = {1: 2, 2:0} (in our example), since it has already incremented it after _cluster registration. B sees that C has a greater vclock than A, and chooses to bootstrap from C instead of A. C is orphan and rejects B's attempt to join. B dies. To fix such ungentlemanlike behaviour of C, we should at least include loading status in ballot and prefer fully bootstrapped instances to the ones still syncing with other replicas. We also need to use a separate flag instead of ballot's already existent is_ro, since we still want to prefer loading instances over the ones explicitly configured to be read-only. Closes #4527 (cherry picked from commit dc1e4009)
-
Kirill Yukhin authored
(cherry picked from commit 8749b3e1)
-
Cyrill Gorcunov authored
During rework of the console lua mode series the declaration of variable has been lost and this cause test case for remote unix console connection to fail. Fixes issue from c358398c Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit df821d0f)
-
- Oct 04, 2019
-
-
Cyrill Gorcunov authored
To be consistent in naming scheme, for example we already have parse_operators. Part-of #3834 Reviewed-by:
Konstantin Osipov <kostja.osipov@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit af9ef211)
-
Cyrill Gorcunov authored
The other modules would be able to find out which eos marker is currently active. For example when reading replies from remote server via text based console protocol. @TarantoolBot document Title: > require('console').eos() Returns a string with currently active end of string marker. Part-of #3834 Reviewed-by:
Konstantin Osipov <kostja.osipov@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit 9d83b5f6)
-
Cyrill Gorcunov authored
If we change output mode on remote machine via text-based session node a (server) ------ require('console').listen('unix/:/tmp/X.sock') ... node b (client) ------ require('console').connect('unix/:/tmp/X.sock') connected to unix/:/tmp/X.sock ... unix/:/tmp/X.sock> \set output lua the client get stuck forever, it is because the text wire protocol waits for yaml eos terminator which of course never hit the peer, because lua mode uses own one. Thus to fix this problem we have to preprocess the text we're passing to the server, just like we do in local console. So we reuse command parsing code and remember current output terminator in text_connection_mt instance. Another problem is that named default output mode. There could be a mixed environment where server operates in default lua mode but client connects with yaml mode. To break a tie we yield "\set output" command with current output mode when establishing a connection. Since the output format is per-session bound this doesn't affect any other connections on a server. Part-of #3834 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit c358398c)
-
Cyrill Gorcunov authored
We will need to parse and verify "\set" commands in remote console text-wire protocol thus to not duplicate the code lets factor helper out for reuse sake. Part-of #3834 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit 96dbc49d)
-
Cyrill Gorcunov authored
This will help us to distinguish end of string/stream in text protocols (such as remote console connection). Note that we start printing ";" terminator for every lua output. Actually current yaml output does the same but inside console.c module. And since lua output is yet a new feature in stabilization phase we're safe to make such changes without breaking api. Part-of #3834 Reviewed-by:
Konstantin Osipov <kostja.osipov@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit d67808fa)
-
Cyrill Gorcunov authored
This allows lua to not create them every call since they are constant speeding up processing a bit. Part-of #3834 Reviewed-by:
Konstantin Osipov <kostja.osipov@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit 840a7646)
-
Cyrill Gorcunov authored
Sole symbols (such as box.NULL) are not processed by serpent "custom" symbols feature, since they are not in table. Thus we should process them separately. Without it we have > require('console').set_default_output("lua,block") > ; > box.NULL > "cdata<void %*>: NULL"; instead of > box.NULL > box.NULL; as it should be. Part-of #3834 Reviewed-by:
Konstantin Osipov <kostja.osipov@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit 6847367f)
-
Cyrill Gorcunov authored
fiber_stack_destroy() doesn't depend on cord() helper but rather accepts slab cache pointer in arguments, lets make the same in fiber_stack_create() helper, otherwise it looks quite imbalanced. Signed-off-by:
Kirill Yukhin <kyukhin@tarantool.org> (cherry picked from commit fa6d78b397d375d4c18875ac72b3798b2e06a1e8)
-
Cyrill Gorcunov authored
The mprotect() syscall may fail due to heavy memory pressure (say there is no enough resources to split VMAs and etc). In this case we must not proceed without guard page but refuse to create a new fiber. Closes #4541 Signed-off-by:
Kirill Yukhin <kyukhin@tarantool.org> (cherry picked from commit e58dfe07189134297ea956eb70cd7d96e20a6c6e)
-
Cyrill Gorcunov authored
This will allow us to call it from inside fiber_stack_create as we need to clean up resources on error. Part-of #4541 Signed-off-by:
Kirill Yukhin <kyukhin@tarantool.org> (cherry picked from commit 8f1251d3611aa30d5bb6098716e965fd8dc08551)
-
- Oct 01, 2019
-
-
Roman Khabibov authored
(cherry picked from commit 0b9de586)
-
Roman Khabibov authored
Count lines in the json parsing structure. It is needed to print the number of line and column where a mistake was made. Closes #3316 (cherry picked from commit 9f9bd3eb2d064129ff6b1a764140ebef242d7ff7) (cherry picked from commit 53d43160)
-
Vladislav Shpilevoy authored
Code to run main script (passed via command line args, or interactive console) has a footer where it notifies systemd, logs a happened error, and panics. Before the patch that code was unreachable in case of any exception in a main script, because panic happened earlier. Now a happened exception is correctly carried to the footer with proper error processing. A first and obvious solution was replace all panics with diag_set and use fiber_join on the script runner fiber. But appeared, that the fiber running a main script can't be joined. This is because normally it exits via os.exit() which never returns and therefore its caller never dies = can't be joined. The patch solves this problem by passing main fiber diag to the script runner by pointer, eliminating fiber_join necessity. Closes #4382 (cherry picked from commit 157a2d88)
-
- Sep 25, 2019
-
-
Vladislav Shpilevoy authored
Closes #4434 Follow-up #4366 @TarantoolBot document Title: json/msgpack.cfg.encode_deep_as_nil option Tarantool has several so called serializers to convert data between Lua and another format: YAML, JSON, msgpack. YAML is a crazy serializer without depth restrictions. But for JSON, msgpack, and msgpackffi a user could set encode_max_depth option. That option led to crop of a table when it had too many nested levels. Sometimes such behaviour is undesirable. Now an error is raised instead of data corruption: t = nil for i = 1, 100 do t = {t} end msgpack.encode(t) -- Here an exception is thrown. To disable it and return the old behaviour back here is a new option: <serializer>.cfg({encode_deep_as_nil = true}) Option encode_deep_as_nil works for JSON, msgpack, and msgpackffi modules, and is false by default. It means, that now if some existing users have cropping, even intentional, they will get the exception. (cherry picked from commit d7a8942a)
-
Vladislav Shpilevoy authored
Tuple is a C library exposed to Lua. In Lua to translate Lua objects into tuples and back luaL_serializer structure is used. In Tarantool we have several global serializers, one of which is for msgpack. Tuples store data in msgpack, and in theory should have used that global msgpack serializer. But in fact the tuple module had its own private serializer because of tuples encoding specifics such as never encode sparse arrays as maps. This patch makes tuple Lua module use global msgpack serializer always. But how does tuple handle sparse arrays now? In fact, the tuple module still has its own serializer, but it is updated each time when the msgpack serializer is changed. Part of #4434 (cherry picked from commit 676369b1)
-
Vladislav Shpilevoy authored
Msgpack Lua module is not a simple set of functions. It is a global serializer object used by plenty of other Lua and C modules. Msgpack as a serializer can be configured, and in theory its configuration updates should affect all other modules. For example, a user could change encode_max_depth: require('msgpack').cfg({encode_max_depth = <new_value>}) And that would make tuple:update() accept tables with <new_value> depth without a crop. But in fact msgpack configuration didn't affect some places, such as this one. And all the others who use msgpackffi. This patch fixes it, for encode_max_depth option. Other options are still ignored. Part of #4434 (cherry picked from commit 4bb253f7)
-
Vladislav Shpilevoy authored
There are some objects called serializers - msgpack, cjson, yaml, maybe more. They are global objects affecting both Lua and C modules. A serializer have settings which can be updated. But before the patch an update changed only C structure of the serializer. It made impossible to use settings of the serializers from Lua. Now any update of any serializer is reflected both in its C and Lua structures. Part of #4434 (cherry picked from commit fe4a8047)
-