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

Postpone read view cleanup in matras data structure #7566

Open
alyapunov opened this issue Aug 12, 2022 · 0 comments
Open

Postpone read view cleanup in matras data structure #7566

alyapunov opened this issue Aug 12, 2022 · 0 comments
Assignees
Labels
3.0 Target is 3.0 and all newer release/master branches feature A new functionality memtx tmp

Comments

@alyapunov
Copy link
Contributor

alyapunov commented Aug 12, 2022

Now tarantool can provide a database read view for snapshot dump and replica join. It is implemented via several mechanisms, one of them is a a read view in matras data structure which is used in indexes.

Creation of a read view in matras is extremely cheap and O(1). But deletion of a read view is O(N) where N is close to the number of distinct changes in matras data. The good news are that is O(1) amortized and the coefficient before N is usually very small, like 0.03 or something like that.

Now tarantool read view is used only for snapshot dump (checkpoint) and for replica join, both happens very seldom (several times per day? hour?). But since we want to create user read views that could be created/deleted several times per second we have to have guarantee of O(1) matras deletion.

Since it is O(1) amortized it can be simply implemented with postponing some delete operations to further matras calls.

On a way it would be perfect to lower memory requirements for matras and its read view: now the first CoW operation clones 3 pages of 16kB each. Technically it's possible to reduce the number of pages if there are not so many tuples in a space.

@alyapunov alyapunov added feature A new functionality 3sp labels Aug 12, 2022
@alyapunov alyapunov self-assigned this Aug 12, 2022
@locker locker added the memtx label Aug 12, 2022
@locker locker added this to the 2.11.0 milestone Aug 17, 2022
@kyukhin kyukhin removed this from the 2.11.0 milestone Aug 25, 2022
@kyukhin kyukhin added 2.11 Target is 2.11 and all newer release/master branches and removed 3sp labels Sep 15, 2022
@NeraverinTarantool NeraverinTarantool removed the 2.11 Target is 2.11 and all newer release/master branches label Jan 16, 2023
@alyapunov alyapunov assigned drewdzzz and unassigned alyapunov Mar 9, 2023
@kyukhin kyukhin added the 3.0 Target is 3.0 and all newer release/master branches label May 17, 2023
@kyukhin kyukhin added the tmp label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Target is 3.0 and all newer release/master branches feature A new functionality memtx tmp
Projects
None yet
Development

No branches or pull requests

5 participants