Add more traces to PS to understand the reasons of last commits in test_restart_subscriber

This commit is contained in:
Konstantin Knizhnik
2024-08-03 23:31:20 +03:00
parent 2f2aa9b79b
commit 8b445a7222
2 changed files with 13 additions and 0 deletions

View File

@@ -413,6 +413,10 @@ where
let mut content = Vec::with_capacity(n_origins * 16 + 8);
content.extend_from_slice(&pg_constants::REPLICATION_STATE_MAGIC.to_le_bytes());
for (origin_id, origin_lsn) in repl_origins {
info!(
"Include origin_id={}, origin_lsn={} in basebackup",
origin_id, origin_lsn
);
content.extend_from_slice(&origin_id.to_le_bytes());
content.extend_from_slice(&[0u8; 6]); // align to 8 bytes
content.extend_from_slice(&origin_lsn.0.to_le_bytes());

View File

@@ -408,11 +408,16 @@ impl WalIngest {
let info = decoded.xl_info & pg_constants::XLR_RMGR_INFO_MASK;
if info == pg_constants::XLOG_REPLORIGIN_SET {
let xlrec = crate::walrecord::XlReploriginSet::decode(&mut buf);
info!(
"Set replication origin_id={}, origin_lsn={}",
xlrec.node_id, xlrec.remote_lsn
);
modification
.set_replorigin(xlrec.node_id, xlrec.remote_lsn)
.await?
} else if info == pg_constants::XLOG_REPLORIGIN_DROP {
let xlrec = crate::walrecord::XlReploriginDrop::decode(&mut buf);
info!("Drop replication origin_id={}", xlrec.node_id);
modification.drop_replorigin(xlrec.node_id).await?
}
}
@@ -1286,6 +1291,10 @@ impl WalIngest {
}
}
if origin_id != 0 {
info!(
"Commit origin_id={}, origin_lsn={}",
origin_id, parsed.origin_lsn
);
modification
.set_replorigin(origin_id, parsed.origin_lsn)
.await?;