From 1ab827336e47a9b25fe6360d9b927ebb8b0b3d74 Mon Sep 17 00:00:00 2001 From: Joseph Shearer Date: Fri, 25 Oct 2024 14:32:17 -0400 Subject: [PATCH] dekaf: Also update to disable read-back behavior when rewriting offsets --- crates/dekaf/src/read.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/dekaf/src/read.rs b/crates/dekaf/src/read.rs index 017437c9d9..600ed222ab 100644 --- a/crates/dekaf/src/read.rs +++ b/crates/dekaf/src/read.rs @@ -76,7 +76,11 @@ impl Read { let stream = client.clone().read_json_lines( broker::ReadRequest { // Start reading at least 1 document in the past - offset: std::cmp::max(0, offset - OFFSET_READBACK), + offset: if rewrite_offsets_from.is_some() { + offset + } else { + std::cmp::max(0, offset - OFFSET_READBACK) + }, block: true, journal: partition.spec.name.clone(), begin_mod_time: not_before_sec as i64,