initial logical size calculation can also reasonable use the sidecar because it's concurrency-limited

This commit is contained in:
Christian Schwarz
2025-01-21 12:50:33 +01:00
parent bca4263eb8
commit 4014c390e2
2 changed files with 15 additions and 3 deletions
+2 -2
View File
@@ -927,9 +927,9 @@ impl Timeline {
&self,
lsn: Lsn,
ctx: &RequestContext,
io_concurrency: IoConcurrency,
) -> Result<(), PageReconstructError> {
self.list_aux_files_v2(lsn, ctx, IoConcurrency::sequential())
.await?;
self.list_aux_files_v2(lsn, ctx, io_concurrency).await?;
Ok(())
}
+13 -1
View File
@@ -2885,6 +2885,14 @@ impl Timeline {
crate::metrics::initial_logical_size::START_CALCULATION.retry(circumstances)
};
let io_concurrency = IoConcurrency::spawn_from_conf(
self_ref.conf,
self_ref
.gate
.enter()
.map_err(|_| CalculateLogicalSizeError::Cancelled)?,
);
let calculated_size = self_ref
.logical_size_calculation_task(
initial_part_end,
@@ -2894,7 +2902,11 @@ impl Timeline {
.await?;
self_ref
.trigger_aux_file_size_computation(initial_part_end, background_ctx)
.trigger_aux_file_size_computation(
initial_part_end,
background_ctx,
io_concurrency,
)
.await?;
// TODO: add aux file size to logical size