- Jul 31, 2018
-
-
Kirill Yukhin authored
-
Mergen Imeev authored
SQL functions UPPER and LOWER now works with COLLATE as they should according to ANSI Standart. Closes #3052.
-
- Jul 30, 2018
-
-
Vladimir Davydov authored
If vy_log_bootstrap() finds a vylog file in the vinyl directory, it assumes it has to be rebootstrapped and calls vy_log_rebootstrap(). The latter scans the old vylog file to find the max vinyl object id, from which it will start numbering objects created during rebootstrap to avoid conflicts with old objects, then it writes VY_LOG_REBOOTSTRAP record to the old vylog to denote the beginning of a rebootstrap section. After that initial join proceeds as usual, writing information about new objects to the old vylog file after VY_LOG_REBOOTSTRAP marker. Upon successful rebootstrap completion, checkpoint, which is always called right after bootstrap, rotates the old vylog and marks all objects created before the VY_LOG_REBOOTSTRAP marker as dropped in the new vylog. The old objects will be purged by the garbage collector as usual. In case rebootstrap fails and checkpoint never happens, local recovery writes VY_LOG_ABORT_REBOOTSTRAP record to the vylog. This marker indicates that the rebootstrap attempt failed and all objects created during rebootstrap should be discarded. They will be purged by the garbage collector on checkpoint. Thus even if rebootstrap fails, it is possible to recover the database to the state that existed right before a failed rebootstrap attempt. Closes #461
-
Vladimir Davydov authored
Since we don't create snapshot files for vylog, but instead append records written after checkpoint to the same file, we have to use the previous vylog file for backup (see vy_log_backup_path()). So when recovering from a backup we need to rotate the last vylog to keep vylog and checkpoint signatures in sync. Currently, we do it on recovery completion and we use vy_log_create() instead of vy_log_rotate() for it. This is done so that we can reuse the context that was used for recovery instead of rereading vylog for rotation. Actually, there's no point in this micro-optimization, because we rotate vylog only when recovering from a backup. Let's remove it and use vy_log_rotate() for this. Needed for #461
-
Vladimir Davydov authored
Currently only the remote address is printed. Let's also print the UUID, because replicas are identified by UUID everywhere in tarantool, not by the address. An example of the output is below: I> can't follow eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: required {1: 8} available {1: 12} C> replica is too old, initiating rebootstrap I> bootstrapping replica from eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083 I> can't follow eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: required {1: 17, 2: 1} available {1: 20} I> can't rebootstrap from eb81a67e-99ee-40bb-8601-99b03fa20124 at [::1]:58083: replica has local rows: local {1: 17, 2: 1} remote {1: 23} I> recovery start Suggested by @kostja. Follow-up ea69a0cd ("replication: rebootstrap instance on startup if it fell behind").
-
Vladimir Davydov authored
This function is not used anywhere since commit a1e005d8 ("vinyl: write_iterator merges vlsns subsequnces")
-
- Jul 27, 2018
-
-
Kirill Yukhin authored
SQLITE_ENABLE_PREUPDATE_HOOK is dead macro. Remove it. Part of #2356
-
Kirill Shcherbatov authored
To implement new TRUNCATE operation, we have introduced a new P2 argument for OP_Clear opcode that calles box_truncate instead of tarantoolSqlite3ClearTable. This operation should work faster than DELETE FROM; but have a few restricts. Closes #2201. @TarantoolBot document Title: New TRUNCATE operation TRUNCATE is DDL operation. Removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system resources. It couldn't be used with system tables or with tables having FKs. It also couldn't be called in transaction. The triggers on table will have ignored. Example: TRUNCATE TABLE t1;
-
- Jul 26, 2018
-
-
Konstantin Osipov authored
-
Konstantin Belyavskiy authored
Fix 'fio.rmtree' to remove a non empty directories. And update test. Closes #3258
-
Konstantin Belyavskiy authored
Fix 'fio.rmtree' to remove a non empty directories. And update test. Closes #3258
-
Serge Petrenko authored
Function access_check_ddl checked only for universal access, thus granting entity or singe object access to a user would have no effect in scope of this function. Fix this by adding entity access checks. Also attaching an existing sequence to a space checked for create privilege on both space and sequence (instead of read + write on sequence). Fixed it and changed the tests accordingly. Closes #3516
-
- Jul 24, 2018
-
-
Olga Arkhangelskaia authored
This check happens twice. The patch simply removes check.
-
Vladimir Davydov authored
Blackhole doesn't need transaction control as it doesn't actually store anything so we can mark it with ENGINE_BYPASS_TX.
-
Vladimir Davydov authored
-
Kirill Shcherbatov authored
Get rid of is_primkey in Column structure as it becomes redundant. Moved the last member coll with collation pointer to field_def structure. Finally, dropped Column.
-
Kirill Shcherbatov authored
-
Kirill Shcherbatov authored
This patch dissallows define multiple "NULL", "NOT NULL" options per column and fixes silent implicit behavior for invalid "NULL PRIMARY KEY" construction. Closes #3473.
-
- Jul 23, 2018
-
-
Vladimir Davydov authored
If a replica fell too much behind its peers in the cluster and xlog files needed for it to get up to speed have been removed, it won't be able to proceed without rebootstrap. This patch makes the recovery procedure detect such cases and initiate rebootstrap procedure if necessary. Note, rebootstrap is currently only supported by memtx engine. If there are vinyl spaces on the replica, rebootstrap will fail. This is fixed by the following patches. Part of #461
-
Vladimir Davydov authored
Sysview is a special engine that is used for filtering out objects that a user can't access due to lack of privileges. Since it's treated as a separate engine by the transaction manager, we can't query sysview spaces from a memtx/vinyl transaction. In particular, if called from a transaction space:format() will return error: A multi-statement transaction can not use multiple storage engines which is inconvenient. To fix this, let's mark sysview engine with a new ENGINE_BYPASS_TX flag and make the transaction manager skip binding a transaction to an engine in case this flag is set. Closes #3528
-
Vladimir Davydov authored
Blackhole is a very simple engine that allows to create spaces that may written to, but not read from. It only supports INSERT/REPLACE requests. It doesn't support any indexes hence SELECT is impossible. It does check space format though and supports on_replace and before_replace triggers. The whole purpose of this new engine is writing arbitrary rows to WAL without storing them anywhere. In particular, we need this engine to write deferred DELETEs generated for vinyl spaces to WAL. Needed for #2129
-
Vladimir Davydov authored
Needed for blackhole spaces, which don't support indexes per se, but still may have a before_replace trigger installed.
-
Kirill Yukhin authored
Basic structures (struct Table/Index) of legacy SQL's data dictionary used to so-called tnum to refer to engine's btree structures. Tarantool used this field to store composition of space_id and index_id. Recently both structures incorporated native space_def/index_def descriptors. This patch finally removes tnum field. It also refactors init_callback machinery, removing varargs from declarations. Closes #3482
-
- Jul 22, 2018
-
-
Vladimir Davydov authored
When a replica is removed from the cluster table, the corresponding replica struct isn't destroyed unless both the relay and the applier attached to it are stopped, see replica_clear_id(). Since replica struct is a holder of the garbage collection state, this means that in case an evicted replica has an applier or a relay that fails to exit for some reason, garbage collection will hang. A relay thread stops as soon as the replica it was started for receives a row that tries to delete it from the cluster table (because this isn't allowed by the cluster space trigger, see on_replace_dd_cluster()). If a replica isn't running, the corresponding relay can't run as well, because writing to a closed socket isn't allowed. That said, a relay can't block garbage collection. An applier, however, is deleted only when replication is reconfigured. So if a replica that was evicted from the cluster was configured as a master, its replica struct will hang around blocking garbage collection for as long as the replica remains in box.cfg.replication. This is what happens in #3546. Fix this issue by forcefully unregistering a replica with the garbage collector when it is deleted from the cluster table. This is OK as it won't be able to resubscribe and so we don't need to keep WALs for it any longer. Note, the relay thread may still be running when a replica is deleted from the cluster table, in which case we can't unregister it with the garbage collector right away, because the relay may need to access the garbage collection state. In such a case, leave the job to replica_clear_relay, which is called as soon as the relay thread exits. Closes #3546
-
- Jul 21, 2018
-
-
Vladimir Davydov authored
-
Vladimir Davydov authored
Currently, the way txn_stmt::old_tuple and new_tuple are referenced depends on the engine. For vinyl, the rules are straightforward: if txn_stmt::{old_tuple,new_tuple} is not NULL, then the reference to the corresponding tuple is elevated. Hence when a transaction is committed or rolled back, vinyl calls tuple_unref on both txn_stmt::old_tuple and new_tuple. For memtx, things are different: the engine doesn't explicitly increment the reference counter of the tuples - it simply sets them to the newly inserted tuple and the replaced tuple. On commit, the reference counter of the old tuple is decreased to delete the replaced tuple, while on rollback the reference counter of the new tuple is decreased to delete the new tuple. Because of this, we can't implement the blackhole engine (aka /dev/null) without implementing commit and rollback engine methods - even though such an engine doesn't store anything it still has to set the new_tuple for on_replace trigger and hence it is responsible for releasing it on commit or rollback. Since commit/rollback are rather inappropriate for this kind of engine, let's instead unify txn_stmt reference counting rules and make txn.c unreference the tuples no matter what engine is. This doesn't change vinyl, because it already conforms. For memtx, this means that we need to increase the reference counter when we insert a new tuple into a space - not a big deal as tuple_ref is almost free.
-
Nikita Pettik authored
By now, replace function takes new tuple and old tuple as arguments, instead of single txn_stmt. It has been done in order to avoid abusing txn_stmt: the only usage was extracting tuples from it. As a result, this function can be used by ephemeral tables without any patching. (cherry picked from commit 880712c9)
-
Vladimir Davydov authored
They are fairly small and closely related so let's merge them and call the result sysview.[hc].
-
Vladimir Davydov authored
This should reduce maintenance burden and help us introduce a new engine.
-
Vladimir Davydov authored
It will be used to check if a replica fell too much behind its peers and so needs to be rebootstrapped. Needed for #461
-
Vladimir Davydov authored
Not needed anymore as we now use the new IPROTO_VOTE command instead of IPROTO_VOTE_DEPRECATED. Let's remove it altogether and reuse its code for IPROTO_BALLOT (they are never decoded together so no conflict should happen). Worst that can happen is we choose a read-only master when bootstrapping an older version of tarantool.
-
Vladimir Davydov authored
This patch contains some follow-up fixes for fe8ae607 ("Introduce IPROTO_VOTE command"): - Rename 'status' to 'ballot' everywhere in the comments. - Rename IPROTO_REQUEST_VOTE to IPROTO_VOTE_DEPRECATED and iproto_reply_request_vote to iproto_reply_vote_deprecated to emphasize the fact that this iproto command has been deprecated and IPROTO_VOTE should be used instead. - Only send an IPROTO_VOTE request to a master if it is running tarantool 1.10.1 or newer.
-
- Jul 20, 2018
-
-
Vladimir Davydov authored
The new command is supposed to supersede IPROTO_REQUEST_VOTE, which is difficult to extend, because it uses the global iproto key namespace. The new command returns a map (IPROTO_BALLOT), to which we can add various information without polluting the global namespace. Currently, the map contains IPROTO_BALLOT_IS_RO and IPROTO_BALLOT_VCLOCK keys, but soon it will be added info needed for replica rebootstrap feature. Needed for #461
-
Kirill Yukhin authored
Schema reference is useless. Remove it.
-
Kirill Yukhin authored
During tnum removal, convertToWithoutRowidtable became redundant. Remove it, refactor addPrimaryIndex. Also fix naming for un-named indexes. Finally, remove iPKey from struct table and update testsuite. Part of #3482
-
N.Tatunov authored
Previously "BEGIN" / "BEGIN TRANSACTION", "COMMIT TRANSACTION" / "END" / "END TRANSACTION", "ROLLBACK TRANSACTION" could be used to handle transactions. By changing these commands syntax in parser we're aiming on getting closer to ANSI SQL. Also found initialization in ifdef that caused some problems with error messages in occasions when the wrong syntax was used. With the patch applied only following commands can be used: - "START TRANSACTION" to begin transaction. - "COMMIT" to end transaction. - "ROLLBACK" to rollback transaction without savepoints. - "ROLLBACK TO .." to rollback transaction to savepoint. Closes #2164
-
N.Tatunov authored
To optimize the select-subquery tarantool uses subquery flattening optimization which is only used with respect to some restrictions. When any of subselects but the last one has an ORDER BY clause we should raise an error. So subquery components containing it are not accepted to be optimized. Checking part was only checking if the last subselect contains the clause which led to an assertion fail. With the patch applied flattening is not used in case any of subselects has an ORDER BY. Closes #3353
-
- Jul 19, 2018
-
-
Kirill Yukhin authored
-
Kirill Yukhin authored
-
Kirill Shcherbatov authored
_say function was called with invalid arguments. Thank @sorc1 for patch. Closes #3433.
-