Fix unit tests

This commit is contained in:
Konstantin Knizhnik
2022-03-31 16:44:01 +03:00
committed by Anastasia Lubennikova
parent 1f0b406b63
commit 92031d376a
2 changed files with 5 additions and 3 deletions

View File

@@ -1590,8 +1590,10 @@ impl LayeredTimeline {
let target_file_size = self.conf.checkpoint_distance;
// Define partitioning schema if needed
tenant_mgr::get_timeline_for_tenant_load(self.tenantid, self.timelineid)?
.repartition(self.get_last_record_lsn())?;
if let Ok(pgdir) = tenant_mgr::get_timeline_for_tenant_load(self.tenantid, self.timelineid)
{
pgdir.repartition(self.get_last_record_lsn())?;
}
// 1. The partitioning was already done by the code in
// pgdatadir_mapping.rs. We just use it here.

View File

@@ -286,7 +286,7 @@ fn bootstrap_timeline<R: Repository>(
let timeline = repo.create_empty_timeline(tli, lsn)?;
let mut page_tline: DatadirTimeline<R> = DatadirTimeline::new(timeline, u64::MAX);
import_datadir::import_timeline_from_postgres_datadir(&pgdata_path, &mut page_tline, lsn)?;
page_tline.tline.checkpoint(CheckpointConfig::Flush)?;
page_tline.tline.checkpoint(CheckpointConfig::Forced)?;
println!(
"created initial timeline {} timeline.lsn {}",