Fix style

This commit is contained in:
Konstantin Knizhnik
2022-10-31 19:59:34 +03:00
parent 7452f91d5a
commit 8769fef1a5
2 changed files with 5 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ const TEST_PAGE_CACHE_SIZE: usize = 50;
enum PageImageState {
Vacant, // entry is not used
Loaded(Bytes), // page is loaded
Loaded(Bytes), // page is loaded
Loading(Option<Arc<Condvar>>), // page in process of loading, Condvar is created on demand when some thread need to wait load completion
}
@@ -189,12 +189,7 @@ pub fn remove(key: Key, tenant_id: TenantId, timeline_id: TimelineId) {
}
// Find or load page image in the cache
pub fn lookup(
timeline: &Timeline,
rel: RelTag,
blkno: BlockNumber,
lsn: Lsn,
) -> Result<Bytes> {
pub fn lookup(timeline: &Timeline, rel: RelTag, blkno: BlockNumber, lsn: Lsn) -> Result<Bytes> {
let key = MaterializedPageHashKey {
key: rel_block_to_key(rel, blkno),
tenant_id: timeline.tenant_id,

View File

@@ -584,10 +584,10 @@ impl PageServerHandler {
let _profiling_guard = profpoint_start(self.conf, ProfilingConfig::PageRequests);
let page = if req.latest {
page_image_cache::lookup(timeline, req.rel, req.blkno, lsn)?
page_image_cache::lookup(timeline, req.rel, req.blkno, lsn)
} else {
Arc::new(timeline.get_rel_page_at_lsn(req.rel, req.blkno, lsn, false)?)
};
timeline.get_rel_page_at_lsn(req.rel, req.blkno, lsn, false)
}?;
Ok(PagestreamBeMessage::GetPage(PagestreamGetPageResponse {
page,
}))