Skip to content

vinyl: skip invisible read sources#10851

Merged
locker merged 1 commit intotarantool:masterfrom
locker:vy-skip-invisible-read-src
Nov 27, 2024
Merged

vinyl: skip invisible read sources#10851
locker merged 1 commit intotarantool:masterfrom
locker:vy-skip-invisible-read-src

Conversation

@locker
Copy link
Member

@locker locker commented Nov 22, 2024

A Vinyl read iterator scans all read sources (memory and disk levels) even if it's executed in a read view from which most of the sources are invisible. As a result, a long running scanning request may spend most of the time skipping invisible statements. The situation is exacerbated if the instance is experiencing a heavy write load because it would pile up old statement versions in memory and force the iterator to skip over them after each disk read.

Since the replica join procedure in Vinyl uses a read view iterator under the hood, the issue is responsible for a severe performance degradation of the master instance and the overall join procedure slowdown when a new replica is joined to an instance running under a heavy write load.

Let's fix this issue by making a read iterator skip read sources that aren't visible from its read view.

Closes #10846

@locker locker requested a review from a team as a code owner November 22, 2024 14:01
@coveralls
Copy link

coveralls commented Nov 22, 2024

Coverage Status

coverage: 87.335% (+0.02%) from 87.315%
when pulling 9c4bc38 on locker:vy-skip-invisible-read-src
into 017700d
on tarantool:master
.

@locker locker requested a review from nshy November 22, 2024 14:17
A Vinyl read iterator scans all read sources (memory and disk levels)
even if it's executed in a read view from which most of the sources are
invisible. As a result, a long running scanning request may spend most
of the time skipping invisible statements. The situation is exacerbated
if the instance is experiencing a heavy write load because it would pile
up old statement versions in memory and force the iterator to skip over
them after each disk read.

Since the replica join procedure in Vinyl uses a read view iterator
under the hood, the issue is responsible for a severe performance
degradation of the master instance and the overall join procedure
slowdown when a new replica is joined to an instance running under
a heavy write load.

Let's fix this issue by making a read iterator skip read sources that
aren't visible from its read view.

Closes tarantool#10846

NO_DOC=bug fix
@locker locker force-pushed the vy-skip-invisible-read-src branch from 487192c to 9c4bc38 Compare November 25, 2024 15:52
Copy link
Contributor

@nshy nshy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nshy nshy assigned locker and unassigned nshy Nov 27, 2024
@locker locker added the full-ci Enables all tests for a pull request label Nov 27, 2024
@locker locker merged commit 6a214e4 into tarantool:master Nov 27, 2024
@locker locker deleted the vy-skip-invisible-read-src branch November 27, 2024 13:24
@locker
Copy link
Member Author

locker commented Nov 27, 2024

Cherry-picked to 2.11 and 3.2.

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

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vinyl: replication slows down master

4 participants