Skip to content

Commit

Permalink
fix: ResidentLayer::load_keys should not create INFO level span (#7174)
Browse files Browse the repository at this point in the history
Since #6115 with more often used get_value_reconstruct_data and friends,
we should not have needless INFO level span creation near hot paths. In
our prod configuration, INFO spans are always created, but in practice,
very rarely anything at INFO level is logged underneath.
`ResidentLayer::load_keys` is only used during compaction so it is not
that hot, but this aligns the access paths and their span usage.

PR changes the span level to debug to align with others, and adds the
layer name to the error which was missing.

Split off from #7030.
  • Loading branch information
koivunej committed Mar 20, 2024
1 parent 6d99642 commit fb66a3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pageserver/src/tenant/storage_layer/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ impl ResidentLayer {
}

/// Loads all keys stored in the layer. Returns key, lsn and value size.
#[tracing::instrument(skip_all, fields(layer=%self))]
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all, fields(layer=%self))]
pub(crate) async fn load_keys<'a>(
&'a self,
ctx: &RequestContext,
Expand All @@ -1504,9 +1504,9 @@ impl ResidentLayer {
// while it's being held.
delta_layer::DeltaLayerInner::load_keys(d, ctx)
.await
.context("Layer index is corrupted")
.with_context(|| format!("Layer index is corrupted for {self}"))
}
Image(_) => anyhow::bail!("cannot load_keys on a image layer"),
Image(_) => anyhow::bail!(format!("cannot load_keys on a image layer {self}")),
}
}

Expand Down

1 comment on commit fb66a3d

@github-actions
Copy link

Choose a reason for hiding this comment

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

2786 tests run: 2642 passed, 2 failed, 142 skipped (full report)


Failures on Postgres 14

  • test_pgbench_intensive_init_workload[neon_on-github-actions-selfhosted-1000]: release
  • test_bulk_insert[neon-github-actions-selfhosted]: release
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_pgbench_intensive_init_workload[neon_on-release-pg14-github-actions-selfhosted-1000] or test_bulk_insert[neon-release-pg14-github-actions-selfhosted]"

Code coverage* (full report)

  • functions: 28.3% (7131 of 25198 functions)
  • lines: 46.9% (43708 of 93290 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
fb66a3d at 2024-03-20T15:14:06.942Z :recycle:

Please sign in to comment.