From dd4ff8ef9ee1c4530ad64de9718e8608d9524bd2 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Mon, 4 Dec 2023 14:19:45 -0500 Subject: [PATCH] wip --- pageserver/src/walingest.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pageserver/src/walingest.rs b/pageserver/src/walingest.rs index 666f0501e2..fa099d91ea 100644 --- a/pageserver/src/walingest.rs +++ b/pageserver/src/walingest.rs @@ -2159,9 +2159,13 @@ mod tests { let prof_guard = crate::profiling::profpoint_start(); let started_at = std::time::Instant::now(); - // Decode and ingest wal. We process the wal in chunks because - // that's what happens when we get bytes from safekeepers. - for chunk in bytes[xlogoff..].chunks(50) { + // Decode and ingest wal. + // + // NOTE We process the wal in chunks because that's what happens + // when we get bytes from safekeepers. We use size 1906 because + // that was the average chunk size during the test that generated + // this data. + for chunk in bytes[xlogoff..].chunks(1906) { decoder.feed_bytes(chunk); while let Some((lsn, recdata)) = decoder.poll_decode().unwrap() { walingest @@ -2169,6 +2173,11 @@ mod tests { .await .unwrap(); } + + // Do operations we do on every XLogData message + // TODO check if 50 is the right chunk size + // TODO there's more operations to include here + tline.check_checkpoint_distance().await.unwrap(); } drop(prof_guard);