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

Refactor pagecache <-> Wal redo communication #60

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

hlinnaka
Copy link
Contributor

After the rocksdb patch (commit 6aa38d3), the CacheEntry struct was
used only momentarily in the communication between the page_cache and
the walredo modules. It was in fact not stored in any cache anymore.
For clarity, refactor the communication.

There is now a WalRedoManager struct, with request_redo function,
that can be used to request WAL replay of a particular page. It sends
a request to a queue like before, but the queue has been replaced with
tokio::sync::mpsc. Previously, the resulting page image was stored
directly in the CacheEntry, and the requestor was notified using a
condition variable. Now, the requestor includes a 'oneshot' channel in
the request, and the WAL redo manager sends the response there.

@hlinnaka hlinnaka force-pushed the refactor-pagecache-walredo-communication branch from de05ba5 to 7591f67 Compare April 22, 2021 21:02
@hlinnaka hlinnaka force-pushed the refactor-pagecache-walredo-communication branch 2 times, most recently from 941bbf8 to ba7ba58 Compare April 23, 2021 15:44
@hlinnaka hlinnaka force-pushed the refactor-pagecache-walredo-communication branch from ba7ba58 to 3b4d69c Compare April 23, 2021 16:47
Copy link
Contributor

@kelvich kelvich left a comment

Choose a reason for hiding this comment

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

Looks way cleaner, thanks

After the rocksdb patch (commit 6aa38d3), the CacheEntry struct was
used only momentarily in the communication between the page_cache and
the walredo modules. It was in fact not stored in any cache anymore.
For clarity, refactor the communication.

There is now a WalRedoManager struct, with `request_redo` function,
that can be used to request WAL replay of a particular page. It sends
a request to a queue like before, but the queue has been replaced with
tokio::sync::mpsc. Previously, the resulting page image was stored
directly in the CacheEntry, and the requestor was notified using a
condition variable. Now, the requestor includes a 'oneshot' channel in
the request, and the WAL redo manager sends the response there.
@hlinnaka hlinnaka force-pushed the refactor-pagecache-walredo-communication branch from 3b4d69c to 93d7d2a Compare April 24, 2021 09:24
@hlinnaka hlinnaka merged commit 93d7d2a into main Apr 24, 2021
@hlinnaka hlinnaka deleted the refactor-pagecache-walredo-communication branch April 24, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants