Make reconstruction more intensive

This commit is contained in:
Konstantin Knizhnik
2022-10-06 09:37:37 +03:00
parent 487ec20085
commit 885033ad42
3 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -284,7 +284,7 @@ impl PostgresNode {
conf.append("max_wal_senders", "10");
// wal_log_hints is mandatory when running against pageserver (see gh issue#192)
// TODO: is it possible to check wal_log_hints at pageserver side via XLOG_PARAMETER_CHANGE?
conf.append("wal_log_hints", "on");
conf.append("wal_log_hints", "off");
conf.append("max_replication_slots", "10");
conf.append("hot_standby", "on");
conf.append("shared_buffers", "1MB");
+13
View File
@@ -336,6 +336,19 @@ impl LayerMap {
pub fn insert_historic(&mut self, layer: Arc<dyn Layer>) {
if layer.get_key_range() == (Key::MIN..Key::MAX) {
self.latest_delta_layer = Some(layer.clone());
} else if !layer.is_incremental() {
// If latest delta layer is followed by image layers
// then reset it, preventing generation of partial image layer
if let Some(latest_delta) = &self.latest_delta_layer {
// May be it is more correct to use contains() rather than inrestects
// but one delta layer can be covered by several image layers.
let kr1 = layer.get_key_range();
let kr2 = latest_delta.get_key_range();
if kr2.end > kr1.start && kr2.start < kr1.end {
// if kr1.intersects(&kr2) {
self.latest_delta_layer = None;
}
}
}
self.historic_layers.insert(LayerRTreeObject { layer });
NUM_ONDISK_LAYERS.inc();
+6 -6
View File
@@ -589,7 +589,7 @@ impl Timeline {
last_received_wal: Mutex::new(None),
rel_size_cache: RwLock::new(HashMap::new()),
};
result.repartition_threshold = result.get_checkpoint_distance() / 10;
result.repartition_threshold = result.get_checkpoint_distance() * 3;
result
}
@@ -1392,11 +1392,6 @@ impl Timeline {
None,
);
}
// 3. Reconstruct
let timer = self.metrics.reconstruct_time_histo.start_timer();
self.reconstruct_level0(target_file_size)?;
timer.stop_and_record();
}
Err(err) => {
// no partitioning? This is normal, if the timeline was just created
@@ -1407,6 +1402,11 @@ impl Timeline {
}
};
// 3. Reconstruct
let timer = self.metrics.reconstruct_time_histo.start_timer();
self.reconstruct_level0(target_file_size)?;
timer.stop_and_record();
Ok(())
}