Skip to content

Commit

Permalink
storage_scrubber: fix faulty assertion when no timelines (#9345)
Browse files Browse the repository at this point in the history
When there are no timelines in remote storage, the storage scrubber
would incorrectly trip an assertion with "Must be set if results are
present", referring to the last processed tenant ID. When there are no
timelines we don't expect there to be a tenant ID either.

The assertion was introduced in 37aa6fd.

Only apply the assertion when any timelines are present.
  • Loading branch information
erikgrinaker authored Oct 10, 2024
1 parent c2623ff commit 9dd80b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions storage_scrubber/src/scan_pageserver_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,8 @@ pub async fn scan_pageserver_metadata(
tenant_timeline_results.push((ttid, data));
}

let tenant_id = tenant_id.expect("Must be set if results are present");

if !tenant_timeline_results.is_empty() {
let tenant_id = tenant_id.expect("Must be set if results are present");
analyze_tenant(
&remote_client,
tenant_id,
Expand Down

1 comment on commit 9dd80b9

@github-actions
Copy link

Choose a reason for hiding this comment

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

5182 tests run: 4965 passed, 0 failed, 217 skipped (full report)


Code coverage* (full report)

  • functions: 31.4% (7548 of 24012 functions)
  • lines: 49.3% (60360 of 122534 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
9dd80b9 at 2024-10-10T15:09:45.843Z :recycle:

Please sign in to comment.