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

use IoBufferMut for delta/image layers + pagecache #9169

Conversation

yliang412
Copy link
Contributor

Problem

Summary of changes

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link

github-actions bot commented Sep 26, 2024

5013 tests run: 4854 passed, 1 failed, 158 skipped (full report)


Failures on Postgres 17

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_pageserver_compaction_smoke[release-pg17]"
Flaky tests (8)

Postgres 16

Postgres 15

Postgres 14

Test coverage report is not available

The comment gets automatically updated with the latest test results
e565c4f at 2024-10-07T17:59:38.988Z :recycle:

@yliang412 yliang412 changed the title use IoBufferMut for delta and image layers use IoBufferMut for delta/image layers + pagecache Sep 27, 2024
@yliang412 yliang412 force-pushed the yuchen/direct-io-aligned-alloc-usage-wip branch from 5839b46 to fa21578 Compare September 29, 2024 20:55
@yliang412 yliang412 force-pushed the yuchen/direct-io-aligned-alloc-usage-wip branch from 382fa0f to e98a4eb Compare September 29, 2024 21:00
@yliang412 yliang412 self-assigned this Sep 30, 2024
@yliang412 yliang412 force-pushed the yuchen/direct-io-aligned-alloc-usage-wip branch from da57cc4 to f48ab8b Compare October 1, 2024 03:58
@yliang412 yliang412 force-pushed the yuchen/direct-io-aligned-alloc branch 3 times, most recently from 8bde188 to 3ee9877 Compare October 7, 2024 20:00
yliang412 added a commit that referenced this pull request Oct 9, 2024
## Problem
We need a way to incrementally switch to direct IO. During the rollout
we might want to switch to O_DIRECT on image and delta layer read path
first before others.

## Summary of changes
- Revisited and simplified direct io config in `PageserverConf`. 
- We could add a fallback mode for open, but for read there isn't a
reasonable alternative (without creating another buffered virtual file).
- Added a wrapper around `VirtualFile`, current implementation become
`VirtualFileInner`
- Use `open_v2`, `create_v2`, `open_with_options_v2` when we want to use
the IO mode specified in PS config.
- Once we onboard all IO through VirtualFile using this new API, we will
delete the old code path.
- Make io mode live configurable for benchmarking.
- Only guaranteed for files opened after the config change, so do it
before the experiment.

As an example, we are using `open_v2` with
`virtual_file::IoMode::Direct` in
#9169

We also remove `io_buffer_alignment` config in
a04cfd7 and use it as a compile time
constant. This way we don't have to carry the alignment around or make
frequent call to retrieve this information from the static variable.

Signed-off-by: Yuchen Liang <[email protected]>
@yliang412
Copy link
Contributor Author

#9326

@yliang412 yliang412 closed this Dec 11, 2024
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.

1 participant