- Oct 28, 2019
-
-
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
-
Vladislav Shpilevoy authored
Closes #4519 @TarantoolBot document Title: key_def.new() accept both 'field' and 'fieldno' Before the patch key_def.new() took an index part array as it is returned in <index_object>.parts: each part should include 'type', 'fieldno', and what else .parts element contains. But it was not possible to create a key_def from an index definition - the array passed to <space_object>.create_index() 'parts' argument. Because key_def.new() didn't recognize 'field' option. That might be useful, when a key_def is needed on a remote client, where a space object and its indexes do not exist. And it would be strange to force a user to create them just so as he would be able to access <net_box connection>.space.<space_name>. index.<index_name>.parts As well as it would be crutchy to make a user manually replace 'field' with 'fieldno' in its index definition just to create a key_def. Additionally, an ability to pass an index definition to a key_def constructor makes the API more symmetric. Note, that it still is not 100% symmetric, because a user can't pass field names to the key_def constructor. A space is needed for that anyway.
-
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
-
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
-
- 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>
-
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>
-
Nikita Pettik authored
In scope of 8fac6972 it was fixed misbehavior while passing floating point values to integer iterator. Unfortunately, that patch introduced off-by-one error. Number of constraints (equalities and inequalities) can not be greater than number of key parts (obviously, each constraint can be tested against at most one index part). Inequality constraint can involve only field representing last key part. To get it number of constraints was used as index. However, since array is 0-based, the last key part should be calculated as parts[eq_numb - 1]. Before this patch it was parts[eq_numb]. Closes #4558
-
Ilya Kosarev authored
If a tarantool instance exits while joining replica is in progress, the replica joining thread can access already freed data resulting in a crash. Let's fix this the same way we did for checkpoint thread - simply cancel the thread forcefully and wait for it to terminate. Closes #4528
-
- 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>
-
Kirill Yukhin authored
-
- 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
-
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
-
Ilya Kosarev authored
Wrap throwing lua_newthread in luaT_newthread using luaT_cpcall to process arising error properly. Closes #4556
-
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
-
- Oct 20, 2019
-
-
Nikita Pettik authored
expmask indicated necessity to recompile statement after parameter was bound: it might turn out that parameter can affect query plan. However, part of this mechanism has been removed long ago as a SQLite's legacy. In its current state expmask is likely to be useless and assertions involving it are obviously unsuitable. This patch completely removes expmask and related routines. Closes #4566
-
- 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>
-
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>
-
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>
-
Kirill Shcherbatov authored
All user-defined functions feature type of returned value (if it is not specified during function creation, it is assumed to be ANY), but currently it is ignored. This patch introduces check which verifies that returned value is of specified in function's definition type. There's no attempt at implicit conversion to specified (target) type - returned value must be literally of the specified type. Closes #4387
-
Kirill Shcherbatov authored
Start using comprehensive serializer luaL_tofield() to prepare LUA arguments for UDFs. This allows to support cdata types returned from Lua function. Needed for #4387 @TarantoolBot document Title: UDF returning nil or box.NULL in SQL Values nil and box.NULL returned by UDF in SQL both transformed to SQL NULL and are equal. Example: tarantool> box.execute("SELECT LUA('return box.NULL') is NULL and LUA('return nil') is NULL") --- - metadata: - name: LUA('return box.NULL') is NULL and LUA('return nil') is NULL type: boolean rows: - [true] ...
-
Kirill Shcherbatov authored
This patch introduces handling the situation when UDF returns too many values. Previously Tarantool used to silently use the first value returned. Now an error is raised. Moreover a test coverage is improved also for the situation when no value is returned. Needed for #4387
-
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
-
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
-
- Oct 16, 2019
-
-
Kirill Shcherbatov authored
This patch changes OP_Function parameters convention: now a function's name is passed instead of pointer to the function object. This allows to normally handle the situation, when UDF has been deleted to the moment of the VDBE code execution. In particular case this may happen with CK constraints that refers to a deleted persistent function. Closes #4176
-
Kirill Shcherbatov authored
Closes #4244 @TarantoolBot document Title: an ability to disable CK constraints Now it is possible to disable and enable ck constraints. All ck constraints are enabled by default when Tarantool is configured. Ck constraints checks are not performed during standard recovery, but performed during force_recovery - all conflicting tuples are skipped in case of ck_constraint conflict. To change CK constraint "is_enabled" state, call -- in LUA ck_obj:enable(new_state in {true, false}) -- in SQL ALTER TABLE {TABLE_NAME} {EN, DIS}ABLE CHECK CONSTRAINT {CK_NAME}; Example: box.space.T6.ck_constraint.ck_unnamed_T6_1:enable(false) box.space.T6.ck_constraint.ck_unnamed_T6_1 - space_id: 512 is_enabled: false name: ck_unnamed_T6_1 expr: a < 10 box.space.T6:insert({11}) -- passed box.execute("ALTER TABLE t6 ENABLE CHECK CONSTRAINT \"ck_unnamed_T6_1\"") box.space.T6:insert({12}) - error: 'Check constraint failed ''ck_unnamed_T6_1'': a < 10'
-
Kirill Shcherbatov authored
Now it is possible to disable and enable ck constraints in LUA. This option is persistent. All ck constraints are constructed in enabled state when Tarantool is configured. This ability may be usefulwhen processed data is verified and constraints validation is not required. For instance, during casual recovery process there's no need to provide any checks since data is assumed to be consistent. Persisting is_enabled flag is an important feature. If the option is not stored the following scenario is possible: - the option is turned off - data is changed so that a constraint is violated - the system is restarted while the option state is lost - there is no way (even in theory) to discover it and find that data is incorrect. Part of #4244
-
- 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.
-
Kirill Shcherbatov authored
The trigger pointer in the sql_trigger structure is a dead code now, so it could be deleted. Needed for #4343
-
- Oct 14, 2019
-
-
Mergen Imeev authored
Prior to this patch, the auto-increment feature could only be set in an INTEGER field of PRIMARY KEY if the PRIMARY KEY consisted of a single field. It was not possible to use this feature if the PRIMARY KEY consisted of more than one field. This patch defines two ways to set AUTOINCREMENT for any INTEGER or UNSIGNED field of PRIMARY KEY. Closes #4217 @TarantoolBot document Title: The auto-increment feature for multipart PK The auto-increment feature can be set to any INTEGER or UNSIGNED field of PRIMARY KEY using one of two ways: 1) AUTOINCREMENT in column definition: CREATE TABLE t (i INT, a INT AUTOINCREMENT, PRIMARY KEY (i, a)); CREATE TABLE t (i INT AUTOINCREMENT, a INT, PRIMARY KEY (i, a)); 2) AUTOINCREMENT in PRIMARY KEY definition: CREATE TABLE t (i INT, a INT, PRIMARY KEY (i, a AUTOINCREMENT)); CREATE TABLE t (i INT, a INT, PRIMARY KEY (i AUTOINCREMENT, a));
-
- 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
-
- 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
-
Kirill Yukhin authored
-
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>
-
- 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>
-
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>
-
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>
-
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>
-
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>
-
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>
-
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>
-