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

pageserver: issue concurrent IO on the read path #9353

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e3aa85d
pagserver: do concurrent IO on the read path
VladLazar Oct 10, 2024
bde1694
pageserver: remove unused on_key_error method
VladLazar Oct 10, 2024
0ad736e
pageserver: clean up comms between pending IOs and awaiter
VladLazar Oct 10, 2024
0a840fb
pageserver: purge read path caching support
VladLazar Oct 10, 2024
11990ef
pageserver: use correct will_init for streaming planner
VladLazar Oct 10, 2024
6da0b5f
pagserver: further simplify read path error handling
VladLazar Oct 10, 2024
cc57b34
pageserver: reinstate inspect_image_layers
VladLazar Oct 10, 2024
1cbbc35
pageserver: fixup some tests using low level read apis
VladLazar Oct 10, 2024
eafae92
pageserver: make io serial by default
VladLazar Oct 10, 2024
6599034
chore: clippy warn
VladLazar Oct 10, 2024
c446e3d
chore: fixup comment
VladLazar Oct 10, 2024
9f95864
review: remove matches! usage
VladLazar Nov 4, 2024
34a43b0
review: improve doc comment for planner
VladLazar Nov 4, 2024
2508c64
review: comment on end state of io concurrency
VladLazar Nov 4, 2024
657526a
review: make import scope tighter
VladLazar Nov 4, 2024
dba6968
review: do some testing of parallel IO
VladLazar Nov 4, 2024
c72e87f
Merge branch 'main' into vlad/read-path-concurrent-io
VladLazar Nov 11, 2024
4dc7434
Merge remote-tracking branch 'origin/main' into vlad/read-path-concur…
problame Dec 10, 2024
410283c
serial mode without tasks
problame Dec 12, 2024
0e8ac43
hacky parametrization of relevant benchmarks
problame Dec 12, 2024
659da35
DO NOT MERGE trim down benchmark to what's relevant
problame Dec 12, 2024
3779370
results on my hetzner box
problame Dec 12, 2024
7f55a32
parametrization over direct io mode (only direct io for now)
problame Dec 12, 2024
e051e91
results on my hetzner box
problame Dec 12, 2024
71b6aa2
implement futuresunordered mode
problame Dec 12, 2024
80aebce
benc results on my box
problame Dec 12, 2024
309edeb
repurpose test_pageserver_characterize_latencies_with_1_client_and_th…
problame Dec 12, 2024
02d0d89
run bench on hetzner box
problame Dec 12, 2024
8b477ce
super hacky way to get layer visit buckets
problame Dec 12, 2024
1f7f947
results
problame Dec 12, 2024
87755bf
concurrent-futures: poll before pushing into FuturesUnordered (this w…
problame Dec 12, 2024
31fec1f
add the script that I used to generate the delta stack
problame Dec 12, 2024
d962b44
fix the script (it stopped making changes beyond 6); this now creates…
problame Dec 13, 2024
0fd67b2
debug cruft, likely will revert but this proved useful, esp log_if_slow
problame Dec 17, 2024
e209fd8
diagnosis: with the debug cruft from previous commit, we see "thread_…
problame Dec 17, 2024
8e6c01d
WIP fix: one task per connections to drive all the IO futures
problame Dec 17, 2024
dc1d53f
name delta stack height variable
problame Dec 17, 2024
29fecda
avoid killing walredo
problame Dec 17, 2024
97a01bd
pagebench: option for queue depth
problame Dec 17, 2024
3396574
cargo fmt
problame Dec 21, 2024
dc58846
with the new approach we don't even need the no-slots patch of tokio-…
problame Dec 21, 2024
d776ee6
avoid Arc<Gate> by having clonable GateGuard
problame Dec 21, 2024
d844ed0
fix some minor warnings
problame Dec 21, 2024
4637389
remov the "parallel" mode, as we won't ever enable this in practice a…
problame Dec 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 48 additions & 37 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5134,7 +5134,7 @@ mod tests {
use pageserver_api::value::Value;
use pageserver_compaction::helpers::overlaps_with;
use rand::{thread_rng, Rng};
use storage_layer::PersistentLayerKey;
use storage_layer::{PersistentLayerKey, SelectedIoConcurrency};
use tests::storage_layer::ValuesReconstructState;
use tests::timeline::{GetVectoredError, ShutdownMode};
use timeline::DeltaLayerTestDesc;
Expand Down Expand Up @@ -5970,48 +5970,59 @@ mod tests {
// Pick a big LSN such that we query over all the changes.
let reads_lsn = Lsn(u64::MAX - 1);

for read in reads {
info!("Doing vectored read on {:?}", read);
let io_concurrency_levels = vec![
SelectedIoConcurrency::Serial,
SelectedIoConcurrency::Parallel,
];

let vectored_res = tline
.get_vectored_impl(
read.clone(),
reads_lsn,
&mut ValuesReconstructState::new(),
&ctx,
)
.await;
for io_concurrency_level in io_concurrency_levels {
for read in reads.clone() {
info!(
"Doing vectored read on {:?} with IO concurrency {:?}",
read, io_concurrency_level
);

let mut expected_lsns: HashMap<Key, Lsn> = Default::default();
let mut expect_missing = false;
let mut key = read.start().unwrap();
while key != read.end().unwrap() {
if let Some(lsns) = inserted.get(&key) {
let expected_lsn = lsns.iter().rfind(|lsn| **lsn <= reads_lsn);
match expected_lsn {
Some(lsn) => {
expected_lsns.insert(key, *lsn);
}
None => {
expect_missing = true;
break;
let vectored_res = tline
.get_vectored_impl(
read.clone(),
reads_lsn,
&mut ValuesReconstructState::new_with_io_concurrency(io_concurrency_level),
&ctx,
)
.await;

let mut expected_lsns: HashMap<Key, Lsn> = Default::default();
let mut expect_missing = false;
let mut key = read.start().unwrap();
while key != read.end().unwrap() {
if let Some(lsns) = inserted.get(&key) {
let expected_lsn = lsns.iter().rfind(|lsn| **lsn <= reads_lsn);
match expected_lsn {
Some(lsn) => {
expected_lsns.insert(key, *lsn);
}
None => {
expect_missing = true;
break;
}
}
} else {
expect_missing = true;
break;
}
} else {
expect_missing = true;
break;
}

key = key.next();
}
key = key.next();
}

if expect_missing {
assert!(matches!(vectored_res, Err(GetVectoredError::MissingKey(_))));
} else {
for (key, image) in vectored_res? {
let expected_lsn = expected_lsns.get(&key).expect("determined above");
let expected_image = test_img(&format!("{} at {}", key.field6, expected_lsn));
assert_eq!(image?, expected_image);
if expect_missing {
assert!(matches!(vectored_res, Err(GetVectoredError::MissingKey(_))));
} else {
for (key, image) in vectored_res? {
let expected_lsn = expected_lsns.get(&key).expect("determined above");
let expected_image =
test_img(&format!("{} at {}", key.field6, expected_lsn));
assert_eq!(image?, expected_image);
}
}
}
}
Expand Down
Loading
Loading