- Mar 28, 2019
-
-
Konstantin Osipov authored
Speed up txn_is_distributed() check by keeping track of the number of local rows of the transaction.
-
Konstantin Osipov authored
We need to keep count of different kind of rows in a transaction: - rows which already exist in some WAL and are replayed locally. These used to be called n_remote_rows, and renamed to n_applier_rows - rows which were created locally, on this server (previously called n_local_rows, renamed to n_new_rows). Of the latter, we need to distinguish between GROUP_ID=LOCAL rows, i.e. rows which need not be replicated, and GROUP_ID=REPLICA rows, which need to be replicated. For example, a remote transaction can fire local triggers which generate local rows. If these triggers generate rows which need to be replicated, the transaction has to be aborted. In a subsequent patch I plan to add n_local_rows, which tracks the number of new rows with GROUP_ID=local and use it in txn_is_distributed() check.
-
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
-
- Mar 27, 2019
-
-
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
-
- Mar 11, 2019
-
-
Georgy Kirichenko authored
Form a separate transaction with local changes in case of replication. This is important because we should be able to replicate such changes (e.g. made within an on_replace trigger) back. In the opposite case local changes will be incorporated into originating transaction and would be skipped by the originator replica. Needed for #2798
-
- Nov 09, 2018
-
-
Mergen Imeev authored
According to documentation some JDBC functions have an ability to return all ids that were generated in executed INSERT statement. This patch gives a way to implement such functionality. After this patch all ids autogenerated during VDBE execution will be saved and returned through IPROTO. Closes #2618
-
- Aug 01, 2018
-
-
Vladimir Davydov authored
Add txn_is_first_statement() function, which returns true if this is the first statement of the transaction. The function is supposed to be used from on_replace trigger to detect transaction boundaries. Needed for #2129
-
- Jul 23, 2018
-
-
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
-
- Jul 03, 2018
-
-
Konstantin Osipov authored
Before this patch, memtx would silently roll back a multi-statement transaction on yield, switching the session to autocommit mode. It would do nothing in case yield happened in a sub-statement in auto-commit mode. This could lead to nasty/painful to debug side-effects in malformed Lua programs. Fix by adding a special transaction state - aborted, and enter this state in case of implicit yield. Check for what happens when a sub-statement yields. Check that yield trigger is removed by a rollback. Fixes gh-2631 Fixes gh-2528
-
- Jun 27, 2018
-
-
Vladimir Davydov authored
-
- Jun 14, 2018
-
-
Vladislav Shpilevoy authored
Replace it with more specific structures and pointers in order to prepare to add `net` storage. This allows to make the code working with fiber storage simpler, remove useless wrappers and casts, and in the next patch - remove broken session.sync and add fiber sync. Note that under no circumstances fiber.h is allowed to include application-specific headers like session.h or txn.h. One only is allowed to announce a struct and add opaque pointer to it.
-
- May 11, 2018
-
-
Nikita Pettik authored
This patch makes possible to start transaction in Lua and continue operations in SQL as well, and vice versa. Previously, such transactions result in assertion fault. To support them, it is required to hold deferred foreign keys constraints as attributes of transaction, not particular VDBE. Thus, deferred foreign keys counters have been completely removed from VDBE and transfered to sql_txn struct. In its turn, if there is at least one deferred foreign key violation, error will be raised alongside with rollback - that is what ANSI SQL says. Note that in SQLite rollback doesn't occur: transaction remains open untill explicit rollback or resolving all FK violations. Also, 'PRAGMA defer_foreign_keys' has been slightly changed: now it is not automatically turned off after trasaction's rollback or commit. It can be turned off by explicit PRAGMA statement only. It was made owing to the fact that execution of PRAGMA statement occurs in auto-commit mode, so it ends with COMMIT. Hence, it turns off right after turning on (outside the transaction). Closes #3237
-
- Jan 23, 2018
-
-
Vladimir Davydov authored
If there are multiple on_replace triggers installed for the same space and one of them creates a new statement (by issuing a DML request), then the trigger that is called next will get the statement created by the previous trigger instead of the original statement. To fix that, let's patch txn_current_stmt() so as to return the first statement at the current transaction level instead of the last statement and use it in txn_commit_stmt(). This will also allow us to issue DML requests from a before_replace trigger without disrupting the current statement. Needed for #2993 Follow-up #3020
-
Vladimir Davydov authored
If space.on_replace callback fails (throws), we must rollback all statements inserted by the callback before failing and the statement that triggered the callback while currently we only rollback the last statement on txn->stmts list. To fix this, let's remember the position to rollback to in case of failure for each sub statement, similarly to how we do with savepoints. Note, there's a comment to txn_rollback_stmt() that says that it doesn't remove the last statement from the txn->stmts list, just clears it: /** * Void all effects of the statement, but * keep it in the list - to maintain * limit on the number of statements in a * transaction. */ void txn_rollback_stmt() It isn't going to hold after this patch, because this patch reuses the savepoint code to rollback statements on failure. Anyway, I haven't managed to figure out why we would ever need to keep statements on the list after rollback. The comment is clearly misleading as we don't have any limits on the number of statements, and even if we had, a statement counter would suffice. I guess the real reason why we don't delete statements from the list is that it is simply impossible to do in case of a singly linked list like stailq, but now it isn't going to be a problem. So remove the comment and the test case of engine/savepoint which relies on it. Needed for #2993 Closes #3020
-
Vladimir Davydov authored
This flag isn't necessary as we can set txn_savepoint->stmt to NULL when a savepoint is created inside an empty transaction. Using a separate flag for this purpose obscures the code flow and complicates further progress so let's remove it.
-
- Jan 05, 2018
-
-
AKhatskevich authored
This comit introduces a number of changes: 1. move a transaction state to fiber local struct This is important because the `sqlite3` is a shared structure and it was used to store data related to the transaction. However it was working because yield is called only on commit and it garanteed unique access. (With possible effects on ddl.) NOTE: `nDeferredCons` and `nDeferredImmCons` are stored in vdbe during vdbe execution and moved to sql_txn when it needs to be saved until execution of the next vdbe in the same transaction. 2. support savepoints 2.1. support abort (anonymous savepoints) Abort mechanism was simplified. Instead of storing track of all savepoints without name, this commit introduces `anonymous_savepoint`. `anonymous_savepoint` is a structure which is stored in Vdbe and represents the state of database on the beginning of the current statement. Tarantool disallow multistatement, so a vdbe can have one statement max. That is why having one savepoint is enough to perform abort. 2.2. named savepoints Key points: - It uses Tarantool's savepoints - It allocates savepoints on the "region" (they are destroyed automatically) - There are some crutches around ddl (ddl should not be placed into a transaction) Closes #2989 #2931 #2964
-
- Oct 19, 2017
-
-
Vladimir Davydov authored
Current internal tnx API is not particularly user-friendly in regards to error handling: if txn_begin_stmt(), txn_commit_stmt(), or txn_commit() fails, the txn state is undefined and the caller must rollback manually. To make the API easier to use, let's oblige these function rollback automatically in case of failure. Needed for #2776
-
- Oct 15, 2017
-
-
Vladimir Davydov authored
Needed for #2776
-
Vladimir Davydov authored
Preparation for converting txn to C. This will help removing exceptions from txn methods. Needed for #2776
-
Vladimir Davydov authored
Rename MemtxEngine, VinylEngine, and SysviewEngine to memtx_engine, vinyl_engine, and sysview_engine as well. Preparation for converting class Engine to plain struct. Needed for #2776
-
Vladimir Davydov authored
Needed for #2776
-
- Oct 06, 2017
-
-
Vladimir Davydov authored
space->handler->engine->... looks ugly. Since all Handler methods receive space as an argument anyway, let's move engine to struct space. This is a step towards converting class Handler to struct space_vtab. Needed for #2776
-
- Sep 08, 2017
-
-
Vladislav Shpilevoy authored
Closes #2746
-
- Sep 05, 2017
-
-
Konstantin Osipov authored
* update error messages * rename variables * add a few comments
-
Vladislav Shpilevoy authored
Savepoint allows to partialy rollback a transaction. After savepoint creation a transaction owner can rollback all changes applied after the savepoint without rolling back the entire transaction. Multiple savepoints can be created in each transaction. Rollback to a savepoint cancels changes made after the savepoint, and deletes all newer savepoints. It is impossible to rollback to a savepoint from a substatements level, different from the savepoint's one. For example, a transaction can not rollback to a savepoint, created outside of a trigger, from a trigger body. Closes #2025
-
Vladislav Shpilevoy authored
Vinyl can not calculate bsize during transaction execution because of DELETE and UPSERT in vinyl spaces with single index. Move space bsize into MemtxSpace, because Vinyl can not calculate it now. In a future, Vinyl bsize can be calculated after dumps and compactions, but never during transaction execution.
-
- Aug 31, 2017
-
-
khatskevich authored
Warnings for box/sql were enabled, set as errors. All issues were resolved. Removed useless box/sql/backup.c Removed extensions infrastructure. Closes #2338
-
- Jul 28, 2017
-
-
Vladislav Shpilevoy authored
-
- Jul 27, 2017
-
-
Georgy Kirichenko authored
Do not allow ddl if fired from on_replace trigger. Fixes #1968
-
- Jul 19, 2017
-
-
Vladimir Davydov authored
So that we could use it instead of index_opts::lsn. On initial recovery pass the snapshot LSN instead as we don't store LSNs in memtx snapshot. Needed for #2536
-
- Mar 29, 2017
-
-
Alexandr Lyapunov authored
Fixes #2257
-
- Dec 13, 2016
-
-
Vladislav Shpilevoy authored
See #1908
-
Vladislav Shpilevoy authored
-
- Dec 08, 2016
-
-
Konstantin Osipov authored
* one step closer to libxrow - a standalone library to parse Tarantool snapshot, xlog, data and index formats * one step towards killing request.h Clean up #include headers.
-
- Dec 02, 2016
-
-
Konstantin Osipov authored
Add test cases for transaction control statements invoked in a trigger. ABI change: box_txn_rollback() now may fail with error, if called from a nested stateent.
-
Roman Tsisyk authored
Touch txn a little bit to support multistatement transactions in autocommit mode. This patch allow to perform DML requests from space:on_replace() triggers. Trigerred requests are processed as a part of the original transaction and entire transaction is rolled back in case of error. Please note that there is still no support for nested transactions, therefore a call to box.begin() from on_replace() trigger is not allowed. Recursive invocation is not forbidden, but limited to the maximal depth of 4 to avoid stack overflow. Proudly fixes #587
-
- Aug 08, 2016
-
-
Vladislav Shpilevoy authored
Fixes #1659
-
- May 20, 2016
-
-
Konstantin Osipov authored
-
- Nov 24, 2015
-
-
Roman Tsisyk authored
Allow to use public API functions from C code without including auto-generated module.h
-
- Nov 09, 2015
-
-
Konstantin Osipov authored
Follow up fixes. Signature changes for txn_commit_stmt(), move the check for secondary keys to be engine-agnostic.
-