fix: add context for ancestor lsn wait (#5143)

In logs it is confusing to see seqwait timeouts which seemingly arise
from the branched lsn but actually are about the ancestor, leading to
questions like "has the last_record_lsn went back".

Noticed by @problame.
This commit is contained in:
Joonas Koivunen
2023-08-30 12:21:41 +03:00
committed by GitHub
parent 382473d9a5
commit 05773708d3

View File

@@ -2265,7 +2265,15 @@ impl Timeline {
)));
}
}
ancestor.wait_lsn(timeline.ancestor_lsn, ctx).await?;
ancestor
.wait_lsn(timeline.ancestor_lsn, ctx)
.await
.with_context(|| {
format!(
"wait for lsn {} on ancestor timeline_id={}",
timeline.ancestor_lsn, ancestor.timeline_id
)
})?;
timeline_owned = ancestor;
timeline = &*timeline_owned;