Skip to content

Commit

Permalink
dekaf: Always return at least 2 docs for data preview UI requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jshearer committed Oct 18, 2024
1 parent 5714bb3 commit 7d6764a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/dekaf/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ impl Session {
Some(partition_request.fetch_offset - 1),
)
.next_batch(
crate::read::ReadTarget::Docs(diff as usize + 1),
// Have to read at least 2 docs, as the very last doc
// will probably be a control document and will be
// ignored by the consumer, looking like 0 docs were read
crate::read::ReadTarget::Docs(max(diff as usize, 2)),
std::time::Instant::now() + timeout,
),
)
Expand Down

0 comments on commit 7d6764a

Please sign in to comment.