assert(status.ok() && need_flush == false);
#endif
- bool consumed_seqno = false;
bool force_global_seqno = false;
if (ingestion_options_.snapshot_consistency && !db_snapshots_->empty()) {
TEST_SYNC_POINT_CALLBACK("ExternalSstFileIngestionJob::Run",
&assigned_seqno);
if (assigned_seqno == last_seqno + 1) {
- consumed_seqno = true;
+ consumed_seqno_ = true;
}
if (!status.ok()) {
return status;
f.largest_internal_key(), f.assigned_seqno, f.assigned_seqno,
false);
}
-
- if (consumed_seqno) {
- versions_->SetLastAllocatedSequence(last_seqno + 1);
- versions_->SetLastPublishedSequence(last_seqno + 1);
- versions_->SetLastSequence(last_seqno + 1);
- }
-
return status;
}
for (IngestedFileInfo& f : files_to_ingest_) {
InternalStats::CompactionStats stats(CompactionReason::kExternalSstIngestion, 1);
stats.micros = total_time;
- // If actual copy occured for this file, then we need to count the file
+ // If actual copy occurred for this file, then we need to count the file
// size as the actual bytes written. If the file was linked, then we ignore
// the bytes written for file metadata.
// TODO (yanqin) maybe account for file metadata bytes for exact accuracy?
stats.bytes_moved = f.fd.GetFileSize();
}
stats.num_output_files = 1;
- cfd_->internal_stats()->AddCompactionStats(f.picked_level, stats);
+ cfd_->internal_stats()->AddCompactionStats(f.picked_level,
+ Env::Priority::USER, stats);
cfd_->internal_stats()->AddCFStats(InternalStats::BYTES_INGESTED_ADD_FILE,
f.fd.GetFileSize());
total_keys += f.num_entries;
f.internal_file_path.c_str(), s.ToString().c_str());
}
}
+ consumed_seqno_ = false;
} else if (status.ok() && ingestion_options_.move_files) {
// The files were moved and added successfully, remove original file links
for (IngestedFileInfo& f : files_to_ingest_) {
return status;
}
+ if (ingestion_options_.verify_checksums_before_ingest) {
+ status = table_reader->VerifyChecksum();
+ }
+ if (!status.ok()) {
+ return status;
+ }
+
// Get the external file properties
auto props = table_reader->GetTableProperties();
const auto& uprops = props->user_collected_properties;