Skip to content

Commit 7588983

Browse files
authored
fix(scrubber): log even if no refs are found (#11160)
## Problem Investigate #11159 ## Summary of changes This doesn't fix the issue, but at least we can narrow down the cause next time it happens by logging ancestor referenced layer cnt even if it's 0. Signed-off-by: Alex Chi Z <chi@neon.tech>
1 parent 359c64c commit 7588983

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pageserver/src/tenant/timeline/compaction.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ impl Timeline {
10911091
let latest_gc_cutoff = self.get_applied_gc_cutoff_lsn();
10921092

10931093
tracing::info!(
1094-
"latest_gc_cutoff: {}, pitr cutoff {}",
1094+
"starting shard ancestor compaction, latest_gc_cutoff: {}, pitr cutoff {}",
10951095
*latest_gc_cutoff,
10961096
self.gc_info.read().unwrap().cutoffs.time
10971097
);
@@ -1120,6 +1120,7 @@ impl Timeline {
11201120
// Expensive, exhaustive check of keys in this layer: this guards against ShardedRange's calculations being
11211121
// wrong. If ShardedRange claims the local page count is zero, then no keys in this layer
11221122
// should be !is_key_disposable()
1123+
// TODO: exclude sparse keyspace from this check, otherwise it will infinitely loop.
11231124
let range = layer_desc.get_key_range();
11241125
let mut key = range.start;
11251126
while key < range.end {

storage_scrubber/src/pageserver_physical_gc.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ impl TenantRefAccumulator {
152152
}
153153
}
154154

155-
if !ancestor_refs.is_empty() {
156-
tracing::info!(%ttid, "Found {} ancestor refs", ancestor_refs.len());
157-
self.ancestor_ref_shards.update(ttid, ancestor_refs);
158-
}
155+
tracing::info!(%ttid, "Found {} ancestor refs", ancestor_refs.len());
156+
self.ancestor_ref_shards.update(ttid, ancestor_refs);
159157
}
160158

161159
/// Consume Self and return a vector of ancestor tenant shards that should be GC'd, and map of referenced ancestor layers to preserve
@@ -779,7 +777,7 @@ pub async fn pageserver_physical_gc(
779777

780778
let mut summary = GcSummary::default();
781779
{
782-
let timelines = std::pin::pin!(timelines.try_buffered(CONCURRENCY));
780+
let timelines = timelines.try_buffered(CONCURRENCY);
783781
let timelines = timelines.try_flatten();
784782

785783
let timelines = timelines.map_ok(|(ttid, tenant_manifest_arc)| {
@@ -793,8 +791,8 @@ pub async fn pageserver_physical_gc(
793791
tenant_manifest_arc,
794792
)
795793
});
796-
let mut timelines = std::pin::pin!(timelines.try_buffered(CONCURRENCY));
797-
794+
let timelines = timelines.try_buffered(CONCURRENCY);
795+
let mut timelines = std::pin::pin!(timelines);
798796
// Drain futures for per-shard GC, populating accumulator as a side effect
799797
while let Some(i) = timelines.next().await {
800798
summary.merge(i?);

0 commit comments

Comments
 (0)