pageserver: remove unused on_key_error method

It's obvious the method is unused, but let's break down error handling
of the read path. Before this patch set, all IO was done sequentially
for a given read. If one IO failed, then the error would stop the
processing of the read path.

Now that we are doing IO concurrently when serving a read request
it's not trivial to implement the same error handling approach.
As of this commit, one IO failure does not stop any other IO requests.
When awaiting for the IOs to complete, we stop waiting on the first
failure, but we do not signal any other pending IOs to complete and
they will just fail silently.

Long term, we need a better approach for this. Two broad ideas:
1. Introduce some synchronization between pending IO tasks such
that new IOs are not issued after the first failure
2. Cancel any pending IOs when the first error is discovered
This commit is contained in:
Vlad Lazar
2024-10-10 18:15:27 +02:00
parent e3aa85d722
commit bde1694cb9
2 changed files with 0 additions and 14 deletions

View File

@@ -232,16 +232,6 @@ impl ValuesReconstructState {
self.io_concurrency.spawn_io(fut);
}
/// Associate a key with the error which it encountered and mark it as done
pub(crate) fn on_key_error(&mut self, key: Key, err: PageReconstructError) {
let previous = self.keys.insert(key, Err(err));
if let Some(Ok(state)) = previous {
if state.situation == ValueReconstructSituation::Continue {
self.keys_done.add_key(key);
}
}
}
pub(crate) fn on_layer_visited(&mut self, layer: &ReadableLayer) {
self.layers_visited += 1;
if let ReadableLayer::PersistentLayer(layer) = layer {

View File

@@ -622,9 +622,6 @@ impl ImageLayerInner {
}
}
// Why did on_key_error go away?
// There was a good reason for it ...
let read_from = self.file.clone();
let read_ctx = ctx.attached_child();
reconstruct_state.spawn_io(async move {
@@ -657,7 +654,6 @@ impl ImageLayerInner {
}
Err(err) => {
for (_, sender) in senders {
// TODO: when can this fail?
let _ = sender
.send(Err(std::io::Error::new(err.kind(), "vec read failed")));
}