From cb3fd0327d16bd1769c02ad8bc26f235470a9b97 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 14f0a67891..21042ce174 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,