Fix cherry-pick

This commit is contained in:
Bojan Serafimov
2022-07-11 15:40:25 -04:00
parent 5aefb89c52
commit de27c7dc66
3 changed files with 16 additions and 4 deletions

View File

@@ -90,7 +90,7 @@ impl<'a> Basebackup<'a> {
// Consolidate the derived and the provided prev_lsn values
let prev_lsn = if let Some(provided_prev_lsn) = prev_lsn {
if backup_prev != Lsn(0) {
ensure!(backup_prev == provided_prev_lsn)
anyhow::ensure!(backup_prev == provided_prev_lsn)
}
provided_prev_lsn
} else {

View File

@@ -538,7 +538,7 @@ impl PageServerHandler {
{
let mut writer = CopyDataSink { pgb };
let basebackup =
let mut basebackup =
basebackup::Basebackup::new(&mut writer, &timeline, lsn, prev_lsn, full_backup)?;
span.record("lsn", &basebackup.lsn.to_string().as_str());
basebackup.send_tarball()?;
@@ -656,10 +656,10 @@ impl postgres_backend::Handler for PageServerHandler {
let timelineid = ZTimelineId::from_str(params[1])?;
self.check_permission(Some(tenantid))?;
let timeline = tenant_mgr::get_local_timeline_with_load(tenantid, timelineid)
let timeline = tenant_mgr::get_timeline_for_tenant_load(tenantid, timelineid)
.context("Cannot load local timeline")?;
let end_of_timeline = timeline.tline.get_last_record_rlsn();
let end_of_timeline = timeline.get_last_record_rlsn();
pgb.write_message_noflush(&BeMessage::RowDescription(&[
RowDescriptor::text_col(b"prev_lsn"),

View File

@@ -480,6 +480,18 @@ impl RowDescriptor<'_> {
formatcode: 0,
}
}
pub const fn text_col(name: &[u8]) -> RowDescriptor {
RowDescriptor {
name,
tableoid: 0,
attnum: 0,
typoid: TEXT_OID,
typlen: -1,
typmod: 0,
formatcode: 0,
}
}
}
#[derive(Debug)]