Skip to content

Commit

Permalink
Stop recording deltas when already EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Aug 20, 2024
1 parent 2368c07 commit bcf39c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quickwit/quickwit-cli/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ async fn test_ingest_docs_cli() {
}

#[tokio::test]
async fn test_ingest_docs_cli_twice() {
async fn test_reingest_same_file_cli() {
quickwit_common::setup_logging_for_tests();
let index_id = append_random_suffix("test-index-simple");
let test_env = create_test_env(index_id.clone(), TestStorageType::LocalFileSystem)
Expand Down
5 changes: 4 additions & 1 deletion quickwit/quickwit-indexing/src/source/doc_file_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ impl ObjectUriBatchReader {
source_progress: &Progress,
source_type: SourceType,
) -> anyhow::Result<BatchBuilder> {
let mut batch_builder = BatchBuilder::new(source_type);
if self.is_eof {
return Ok(batch_builder);
}
let limit_num_bytes = self.current_offset + BATCH_NUM_BYTES_LIMIT as usize;
let mut new_offset = self.current_offset;
let mut batch_builder = BatchBuilder::new(source_type);
while new_offset < limit_num_bytes {
if let Some(record) = source_progress
.protect_future(self.reader.next_record())
Expand Down

0 comments on commit bcf39c0

Please sign in to comment.