Skip to content

Commit

Permalink
pageserver: don't squash all image layer generation errors into anyho…
Browse files Browse the repository at this point in the history
…w::Error (#7943)

## Problem

CreateImageLayersError and CompactionError had proper From
implementations, but compact_legacy was explicitly squashing all image
layer errors into an anyhow::Error anyway.

This led to errors like:
```
 Error processing HTTP request: InternalServerError(timeline shutting down

Stack backtrace:
   0: <<anyhow::Error as core::convert::From<pageserver::tenant::timeline::CreateImageLayersError>>::from as core::ops::function::FnOnce<(pageserver::tenant::timeline::CreateImageLayersError,)>>::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
   1: <core::result::Result<alloc::vec::Vec<pageserver::tenant::storage_layer::layer::ResidentLayer>, pageserver::tenant::timeline::CreateImageLayersError>>::map_err::<anyhow::Error, <anyhow::Error as core::convert::From<pageserver::tenant::timeline::CreateImageLayersError>>::from>
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/result.rs:829:27
   2: <pageserver::tenant::timeline::Timeline>::compact_legacy::{closure#0}
             at pageserver/src/tenant/timeline/compaction.rs:125:36
   3: <pageserver::tenant::timeline::Timeline>::compact::{closure#0}
             at pageserver/src/tenant/timeline.rs:1719:84
   4: pageserver::http::routes::timeline_checkpoint_handler::{closure#0}::{closure#0}
```

Closes: #7861
  • Loading branch information
jcsp authored Jun 3, 2024
1 parent 69026a9 commit 11bb265
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pageserver/src/tenant/timeline/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ impl Timeline {
},
&image_ctx,
)
.await
.map_err(anyhow::Error::from)?;
.await?;

self.upload_new_image_layers(image_layers)?;
partitioning.parts.len()
Expand Down

1 comment on commit 11bb265

@github-actions
Copy link

Choose a reason for hiding this comment

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

3262 tests run: 3110 passed, 0 failed, 152 skipped (full report)


Flaky tests (1)

Postgres 15

  • test_pageserver_restarts_under_worload: release

Code coverage* (full report)

  • functions: 31.4% (6554 of 20857 functions)
  • lines: 48.4% (50719 of 104882 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
11bb265 at 2024-06-03T21:30:11.566Z :recycle:

Please sign in to comment.