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

Explicit support for 2-phase commits #99

Open
tdz opened this issue Aug 21, 2017 · 1 comment
Open

Explicit support for 2-phase commits #99

tdz opened this issue Aug 21, 2017 · 1 comment

Comments

@tdz
Copy link
Member

tdz commented Aug 21, 2017

At FrOSCon 2017, someone asked about support for 2-phase commits. Currently this can be done by running the first phase in the module's apply() callbacks and the second phase in the finish() callback.

It might make sense to build explicit support for 2pc instead.

@tdz
Copy link
Member Author

tdz commented Aug 21, 2017

Here's an idea for an implementation:

  1. Events in the transaction log could contain a field noting their phase.
  2. Appending an event would allow setting the field.
  3. During apply, the transaction manager walks over the log once for each required phase.
  4. A set of database/network/etc modules could apply changes to structured data during the first phase; with a common record number handed out by a record-manager module
  5. The record-manager module commits the transaction's record number as part of the second phase; thus making the record active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant