Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft pull request integrates MVCC into the core.
The plan is to implement SQLite
BEGIN CONCURRENT
by introducing a "MV store" abstraction (that implements the Hekaton in-memory MVCC index) above the pager. Traditional SQLite transactions use the pager and the WAL, but MV store has its own transaction path that updates the in-memory multi-versioned index. If a key does not exist in the MVCC index, we read records from the pager. When a MVCC transaction commits, we emit WAL entries.Allowing
BEGIN CONCURRENT
and traditional transactions to run at the same time is a bit tricky. If we don't coordinate between them, we can have lost updates and read skew.Lost update happens when:
Read skew happens when:
There are few options to solve this problem:
ToDo:
BEGIN CONCURRENT
support