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

DataPage smart write through #367

Closed
wants to merge 4 commits into from
Closed

DataPage smart write through #367

wants to merge 4 commits into from

Conversation

Scooletz
Copy link
Contributor

This PR introduces a change in the way of handling overflown DataPages.

In current situation, when a page is full and there's no place to put the new key in it, it will be flushed down. The flushing down is a powerful mechanism but requires to iterate over the SlottedArray, move items down and delete them in the original page. If the DataPage is near the top, this situation may happen quite frequently.

This PR introduces an additional check using batch.WasWritten that allows to check if a child page was written during this batch. If a key does not fit to a page (SlottedArray.TrySet failed), is non-empty (can have a nibble truncated), a child page exist and WasWritten during this batch, it's a perfect opportunity to pass through this page and move down.

The expectation is that by limiting the amount of time spent in flushing down, we could greatly decrease the time of applying a block. This would help with a lot of cases where there's a bulk of updates for a given account but we don't want to flush a few layers of DataPages constantly. The disadvantage is that this limits LRU behavior a bit (values pushed down in the tree).

To be implemented and tested.

@Scooletz Scooletz added 🐌 performance Perofrmance related issue 💥Breaking The change introduces a storage breaking change. labels Jun 28, 2024
Copy link

Code Coverage

Package Line Rate Branch Rate Health
Paprika 85% 80%
Summary 85% (4208 / 4938) 80% (1357 / 1692)

Minimum allowed line rate is 75%

@Scooletz Scooletz mentioned this pull request Jul 16, 2024
@Scooletz
Copy link
Contributor Author

Scooletz commented Sep 5, 2024

Introduced and handled in #375

@Scooletz Scooletz closed this Sep 5, 2024
@Scooletz Scooletz deleted the smart-write-through branch September 5, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥Breaking The change introduces a storage breaking change. 🐌 performance Perofrmance related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant