hangc0276 opened a new pull request #2824:
URL: https://github.com/apache/bookkeeper/pull/2824


   ### Motivation
   Fix #2823
   RocksDB support several format versions which uses different data structure 
to implement key-values indexes and have huge different performance. 
https://rocksdb.org/blog/2019/03/08/format-version-4.html
   
   
https://github.com/facebook/rocksdb/blob/d52b520d5168de6be5f1494b2035b61ff0958c11/include/rocksdb/table.h#L368-L394
 
   
   ```C++
     // We currently have five versions:
     // 0 -- This version is currently written out by all RocksDB's versions by
     // default.  Can be read by really old RocksDB's. Doesn't support changing
     // checksum (default is CRC32).
     // 1 -- Can be read by RocksDB's versions since 3.0. Supports non-default
     // checksum, like xxHash. It is written by RocksDB when
     // BlockBasedTableOptions::checksum is something other than kCRC32c. 
(version
     // 0 is silently upconverted)
     // 2 -- Can be read by RocksDB's versions since 3.10. Changes the way we
     // encode compressed blocks with LZ4, BZip2 and Zlib compression. If you
     // don't plan to run RocksDB before version 3.10, you should probably use
     // this.
     // 3 -- Can be read by RocksDB's versions since 5.15. Changes the way we
     // encode the keys in index blocks. If you don't plan to run RocksDB before
     // version 5.15, you should probably use this.
     // This option only affects newly written tables. When reading existing
     // tables, the information about version is read from the footer.
     // 4 -- Can be read by RocksDB's versions since 5.16. Changes the way we
     // encode the values in index blocks. If you don't plan to run RocksDB 
before
     // version 5.16 and you are using index_block_restart_interval > 1, you 
should
     // probably use this as it would reduce the index size.
     // This option only affects newly written tables. When reading existing
     // tables, the information about version is read from the footer.
     // 5 -- Can be read by RocksDB's versions since 6.6.0. Full and partitioned
     // filters use a generally faster and more accurate Bloom filter
     // implementation, with a different schema.
     uint32_t format_version = 5;
   ```
   Different format version requires different rocksDB version and it couldn't 
roll back once upgrade to new format version
   
   In our current RocksDB storage code, we hard code the format_version to 2, 
which is hard to to upgrade format_version to achieve new RocksDB's high 
performance.
   
   ### Changes
   
   1. Make the format_version configurable.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to