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

Mnesia consistency #7215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Vincent-lau
Copy link

Mnesia's default partition tolerance model is to leave it to the programmer during a network partition. Moreover Mnesia only provides two access contexts, dirty and transactions, and lacks intermediate apis that provide consistency. For example, dirty operations might leave the replicas in different states depending on the order of the messages being delivered.

This patch implements a new access context (a)sync_ec which provides eventual consistency when used in conjunction with a new table type pawset. For this patch, the (a)async_ec API can handle concurrent addition/deletion in the presence of network delays (while dirty operations might give different results on different replicas). Internally it implements a pure operation-based add-wins set.

This is an attempt to fix #7202, although this is likely to require a lot more effort, and this patch is only the first step.

Add causal delivery of messages support with the `mnesia_causal`
`gen_server` and vector clock to track causality.
Tests are also included for causal delivery.
Add a new API `(a)sync_ec` for eventually consistent operations in
addition to the original transactiosn and dirty operations. Implemented
as a `mnesia_access` behaviour with `write/3`, `read/3` public
functions, etc.

The underlying data structure for eventual consistency is a pure
operation-based add-wins set.

Relevant tests included for eventual consistency API and the pure
add-wins set.
@CLAassistant
Copy link

CLAassistant commented May 8, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

CT Test Results

Tests are running... https://github.com/erlang/otp/actions/runs/4915248509

Results for commit 8d8d887

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

  • No CT logs found
  • No HTML docs found
  • No Windows Installer found

// Erlang/OTP Github Action Bot

@Vincent-lau
Copy link
Author

Wondering if anyone can review this PR?

@lin72h
Copy link

lin72h commented May 12, 2023

Wondering if anyone can review this PR?

I think the OTP team are busy with releasing OTP 26, and your PR is a good addition to the Mnesia, but also a bit complex, for that reason the team trying to avoid to bring into the stdlib.

@Vincent-lau
Copy link
Author

Vincent-lau commented May 12, 2023

I think the OTP team are busy with releasing OTP 26, and your PR is a good addition to the Mnesia, but also a bit complex, for that reason the team trying to avoid to bring into the stdlib.

Okay, do you recommend keeping waiting until OTP 26 has been released, or maybe do something else?

@lin72h
Copy link

lin72h commented May 12, 2023

I think the OTP team are busy with releasing OTP 26, and your PR is a good addition to the Mnesia, but also a bit complex, for that reason the team trying to avoid to bring into the stdlib.

Okay, do you recommend keeping waiting until OTP 26 has been released, or maybe do something else?

As a normal user, I can't suggest more. BTW I admire your work on datalog related stuff, so I think this PR should be a good one.

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label May 15, 2023
@IngelaAndin IngelaAndin added the stalled waiting for input by the Erlang/OTP team label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stalled waiting for input by the Erlang/OTP team team:PS Assigned to OTP team PS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eventual consistency in Mnesia
6 participants