mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-08 22:12:56 +00:00
Fix indentation
This commit is contained in:
@@ -1486,15 +1486,17 @@ impl<'a> TimelineWriter for BufferedTimelineWriter<'a> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
///
|
||||
/// Complete all delayed commits and advance disk_consistent_lsn
|
||||
///
|
||||
fn checkpoint(&self) -> Result<()> {
|
||||
let store = self.tl.store.write().unwrap();
|
||||
store.data.checkpoint()?;
|
||||
self.tl.disk_consistent_lsn.store(self.tl.get_last_record_lsn());
|
||||
Ok(())
|
||||
}
|
||||
///
|
||||
/// Complete all delayed commits and advance disk_consistent_lsn
|
||||
///
|
||||
fn checkpoint(&self) -> Result<()> {
|
||||
let store = self.tl.store.write().unwrap();
|
||||
store.data.checkpoint()?;
|
||||
self.tl
|
||||
.disk_consistent_lsn
|
||||
.store(self.tl.get_last_record_lsn());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
///
|
||||
/// Remember the (end of) last valid WAL record remembered in the timeline.
|
||||
|
||||
@@ -180,10 +180,10 @@ pub trait TimelineWriter: Deref<Target = dyn Timeline> {
|
||||
/// Previous last record LSN is stored alongside the latest and can be read.
|
||||
fn advance_last_record_lsn(&self, lsn: Lsn);
|
||||
|
||||
///
|
||||
/// Complete all delayed commits and advance disk_consistent_lsn
|
||||
///
|
||||
fn checkpoint(&self) -> Result<()>;
|
||||
///
|
||||
/// Complete all delayed commits and advance disk_consistent_lsn
|
||||
///
|
||||
fn checkpoint(&self) -> Result<()>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
|
||||
@@ -139,7 +139,7 @@ pub fn import_timeline_from_postgres_datadir(
|
||||
lsn,
|
||||
&mut pg_control.checkPointCopy.clone(),
|
||||
)?;
|
||||
writer.checkpoint()?;
|
||||
writer.checkpoint()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ use lz4_flex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::ops::RangeBounds;
|
||||
use std::path::Path;
|
||||
use tracing::*;
|
||||
use yakv::storage::{Key, Storage, StorageIterator, Value};
|
||||
use zenith_utils::bin_ser::BeSer;
|
||||
use tracing::*;
|
||||
|
||||
const TOAST_SEGMENT_SIZE: usize = 2 * 1024;
|
||||
const CHECKPOINT_INTERVAL: u64 = 1u64 * 1024 * 1024 * 1024;
|
||||
@@ -165,13 +165,13 @@ impl ToastStore {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn checkpoint(&self) -> Result<()> {
|
||||
let mut main_tx = self.main.start_transaction();
|
||||
let mut toast_tx = self.toast.start_transaction();
|
||||
toast_tx.commit()?;
|
||||
main_tx.commit()?;
|
||||
Ok(())
|
||||
}
|
||||
pub fn checkpoint(&self) -> Result<()> {
|
||||
let mut main_tx = self.main.start_transaction();
|
||||
let mut toast_tx = self.toast.start_transaction();
|
||||
toast_tx.commit()?;
|
||||
main_tx.commit()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get(&self, key: &[u8]) -> Result<Option<Value>> {
|
||||
self.main
|
||||
@@ -268,9 +268,9 @@ impl ToastStore {
|
||||
}
|
||||
|
||||
impl Drop for ToastStore {
|
||||
fn drop(&mut self) {
|
||||
info!("Storage closed");
|
||||
// FIXME-KK: better call close() explicitly
|
||||
self.close().unwrap();
|
||||
}
|
||||
fn drop(&mut self) {
|
||||
info!("Storage closed");
|
||||
// FIXME-KK: better call close() explicitly
|
||||
self.close().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user