Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only clear non-empty buffers during ingestion #641

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading