Commits


ctl: added functionality to detect and prune dead replicas After restart of replicaset or after some configuration changes replicaset may suffer from littering the system space by "dead" replicas. To detect and throw away such replica replicaset_list_inactive(), replica_prune(), replicaset_purge() are introduced. replicaset_list_inactive() returns uuid table of dead replicas replica_prune(uuid) throws away replica with given id from system space replicaset_purge([uuid]) throws away table of dead replicas, that is provided by admin or by replicaset_list_inactive(). Closes #3110 @TarantoolBot document Title: Introduce replicaset_list_inactive(), replica_prune(uuid), replicaset_purge([uuid]) After some changes in replicaset (restart, configuration change) replicaset may suffer from leftovers or previous configurations: empty replicas with uuid, but without any read/write activity. To delete such trash from system the space space, replicaset_list_inactive(), replica_prune(), replicaset_purge() are introduced. replicaset_list_inactive() lists uuid table of such "zombie" replicas. replica_prune(uuid) throws away replica with given id from system space replicaset_purge([uuid]) throws away table of dead replicas, that is provided by admin or by replicaset_list_inactive().


sql: check read access while executing SQL query Since SQL front-end is not using box API, no checkes for read access are performed by VDBE engine. Add check to IteratorOpen op-code to make sure that read privilege exists for given space. Note, that there's is no need to perform DML/DDL checkes as they're performed by Tarantool's core. @TarantoolBot document Title: Document behaviour of SQL in presence of read access restrictions. Need to clarify, that if there's no read access to the space, then not only SELECT statements will fail, but also those DML which implies reading from spaces indirectly, e.g.: UPDATE t1 SET a=2 WHERE b=3; Closes #2362


sql: use space_by_name in SQL Since hash, which maps space name to space pointer was introduced in previous patch, use it in SQL front-end as it is heavily needed. @locker: removed a couple of useless assertions and variable renames


schema: add space name cache Since SQL is heavily using name -> space mapping, introduce (instead of scanning _space space) dedicated cache, which maps space name to space pointer. @locker: code cleanup


alter: install space commit/rollback triggers before preparing sql view sql_compile_view() may fail, in which case the space will never be deleted from (in case of space creation) or inserted back into (in case of space drop) the space cache, because commit/rollback triggers, which are supposed to do the job, are only installed after preparing a view. Fix this by installing triggers before sql_compile_view(). No need to write a test as without this commit sql/view test will crash after applying the next commit (the one that introduces space name cache). Fixes commit dc358cb01428 ("sql: rework VIEW internals").