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

Collect conflicts for MVCC in on_yiled trigger #6209

Open
alyapunov opened this issue Jul 12, 2021 · 0 comments
Open

Collect conflicts for MVCC in on_yiled trigger #6209

alyapunov opened this issue Jul 12, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@alyapunov
Copy link
Contributor

As a part of #5172.
Now MVCC transaction manager (if enabled) collects some data for its conflict manager in order to determine which and when transactions must be aborted due to conflict. But there's a widely used case when there are no fiber yields until transaction commits (I mean box.commit call).
My proposition is to delay such data collection to the moment when transaction yields or commits. If it yields - do exactly the same work as now, but if it commits earlier - do a shorter and faster check. Of course it will still require some sort of data collection, but could be a much simpler lists allocated on TX's region allocator.
There are two kind of data that is collected by conflict manager:

  1. Reads, that can lead to abortion of current transaction if another concurrent transaction finally (by commit) overwrites the same data. Obviously that kind of data is senseless if the current transaction commits before yield - there can be no other concurrent transactions' activity.
  2. Writes, for further (in commit) abortion of other transactions that have read these values. In case when the current transaction commits before yield nothing should be collected and other transactions must be immediately aborted.

There should be a performance test that compares performance of tarantool without MVCC, with MVCC and with MVCC and this new feature.

@alyapunov alyapunov added feature A new functionality incoming labels Jul 12, 2021
@kyukhin kyukhin removed the incoming label Jul 29, 2021
@kyukhin kyukhin added this to the 2.10.1 milestone Aug 19, 2021
Egor2001 pushed a commit that referenced this issue Sep 16, 2021
In a few places in txm code trackers were allocated directly bypassing
the corresponding API functions `memtx_tx_track_...()` for the sake of
local optimization.
However, such design lead to difficulties in optimization of tracker
creation routines and this patch makes the trackers creation consistent.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 16, 2021
Read trackers must be stored in the story of a corresponding tuple
but are used only if the reader is interrupted by another txn.
So, if the reading txn doesn't yield, there is no need in read tracker.
This patch postpones tracker creations which may possibly need extra
bookkeping to the on_yield trigger.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 16, 2021
Read trackers must be stored in the story of a corresponding tuple
but are used only if the reader is interrupted by another txn.
So, if the reading txn doesn't yield, there is no need in read tracker.
This patch postpones tracker creations which may possibly need extra
bookkeping to the on_yield trigger.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 17, 2021
In a few places in txm code trackers were allocated directly bypassing
the corresponding API functions `memtx_tx_track_...()` for the sake of
local optimization.
However, such design lead to difficulties in optimization of tracker
creation routines and this patch makes the trackers creation consistent.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 17, 2021
Read trackers must be stored in the story of a corresponding tuple
but are used only if the reader is interrupted by another txn.
So, if the reading txn doesn't yield, there is no need in read tracker.
This patch postpones tracker creations which may possibly need extra
bookkeping to the on_yield trigger.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 20, 2021
Read and gap trackers must be stored in the story of a corresponding
tuple but are used only if the reader is interrupted by another txn.
So, if the reading txn doesn't yield, there is no need in read tracker.
This patch postpones tracker creations which may possibly need extra
bookkeeping to the on_yield trigger.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 27, 2021
This patch adds ffi-based performance test for mvcc used to compare
effectiveness of further optimizations.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 27, 2021
In a few places in txm code trackers were allocated directly bypassing
the corresponding API functions `memtx_tx_track_...()` for the sake of
local optimization.
However, such design lead to difficulties in optimization of tracker
creation routines and this patch makes the trackers creation consistent.

Needed for #6209
Egor2001 pushed a commit that referenced this issue Sep 27, 2021
Read and gap trackers must be stored in the story of a corresponding
tuple but are used only if the reader is interrupted by another txn.
So, if the reading txn doesn't yield, there is no need in read tracker.
This patch postpones tracker creations which may possibly need extra
bookkeeping to the on_yield trigger.

Needed for #6209
@kyukhin kyukhin modified the milestones: 2.10.0-rc1, 2.10.1 Dec 30, 2021
@alyapunov alyapunov assigned alyapunov and unassigned Egor2001 Jan 12, 2022
@kyukhin kyukhin modified the milestones: 2.10.0, wishlist May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants