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

[Feature]: A new design of resolving data conflicts without relying on AMS to generate TransactionId #994

Closed
2 tasks done
wangtaohz opened this issue Jan 11, 2023 · 0 comments · Fixed by #1010
Closed
2 tasks done
Labels
type:feature Feature Requests
Milestone

Comments

@wangtaohz
Copy link
Contributor

wangtaohz commented Jan 11, 2023

Description

To resolve the data conflict of Arctic KeyedTable(Mixed-format table) with concurrent batch write and stream write, we introduce a design of version for each record, in order to keep the data with a higher version when row conflicts arise.

Use case/motivation

In the case of a concurrent batch write and stream write, row conflicts are likely to arise, especially when batch write takes a long time, and the batch write will fail to commit.

We have introduced TransactionId and offset to determine the record version, but the generation of TransactionId relies on the AMS, which leads to reliability issues for data writing.

Describe the solution

The design of the record version:
Version = (TransactionId, offset)

  • TransactionId: the sequence of each Transaction
  • offset: the offset of record in a Transaction, to determine the record version in a transaction

Two ways to generate TransactionId:

  • generate on transaction begin: commit an empty snapshot to ChangeTable, and get the snapshot sequence as TransactionId
  • generate on transaction commit: get the change snapshot sequence when commit as TransactionId

Subtasks

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Feature Requests
Projects
None yet
1 participant