pagebench: finish trigger initial logical size calculation benchmark

This commit is contained in:
Christian Schwarz
2023-12-18 16:19:48 +00:00
parent cdc09bab0b
commit af33e8fa6c

View File

@@ -66,20 +66,25 @@ async fn main_impl(args: Args) -> anyhow::Result<()> {
for tl in timelines {
let mgmt_api_client = Arc::clone(&mgmt_api_client);
js.spawn(async move {
// TODO: API to explicitly trigger initial logical size computation
let mut _info = mgmt_api_client
// TODO: API to explicitly trigger initial logical size computation.
// Should probably also avoid making it a side effect of timeline details to trigger initial logical size calculation.
// => https://github.com/neondatabase/neon/issues/6168
let info = mgmt_api_client
.timeline_info(tl.tenant_id, tl.timeline_id)
.await
.unwrap();
if let Some(_period) = args.poll_for_completion {
todo!("unimplemented: need to rebase for this");
// let mut ticker = tokio::time::interval(period);
// ticker.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay)
// while info.current_logical_size_is_accurate {
// ticker.tick().await;
// mgmt_api_client.timeline_info(tenant_id, timeline_id)
// }
if let Some(period) = args.poll_for_completion {
let mut ticker = tokio::time::interval(period.into());
ticker.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay);
let mut info = info;
while !info.current_logical_size_is_accurate {
ticker.tick().await;
info = mgmt_api_client
.timeline_info(tl.tenant_id, tl.timeline_id)
.await
.unwrap();
}
}
});
}