Skip to content

Commit

Permalink
Only clear non-empty buffers during ingestion (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
gspowley authored Dec 21, 2023
1 parent 9530e07 commit 128d736
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libtiledbvcf/src/write/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,10 @@ std::pair<uint64_t, uint64_t> Writer::ingest_samples_v4(
// Flush stats arrays without finalizing the query.
worker->flush_ingestion_tasks();
} else {
LOG_DEBUG("No records found for {}", worker->region().seq_name);
LOG_DEBUG(
"Worker {}: no records found for {}",
i + 1,
worker->region().seq_name);
}
records_ingested += worker->records_buffered();

Expand Down Expand Up @@ -1096,7 +1099,9 @@ std::pair<uint64_t, uint64_t> Writer::ingest_samples_v4(
}
}

if (finished) {
// When an ingestion worker is finished, clear its query buffers
// only if the query buffers are not empty.
if (finished && worker->records_buffered() > 0) {
worker->buffers().clear_query_buffers(
query_.get(), dataset_->metadata().version);
}
Expand Down

0 comments on commit 128d736

Please sign in to comment.