cargo fmt

This commit is contained in:
Eric Seppanen
2021-05-07 13:11:44 -07:00
parent df5a55c445
commit d26b76fe7c
5 changed files with 13 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
pub mod rocksdb;
use crate::waldecoder::{Oid, DecodedWALRecord};
use crate::waldecoder::{DecodedWALRecord, Oid};
use crate::ZTimelineId;
use anyhow::Result;
use bytes::{Buf, BufMut, Bytes, BytesMut};
@@ -31,7 +31,6 @@ pub trait Repository {
}
pub trait Timeline {
//------------------------------------------------------------------------------
// Public GET functions
//------------------------------------------------------------------------------
@@ -85,7 +84,7 @@ pub trait Timeline {
&self,
decoded: DecodedWALRecord,
recdata: Bytes,
lsn: Lsn
lsn: Lsn,
) -> anyhow::Result<()>;
/// Remember the all WAL before the given LSN has been processed.

View File

@@ -7,13 +7,14 @@
use crate::repository::{BufferTag, RelTag, Repository, Timeline, WALRecord};
use crate::restore_local_repo::restore_timeline;
use crate::waldecoder::{Oid, DecodedWALRecord, XlSmgrTruncate, XlCreateDatabase};
use crate::waldecoder::{DecodedWALRecord, Oid, XlCreateDatabase, XlSmgrTruncate};
use crate::walredo::WalRedoManager;
use crate::ZTimelineId;
use crate::{zenith_repo_dir, PageServerConf};
use anyhow::{bail, Context, Result};
use bytes::{Buf, BufMut, Bytes, BytesMut};
use log::*;
use postgres_ffi::pg_constants;
use std::cmp::min;
use std::collections::HashMap;
use std::convert::TryInto;
@@ -24,8 +25,6 @@ use std::thread;
use std::time::{Duration, Instant};
use zenith_utils::lsn::{AtomicLsn, Lsn};
use zenith_utils::seqwait::SeqWait;
use postgres_ffi::pg_constants;
// Timeout when waiting or WAL receiver to catch up to an LSN given in a GetPage@LSN call.
static TIMEOUT: Duration = Duration::from_secs(60);
@@ -702,10 +701,7 @@ impl Timeline for RocksTimeline {
for blknum in nblocks..old_rel_size {
key_buf.clear();
let key = CacheKey {
tag: BufferTag {
rel,
blknum,
},
tag: BufferTag { rel, blknum },
lsn,
};
key.pack(&mut key_buf);
@@ -802,8 +798,8 @@ impl Timeline for RocksTimeline {
&self,
decoded: DecodedWALRecord,
recdata: Bytes,
lsn: Lsn) -> anyhow::Result<()>
{
lsn: Lsn,
) -> anyhow::Result<()> {
for blk in decoded.blocks.iter() {
let tag = BufferTag {
rel: RelTag {

View File

@@ -282,7 +282,7 @@ impl tui::widgets::Widget for MetricsWidget {
lines.push(get_metric_str("Valid LSN range", &lsnrange));
lines.push(get_metric_str("Last record LSN", &last_valid_recordlsn_str));
*/
/*
/*
lines.push(get_metric_u64(
"# of cache entries",
page_cache_stats.num_entries,
@@ -299,7 +299,7 @@ impl tui::widgets::Widget for MetricsWidget {
"# of GetPage@LSN calls",
page_cache_stats.num_getpage_requests,
));
*/
*/
let text = Text::from(lines);
Paragraph::new(text).render(inner_area, buf);

View File

@@ -309,7 +309,6 @@ pub struct DecodedWALRecord {
pub type Oid = u32;
pub type BlockNumber = u32;
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct RelFileNode {

View File

@@ -178,7 +178,10 @@ impl WalRedoManagerInternal {
// Loop forever, handling requests as they come.
loop {
let request = self.request_rx.recv().expect("WAL redo request channel was closed");
let request = self
.request_rx
.recv()
.expect("WAL redo request channel was closed");
let result = runtime.block_on(self.handle_apply_request(&process, &request));
let result_ok = result.is_ok();