mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-13 16:32:56 +00:00
Minor formatting and comment fixes.
This commit is contained in:
@@ -179,7 +179,9 @@ impl<'a> Basebackup<'a> {
|
||||
// Extract twophase state files
|
||||
//
|
||||
fn add_twophase_file(&mut self, xid: TransactionId) -> anyhow::Result<()> {
|
||||
if let Ok(img) = self.timeline.get_page_at_lsn_nowait(RelishTag::TwoPhase { xid }, 0, self.lsn)
|
||||
if let Ok(img) =
|
||||
self.timeline
|
||||
.get_page_at_lsn_nowait(RelishTag::TwoPhase { xid }, 0, self.lsn)
|
||||
{
|
||||
let mut buf = BytesMut::new();
|
||||
buf.extend_from_slice(&img[..]);
|
||||
|
||||
@@ -299,15 +299,13 @@ impl Timeline for ObjectTimeline {
|
||||
// move this check out of the funciton.
|
||||
//
|
||||
match rel {
|
||||
RelishTag::Slru { .. } |
|
||||
RelishTag::TwoPhase{ .. } =>
|
||||
{
|
||||
RelishTag::Slru { .. } | RelishTag::TwoPhase { .. } => {
|
||||
if !self.get_rel_exists(rel, req_lsn).unwrap_or(false) {
|
||||
trace!("{:?} at {} doesn't exist", rel, req_lsn);
|
||||
return Err(anyhow!("non-rel relish doesn't exist"));
|
||||
}
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
|
||||
const ZERO_PAGE: [u8; 8192] = [0u8; 8192];
|
||||
|
||||
@@ -197,12 +197,10 @@ fn mx_offset_to_member_offset(xid: MultiXactId) -> usize {
|
||||
}
|
||||
|
||||
impl PostgresRedoManager {
|
||||
|
||||
///
|
||||
/// Create a new PostgresRedoManager.
|
||||
///
|
||||
pub fn new(conf: &'static PageServerConf, tenantid: ZTenantId) -> PostgresRedoManager {
|
||||
|
||||
// We block on waiting for requests on the walredo request channel, but
|
||||
// use async I/O to communicate with the child process. Initialize the
|
||||
// runtime for the async part.
|
||||
@@ -244,6 +242,8 @@ impl PostgresRedoManager {
|
||||
let buf_tag = BufferTag { rel, blknum };
|
||||
apply_result = process.apply_wal_records(buf_tag, base_img, records).await;
|
||||
} else {
|
||||
// Non-relational WAL records are handled here, with custom code that has the
|
||||
// same effects as the corresponding Postgres WAL redo function.
|
||||
const ZERO_PAGE: [u8; 8192] = [0u8; 8192];
|
||||
let mut page = BytesMut::new();
|
||||
if let Some(fpi) = base_img {
|
||||
@@ -378,7 +378,7 @@ impl PostgresRedoManager {
|
||||
panic!();
|
||||
}
|
||||
} else if xlogrec.xl_rmid == pg_constants::RM_RELMAP_ID {
|
||||
// Ralation map file has size 512 bytes
|
||||
// Relation map file has size 512 bytes
|
||||
page.clear();
|
||||
page.extend_from_slice(&buf[12..]); // skip xl_relmap_update
|
||||
assert!(page.len() == 512); // size of pg_filenode.map
|
||||
|
||||
Reference in New Issue
Block a user