Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New transaction isolation level - linearizable #3167

Closed
2 tasks
Tracked by #3543 ...
TarantoolBot opened this issue Sep 28, 2022 · 0 comments · Fixed by #3553
Closed
2 tasks
Tracked by #3543 ...

New transaction isolation level - linearizable #3167

TarantoolBot opened this issue Sep 28, 2022 · 0 comments · Fixed by #3553
Assignees
Labels
2.11 2.11 release and the associated technical debt concepts feature A new functionality mvcc transactions [area] Related to Transactions

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Sep 28, 2022

Product: Tarantool
Since: 2.11
Audience/target: dev
Root documents:
https://www.tarantool.io/en/doc/latest/concepts/atomic/transaction_model/
https://www.tarantool.io/en/doc/latest/concepts/atomic/txn_mode_mvcc/
https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_txn_management/begin/
SME: @ sergepetrenko

Details

There is a new transaction isolation level - linearizable.
You may call box.begin with txn_isolation = 'linearizable', but you
can't set the default transaction isolation level to 'linearizable'.

Linearizable transactions may only perform requests to synchronous,
local or temporary memtx spaces (vinyl engine support will be added
later).

Starting a linearizable transaction requires
box.cfg.memtx_use_mvcc_engine to be on.

Note: starting a linearizable transaction requires that the node is the
replication source for at least N - Q + 1 remote replicas. Here N is
the count of registered nodes in the cluster and Q is
replication_synchro_quorum value (the same as
box.info.synchro.quorum). This is the implementation limitation. For
example, you may start linearizable transactions on any node of a
cluster in full-mesh topology, but you can't perform linearizable
transactions on anonymous replicas, because noone replicates from
them.

When a transcaction is linearizable it sees the latest changes performed
on the quorum of nodes in the cluster. For example, if you use
linearizable transactions to read data on a replica, such a transaction
will never read stale data: all the committed writes performed on the
master will be seen by the transaction.

Making a transaction linearizable requires some waiting until the node
receives all the committed data. In case the node can't contact enough
remote peers to determine which data is committed an error is returned.

Waiting for committed data may time out: if the data isn't received
during the timeout specified by timeout option of box.begin(), an
error is returned.

When called with {txn_isolation = 'linearizable'}, box.begin()
yields until the instance receives enough data from remote peers to be
sure that the transaction is linearizable.
Requested by @ sergepetrenko in tarantool/tarantool@70bf99c.

Definition of done

  • MVCC doc page explains how the linearizable isolation level works
  • box.begin reference contains the new possible level value.

See also

https://www.tarantool.io/en/doc/latest/release/2.11.0/#linearizable-read

@veod32 veod32 added this to the Estimate [@p7nov] milestone Sep 29, 2022
@p7nov p7nov added transactions [area] Related to Transactions 5sp 2.11 2.11 release and the associated technical debt concepts labels Oct 6, 2022
@p7nov p7nov removed this from the Estimate [@p7nov] milestone Oct 6, 2022
@veod32 veod32 removed the 5sp label Dec 9, 2022
@p7nov p7nov added mvcc feature A new functionality labels Mar 20, 2023
@veod32 veod32 unassigned p7nov Apr 3, 2023
@andreyaksenov andreyaksenov self-assigned this Jun 27, 2023
@andreyaksenov andreyaksenov linked a pull request Jun 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11 2.11 release and the associated technical debt concepts feature A new functionality mvcc transactions [area] Related to Transactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants