bytedance / terarkdb

A RocksDB compatible KV storage engine with better performance
Apache License 2.0
2.05k stars 202 forks source link

Enhancement mark trigger #193

Closed yapple closed 2 years ago

yapple commented 2 years ago

When we found an invalid blob file number in the SST, it was not immediately allowed to be marked, and we added an adjustable option to limit the mark trigger.

 auto should_mark = [&](FileMetaData* f) {
      uint64_t cnt = 0;
      for (auto depend : f->prop.dependence) {
        if (depend.file_number !=
            TransFileNumber(depend.file_number)->file_number)
          cnt++;
      }
      return cnt >= invalid_blob_cnt;
    };