-
Notifications
You must be signed in to change notification settings - Fork 403
Closed
Labels
Description
Description
Currently, there is a fundamental logical inconsistency with read-view and conflicted states of transactions.
conflicted transactions see all prepared changes (e.g., #7238), because they are handled differently than read-view ones. At the same time, one does not know the state of the transaction until box.commit is called.
A similar problem arises with read-view transactions: if such transactions do any DML statements, they are de-facto conflicted, but this will be determined only on preparation stage
Lines 1006 to 1013 in 7924557
| /* | |
| * Somebody else has written some value that we have read. | |
| * The RW transaction is not possible. | |
| */ | |
| if (txn->status == TXN_IN_READ_VIEW && !stailq_empty(&txn->stmts)) { | |
| diag_set(ClientError, ER_TRANSACTION_CONFLICT); | |
| return -1; | |
| } |
— at the same time, if a read-view transaction does DML statements, they will nevertheless be tracked, which is impossible without violating our tuple story invariants (see #7239).
Proposal
- Conflict read-view transactions on attempt to perform DML statements immediately.
- Make conflicted transactions unconditionally throw
Aborted by conflicterror on any CRUD operations until they are either rolled back or committed.
Reactions are currently unavailable