diff --git a/src/yb/docdb/compaction_file_filter.cc b/src/yb/docdb/compaction_file_filter.cc index 79793047c508..f3b06242548b 100644 --- a/src/yb/docdb/compaction_file_filter.cc +++ b/src/yb/docdb/compaction_file_filter.cc @@ -12,7 +12,6 @@ // #include "yb/docdb/compaction_file_filter.h" -#include #include "yb/docdb/consensus_frontier.h" #include "yb/docdb/doc_ttl_util.h" @@ -85,7 +84,7 @@ FilterDecision DocDBCompactionFileFilter::Filter(const FileMetaData* file) { << " file: " << file->ToString(); return FilterDecision::kKeep; } - LOG(INFO) << "Filtering file, TTL expired: " + VLOG(2) << "Filtering file, TTL expired: " << " filter: " << ToString() << " file: " << file->ToString(); return FilterDecision::kDiscard; diff --git a/src/yb/rocksdb/db/compaction_job.cc b/src/yb/rocksdb/db/compaction_job.cc index fc6fbd2e677c..d99e94a803f2 100644 --- a/src/yb/rocksdb/db/compaction_job.cc +++ b/src/yb/rocksdb/db/compaction_job.cc @@ -853,10 +853,11 @@ Status CompactionJob::FinishCompactionOutputFile( info.job_id = job_id_; RLOG(InfoLogLevel::INFO_LEVEL, db_options_.info_log, "[%s] [JOB %d] Generated table #%" PRIu64 ": %" PRIu64 - " keys, %" PRIu64 " bytes%s", + " keys, %" PRIu64 " bytes%s %s", cfd->GetName().c_str(), job_id_, output_number, current_entries, current_total_bytes, - meta->marked_for_compaction ? " (need compaction)" : ""); + meta->marked_for_compaction ? " (need compaction)" : "", + meta->FrontiersToString().c_str()); EventHelpers::LogAndNotifyTableFileCreation( event_logger_, cfd->ioptions()->listeners, meta->fd, info); } diff --git a/src/yb/rocksdb/db/flush_job.cc b/src/yb/rocksdb/db/flush_job.cc index 646eb4477c78..0442aec9f23c 100644 --- a/src/yb/rocksdb/db/flush_job.cc +++ b/src/yb/rocksdb/db/flush_job.cc @@ -47,6 +47,7 @@ #include "yb/rocksdb/db/version_set.h" #include "yb/rocksdb/port/likely.h" #include "yb/rocksdb/port/port.h" +#include "yb/rocksdb/compaction_filter.h" #include "yb/rocksdb/db.h" #include "yb/rocksdb/env.h" #include "yb/rocksdb/statistics.h" @@ -296,11 +297,11 @@ Result FlushJob::WriteLevel0Table( } RLOG(InfoLogLevel::INFO_LEVEL, db_options_.info_log, "[%s] [JOB %d] Level-0 flush table #%" PRIu64 ": %" PRIu64 - " bytes %s" - "%s", + " bytes %s%s %s", cfd_->GetName().c_str(), job_context_->job_id, meta->fd.GetNumber(), meta->fd.GetTotalFileSize(), s.ToString().c_str(), - meta->marked_for_compaction ? " (needs compaction)" : ""); + meta->marked_for_compaction ? " (needs compaction)" : "", + meta->FrontiersToString().c_str()); // output to event logger if (s.ok()) { diff --git a/src/yb/rocksdb/db/version_edit.cc b/src/yb/rocksdb/db/version_edit.cc index fb192c2fd76a..96bdf2c12770 100644 --- a/src/yb/rocksdb/db/version_edit.cc +++ b/src/yb/rocksdb/db/version_edit.cc @@ -110,6 +110,12 @@ Slice FileMetaData::UserFilter() const { return largest.user_frontier ? largest.user_frontier->Filter() : Slice(); } +std::string FileMetaData::FrontiersToString() const { + return yb::Format("frontiers: { smallest: $0 largest: $1 }", + smallest.user_frontier ? smallest.user_frontier->ToString() : "none", + largest.user_frontier ? largest.user_frontier->ToString() : "none"); +} + std::string FileMetaData::ToString() const { return yb::Format("{ number: $0 total_size: $1 base_size: $2 refs: $3 " "being_compacted: $4 smallest: $5 largest: $6 }", diff --git a/src/yb/rocksdb/db/version_edit.h b/src/yb/rocksdb/db/version_edit.h index 6dc4f68c0832..c0abe040816f 100644 --- a/src/yb/rocksdb/db/version_edit.h +++ b/src/yb/rocksdb/db/version_edit.h @@ -136,6 +136,9 @@ struct FileMetaData { Slice UserFilter() const; // Extracts user filter from largest boundary value if present. + // Outputs smallest and largest user frontiers to string, if they exist. + std::string FrontiersToString() const; + std::string ToString() const; }; diff --git a/src/yb/rocksdb/db/version_set.cc b/src/yb/rocksdb/db/version_set.cc index c8bfda35ad78..99b7ae791700 100644 --- a/src/yb/rocksdb/db/version_set.cc +++ b/src/yb/rocksdb/db/version_set.cc @@ -3572,6 +3572,11 @@ InternalIterator* VersionSet::MakeInputIterator(Compaction* c) { for (size_t i = 0; i < flevel->num_files; i++) { FileMetaData* fmd = c->input(which, i); if (c->input(which, i)->delete_after_compaction) { + RLOG( + InfoLogLevel::INFO_LEVEL, db_options_->info_log, + yb::Format( + "[$0] File marked for deletion, will be removed after compaction. file: $1", + c->column_family_data()->GetName(), fmd->ToString()).c_str()); RecordTick(cfd->ioptions()->statistics, COMPACTION_FILES_FILTERED); continue; }