tikv / titan

A RocksDB plugin for key-value separation, inspired by WiscKey.
https://pingcap.com/blog/titan-storage-engine-design-and-implementation/
Apache License 2.0
489 stars 165 forks source link

File Size Not Really Used in GC #303

Closed TMPaStra closed 10 months ago

TMPaStra commented 10 months ago

In function "BlobGCJob::DoRunGC" of file "src/blob_gc_job.cc", I noticed that a variable file_size has been declared, but not truly used. It has only four appearances in the function.

  1. uint64_t file_size = 0;
  2. if ((!blob_file_handle && !blob_file_builder) || file_size >= blob_gc_->titan_cf_options().blob_file_target_size)
  3. if (file_size >= blob_gc_->titan_cf_options().blob_file_target_size)
  4. file_size = 0;

And yet this variable decides whether or not a new blob is sent to blob_builder, is this a mistake or am i missing something?

TMPaStra commented 10 months ago

Sorry, i just noticed that this error has already been spotted before.