Skip to content

Commit 609e8e6

Browse files
authored
[BUG]: Don't log offset since records can be empty (#5812)
## Description of changes _Summarize the changes made by this PR._ - Improvements & Bug fixes - There was a tracing in RLS where records[0] was printed unconditionally. However, records can be empty so records[0] goes out of bound causing a panic during pull logs. Fixed by not tracing it - New functionality - ... ## Test plan _How are these changes tested?_ - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Migration plan None ## Observability plan None ## Documentation Changes None
1 parent 3b6dcb4 commit 609e8e6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

rust/log-service/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,10 +1388,7 @@ impl LogServer {
13881388
if records.len() != pull_logs.batch_size as usize
13891389
|| (!records.is_empty() && records[0].log_offset != pull_logs.start_from_offset)
13901390
{
1391-
return Err(Status::not_found(format!(
1392-
"Some entries have been purged {} versus {}",
1393-
records[0].log_offset, pull_logs.start_from_offset
1394-
)));
1391+
return Err(Status::not_found("Some entries have been purged"));
13951392
}
13961393
Ok(Response::new(PullLogsResponse { records }))
13971394
}

0 commit comments

Comments
 (0)