Skip to content

Commit

Permalink
remote_storage/abs: count 404 and 304 for get as ok for metrics (#9912)
Browse files Browse the repository at this point in the history
## Problem

We currently see elevated levels of errors for GetBlob requests. This is
because 404 and 304 are counted as errors for metric reporting.

## Summary of Changes

Bring the implementation in line with the S3 client and treat 404 and
304 responses as ok for metric purposes.

Related: neondatabase/cloud#20666
  • Loading branch information
VladLazar authored Nov 28, 2024
1 parent 8173dc6 commit e82f7f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/remote_storage/src/azure_blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ impl AzureBlobStorage {
let started_at = ScopeGuard::into_inner(started_at);
let outcome = match &download {
Ok(_) => AttemptOutcome::Ok,
// At this level in the stack 404 and 304 responses do not indicate an error.
// There's expected cases when a blob may not exist or hasn't been modified since
// the last get (e.g. probing for timeline indices and heatmap downloads).
// Callers should handle errors if they are unexpected.
Err(DownloadError::NotFound | DownloadError::Unmodified) => AttemptOutcome::Ok,
Err(_) => AttemptOutcome::Err,
};
crate::metrics::BUCKET_METRICS
Expand Down

1 comment on commit e82f7f0

@github-actions
Copy link

Choose a reason for hiding this comment

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

7053 tests run: 6719 passed, 1 failed, 333 skipped (full report)


Failures on Postgres 16

  • test_sharded_ingest[github-actions-selfhosted-vanilla-1]: release-x86-64
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_sharded_ingest[release-pg16-github-actions-selfhosted-vanilla-1]"
Flaky tests (3)

Postgres 17

Code coverage* (full report)

  • functions: 30.6% (7984 of 26064 functions)
  • lines: 48.5% (63372 of 130562 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
e82f7f0 at 2024-11-28T12:06:26.155Z :recycle:

Please sign in to comment.