Skip to content

Commit

Permalink
safekeeper: downgrade interpreted reader errors (#11034)
Browse files Browse the repository at this point in the history
## Problem

This `critical!` could fire on IO errors, which is just noisy.

Resolves #11027.

## Summary of changes

Downgrade to error, except for decode errors. These could be either data
corruption or a bug, but seem worth investigating either way.
  • Loading branch information
erikgrinaker authored Feb 28, 2025
1 parent 7c53fd0 commit c7ff3c4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions safekeeper/src/send_interpreted_wal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,13 @@ impl InterpretedWalReader {
reader
.run_impl(start_pos)
.await
.inspect_err(|err| critical!("failed to read WAL record: {err:?}"))
.inspect_err(|err| match err {
// TODO: we may want to differentiate these errors further.
InterpretedWalReaderError::Decode(_) => {
critical!("failed to decode WAL record: {err:?}");
}
err => error!("failed to read WAL record: {err}"),
})
}
.instrument(info_span!("interpreted wal reader")),
);
Expand Down Expand Up @@ -347,10 +353,12 @@ impl InterpretedWalReader {
metric.dec();
}

if let Err(err) = self.run_impl(start_pos).await {
critical!("failed to read WAL record: {err:?}");
} else {
info!("interpreted wal reader exiting");
match self.run_impl(start_pos).await {
Err(err @ InterpretedWalReaderError::Decode(_)) => {
critical!("failed to decode WAL record: {err:?}");
}
Err(err) => error!("failed to read WAL record: {err}"),
Ok(()) => info!("interpreted wal reader exiting"),
}

Err(CopyStreamHandlerEnd::Other(anyhow!(
Expand Down

1 comment on commit c7ff3c4

@github-actions
Copy link

Choose a reason for hiding this comment

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

7896 tests run: 7506 passed, 1 failed, 389 skipped (full report)


Failures on Postgres 16

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_sharding_autosplit[release-pg16-github-actions-selfhosted]"
Flaky tests (2)

Postgres 17

Postgres 15

Code coverage* (full report)

  • functions: 32.8% (8646 of 26363 functions)
  • lines: 48.6% (73223 of 150566 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
c7ff3c4 at 2025-02-28T16:36:33.246Z :recycle:

Please sign in to comment.