Skip to content

Commit

Permalink
impr(pageserver): abort on fatal I/O writer error (#8777)
Browse files Browse the repository at this point in the history
part of #8140

The blob writer path now uses `maybe_fatal_err`

Signed-off-by: Alex Chi Z <[email protected]>
  • Loading branch information
skyzh authored Aug 20, 2024
1 parent beefc7a commit c8b9116
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pageserver/src/virtual_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,23 @@ impl VirtualFile {
})
}

/// The function aborts the process if the error is fatal.
async fn write_at<B: IoBuf + Send>(
&self,
buf: FullSlice<B>,
offset: u64,
_ctx: &RequestContext, /* TODO: use for metrics: https://github.com/neondatabase/neon/issues/6107 */
) -> (FullSlice<B>, Result<usize, Error>) {
let (slice, result) = self.write_at_inner(buf, offset, _ctx).await;
let result = result.maybe_fatal_err("write_at");
(slice, result)
}

async fn write_at_inner<B: IoBuf + Send>(
&self,
buf: FullSlice<B>,
offset: u64,
_ctx: &RequestContext, /* TODO: use for metrics: https://github.com/neondatabase/neon/issues/6107 */
) -> (FullSlice<B>, Result<usize, Error>) {
let file_guard = match self.lock_file().await {
Ok(file_guard) => file_guard,
Expand Down

1 comment on commit c8b9116

@github-actions
Copy link

Choose a reason for hiding this comment

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

2260 tests run: 2186 passed, 0 failed, 74 skipped (full report)


Code coverage* (full report)

  • functions: 32.4% (7244 of 22332 functions)
  • lines: 50.4% (58441 of 116006 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
c8b9116 at 2024-08-20T20:53:01.473Z :recycle:

Please sign in to comment.