- Feb 13, 2019
-
-
Mergen Imeev authored
Currently, if the count_changes pragma is enabled, the INSERT, REPLACE and UPDATE statements will return the number of changes at execution time. This patch sets an INTEGER type for this result. Follow up #3832 Needed from #3505
-
- Mar 29, 2019
-
-
Vladislav Shpilevoy authored
* fix some obvious errors in swim test utils; * fix a bug with NULL URI garbage on recfg; * fix typos in a comment and in a log message in swim.c; * do not start any timers in swim_cfg. Indeed, round timer should start only when at least one new member is added except self, and it is already done in swim_new_member; * log not only round begin, but each round step - it helps in debug, but does not affect production anyway because the logs are verbose; * in SWIM's event loop log new watch value instead of the old one - turned out, that new is more useful for debug; * log 'process <name> component' inside swim_process_<name>() functions. It is needed for failure detection, where a log of kind 'process failure detection' says nothing - much better to say 'process ping from', or 'process ack'; * in swim tests instead of swim_cluster_wait_...(max_steps) use swim_cluster_wait_...(timeout). Step count restriction appeared to be useful for anti-entropy being equal to number of round steps, but it is not so once failure detection appears. Replies for failure detection requests does not depend on SWIM heartbeat and affect step count in a not trivial way - it makes test writing, debugging and supporting much harder. Follow-up for 03b9a6e9
-
- Mar 28, 2019
-
-
Vladimir Davydov authored
This reverts commit c2de45c4. Not needed anymore as the DDL bug it was supposed to work around has been finally fixed. Follow-up #3420
-
Vladimir Davydov authored
A DDL operation creates a new struct space container, moving unaffected indexes from the old container, then destroying it. The problem is there may be a DML request for this space, which was passed the old container in the argument list and then yielded on disk read. When it resumes, it may try to dereference the old space container, which may have already been destroyed. This will most certainly result in a crash. To address this problem, we introduce a new space callback, invalidate, which is called for the old space on space_cache_replace(). In case of vinyl, this callback aborts all transactions involving the space. To prevent a DML request from dereferencing a destroyed space, we also make the iterator code check the current transaction state after each yield and return an error if it was aborted. This should make any DML request bail out early without dereferencing the space anymore. Closes #3420
-
Vladimir Davydov authored
The 'restore' method, which is implemented by txw, cache, and memory sources, restores an iterator position after a yield in case the source has changed. It is passed the last key and it is supposed to position the iterator to the statement following the last key provided it had to reposition the iterator at all. For all kinds of sources, it first checks the source version and bails out early if it hasn't changed since the last time the iterator was used. If it has changed, it either looks up the statement following the given last key or tries to advance the iterator statement by statement (in case of a cache iterator, to avoid extra cache lookups). Currently, the method returns 1 if the iterator position has actually changed as a result of the call, 0 otherwise. That is, it returns 0 even if the version has changed and it had to perform a full lookup, but landed on the same statement. This is confusing, because in this case the caller has to check if it has to advance the iterator even though it doesn't need to, as the iterator is already positioned at the next key - see vy_read_iterator_scan_* family of functions. Let's simplify the restoration rules - make the 'restore' method return 1 if it had to restore the iterator position irrespective of whether the position has actually changed or not. This means that in case the method returns 1, the caller knows that the iterator is already positioned properly and doesn't need to be advanced. If it returns 0, it means that the iterator is positioned at the same statement as before and we need to check if we need to advance it. This simplifies the iterator code by removing position checking, which would turn real nasty once multikey indexes are introduced. Note, comments to 'restore' methods already conform to this behavior (they weren't quite correct before this patch). There's a catch though - vy_read_iterator_restore_mem relies on the old behavior to skip the cache source in case the current key gets updated during yield. However, it's easy to fix that without introducing any extra overhead - we just need to check if the cache source is at the front of the iterator and clear its history if it is. BTW it turned out that this behavior wasn't covered by tests - when I removed the line invalidating the cache source from vy_read_iterator_restore_mem, all tests passed as usual. So while we are at it, let's also add a test case covering this piece of code.
-
Vladimir Davydov authored
We abort transactions when switching to read-only mode, building a new index, or reverting a statement after a failed WAL write. It's no use to allow an aborted transaction to proceed as usual until commit - we should fail it as early as we can to avoid wasting resources. Currently, we do it in a rather abrupt way - by an assertion :-) This patch makes any DML/DQL operation fail gracefully instead. Closes #4070
-
Vladimir Davydov authored
It is supposed to abort an iterator that read a statement reverted after a failed WAL write. However, we will abort such an iterator anyway - see vy_tx_abort_readers(). So let's drop the useless flag. It turned out that we never tested such a case (try grepping "read view is aborted" error). So let's also add a functional test for it.
-
Vladimir Davydov authored
When a few read intervals are merged, we must fix up tx memory stats. Closes #4071
-
Ivan Koptelov authored
Before the patch, collations with no strength set used tertiary strength. But it was not easy to understand it, because box.space._collation:select{} would return ... [1, 'unicode', 1, 'ICU', '', {}] ... for such collations. After the patch default value is set explicitly, so user would observe : ... [1, 'unicode', 1, 'ICU', '', {strength='tertiary'}] ... Closes #3573 @TarantoolBot document Title: default collation strength is explicit tertiary now Before the patch we already have tertiary strength is default strength for collations, but it was implicit: [1, 'unicode', 1, 'ICU', '', {}] After the patch it's just become explicit: 1, 'unicode', 1, 'ICU', '', {'strength' = 'tertiary'}] Also please fix this https://tarantool.io/en/doc/2.1/book/box/data_model/#collations There is line saying: "unicode collation observes all weights, from L1 to Ln (identical)" It was not true and now this fact would just become obvious.
-
lenkis authored
-
lenkis authored
-
lenkis authored
Fixes #3362.
-
Georgy Kirichenko authored
Disallow changes for non-local spaces during replication stream applying. As we do not support distributed transaction yet we could not provide a transactional replication for such side effects if there are not NOPed. Needed for: #2798 Follow up for: 27283deb
-
Alexander Turenko authored
The primary reason of this change is to keep compatibility of 1.10 release series with tarantool/stat-0.3.1, which expects that each box.stat.net.<...> and box.stat.net().<...> item is a table. This commit changes CONNECTIONS metric to be a table with 'current' field, which in turn contains current number of connections. Fixes #4039. @TarantoolBot document Title: box.stat.net.CONNECTIONS becomes a table The format of box.stat.net.CONNECTIONS and box.stat.net().CONNECTIONS is changed in order to keep all items being tables, because tarantool/stat-0.3.1 expects them to be tables (see [1] for more information). Example of box.stat.net() **before** this commit: ``` tarantool> box.stat.net() --- - SENT: total: 0 rps: 0 CONNECTIONS: 0 RECEIVED: total: 0 rps: 0 ... ``` And after: ``` tarantool> box.stat.net() --- - SENT: total: 0 rps: 0 CONNECTIONS: current: 0 RECEIVED: total: 0 rps: 0 ... ``` Look at the comment to lbox_stat_net_call() (see the linked commit) for meaning of total/rps/current fields. [1]: https://github.com/tarantool/tarantool/issues/4039
-
Kirill Shcherbatov authored
We must use long long unsigned numbers on ffi types build to avoid precision lost. Follow-up f5721edc test: check hints corner cases Closes #4080
-
Alexander Turenko authored
Added necessary cleanup, because the test fails when both memtx and vinyl configurations are run on the same test-run worker. Aside of that disabled the test on vinyl, because it is engine-agnostic and only checks iproto. This is the fix for the commit 7676b2b1 ('sql: make SQL_BIND optional in an iproto request'). Follows up #4077.
-
- Mar 27, 2019
-
-
Georgy Kirichenko authored
Applier fetch incoming rows to form a transaction and then apply it. Rows are fetched and stored on fiber gc region until last transaction row with is_commit was fetched. After fetch a multi row transaction is going to be applied into txn_begin/txn_commit/txn_rolback boundaries. At this time we could not apply single row transaction in such boundaries because of ddl which does not support non auto commit transactions. Closes: #2798 Needed for: #980
-
Kirill Shcherbatov authored
Introduced a new sql_normalize_name routine performing SQL name conversion to case-normal form via unicode character folding. For example, ß is converted to SS. The result is similar to SQL UPPER function. Closes #3931
-
Konstantin Osipov authored
-
Georgy Kirichenko authored
Allow single statement transactions within begin/commit in case of an ddl operation instead of auto commit requirements. This is essential for a transactional applier. Needed for: #2798
-
Alexander Turenko authored
The documentation [1] says this field is optional. I don't know which commit lead to the regression, only that 2.1.1-7-gd381a45b6 is good. [1]: https://tarantool.io/en/doc/2.1/dev_guide/internals/sql_protocol/ Fixes #4077.
-
- Mar 26, 2019
-
-
Mergen Imeev authored
This patch completely replaces sqlErrorMsg() with diag_set() and removes sqlErrorMsg(). Closes #3965 Closes #3036
-
Mergen Imeev authored
This patch reworks some of SQL semantic errors. Part of #3965
-
Alexander Turenko authored
Stop a file processing loop only when it is guaranteed that we will not find a record that match user-provided filters later in this file. If --replica R is provided one time and we're meet a record from R with a LSN equal or above of a --to value, we'll stop the loop. Otherwise (no --replica, several --replica arguments) a file will be read until an end even if --to is provided. Fixes #3827.
-
Alexander Turenko authored
Exposed this unified code (filter_xlog() function) and wrote a unit test. Allow to run app-tap/tarantoolctl.test.lua w/o test-run. Needed for #3827.
-
Roman Khabibov authored
It's OK to use json format with the boot logger. As for syslog, let's add a check to Lua's log_format() so that it fails gracefully rather than raising an assertion. Closes #3946
-
Georgy Kirichenko authored
Abort a new index creation if truncate couldn't be finished because of rollback or an error. Without this vinyl fails because of internal scheduler assertion. Needed for: 2798
-
Kirill Shcherbatov authored
We must to enshure that hints don't broke tuple comparison. As different field_types use different routines to calculate hint, we must to ensure that the calculated values are compatible with each other. Also tested the corner cases for large double numbers, due to the fact that there may be additional difficulties in hint construction. Follow-up 9fba29ab memtx: introduce tuple compare hint
-
Kirill Shcherbatov authored
Allow to call box.session.exists() and box.session.fd() without any arguments. In such case, current session is used. The box.session.peer() already support such feature, so we need it to be consistent. Closes #4021
-
Serge Petrenko authored
The test used to write big rows (20 mb in size), so when run in parallel mode, it put high load on the disk and processor, which made appliers time out multiple times during read, and caused the test to fail occasionally. So, instead of writing huge rows in test, introduce a new error injection restricting sio from reading more than a couple of bytes per request. This ensures that the test is still relevant and makes it a lot more lightweight. Closes #4062
-
Kirill Shcherbatov authored
Tarantool could not start from the snapshot created by version 2.1.0 because the new version 2.1.1 does not support the index.opts.sql index opt and stops the execution. Introduced a special state OPT_DEF_LEGACY macro to ignore legacy options and introduced migration code in upgrade.lua.
-
Mergen Imeev authored
At this point, an ANALYZE statement can lead to many problems. It was decided to temporarily ban this statement. Closes #4069
-
Vladislav Shpilevoy authored
Close #4050
-
- Mar 21, 2019
-
-
Vladimir Davydov authored
There's a bug in the code building index hash on recovery: we replace a dropped index with any newer index, even incomplete one. Apparently, this is wrong, because a dropped index may have been dropped during final recovery and hence is still needed for initial recovery. If we replace it with an incomplete index in the index hash, initial recovery will fail with ER_INVALID_VYLOG_FILE: Invalid VYLOG file: LSM tree 512/1 not found (see vy_lsm_recover()). Fix this problem by checking create_lsn of the index that is going to replace a dropped one - if it's negative, we must link it to the dropped index via vy_lsm_recovery_info->prepared instead of inserting it into the hash directly. Closes #4066
-
Kirill Shcherbatov authored
Previously, all tuples created with frommap() used default format table_format_runtime, and therefore the created data tuples were not checked for the ability to be inserted into the target space. Moreover frommap(...):tomap(...) procedures sequence also did not work because tomap(..) routine assumes that the tuple has format with field names. Closes #4045
-
- Mar 20, 2019
-
-
Nikita Pettik authored
During creation of VIEW space, string containing its definition (i.e. "SELECT ...") is parsed to fetch names of referenced spaces. By those names real struct space objects are found using schema_find_id(). This function processes lookup in _space using its secondary index. On the other hand, secondary indexes of _space are unavailable during this stage of recovery, so this lookup fails and whole recovery process aborts. It is worth mentioning that now we can fetch space directly from in-memory cache using its name (originally, when view reference counter was introduced, we couldn't do this due to absence of name-cache). So, to fix this issue, let's use space_by_name() instead of schema_find_id() Closes #3814
-
Nikita Pettik authored
Our SQL codebase was inherited from SQLite, where each table must have at least one index - primary (if no explicit PK declared, one based on rowid is implicitly created). In Tarantool spaces can exists without indexes. The only existing restriction is that they can't contain any data. Hence, even very basic queries fail with assertion/seagfault if they are applied to spaces with no indexes. Situation when space turns out to remain without PK is quite common due to the absence of transactional DDL: for instance, space drop procedure consists of several steps including dropping all indexes; space itself is dropped at the very end. Thus, if a sequence of queries is interrupted by drop space procedure and one is not finished, the rest of queries will operate on space with no indexes. As a solution to this problem (at least temporary) now we disallow query processing involving spaces without PK except for views. Closes #3780
-
- Mar 19, 2019
-
-
Mergen Imeev authored
Three errors of "unsupported" type were reworked in this patch. Part of ...3965
-
Mergen Imeev authored
This argument has practically no functionality, but deleting it allows us to replace the rc field of the Parse structure with a new bool field. Part of #3965
-
Ivan Koptelov authored
Without multi-directional iterators (to be introduced in #3309) ORDER BY + LIMIT with different specified ordered leads to wrong result. So for now (till #3309 is resolved) different sort orders are forbidden in ORDER BY + LIMIT. Close #4038 @TarantoolBot document Title: different sorting orders in ORDER BY are forbidden now The error will be raised if different sorting orders are encountered.
-