[DocDB] Fix statistic RocksDB_read_block_get_micros to include all reads
#11,744 建立於 2022年3月14日
倉庫指標
- Star
- (8,229 star)
- PR 合併指標
- (平均合併 17天 21小時) (30 天內合併 92 個 PR)
描述
Jira Link: DB-948
Description
(thanks to an investigation with @ttyusupov)
Currently in YB version 2.13.0.0 build 42, the statistic rocksdb_read_block_get_micros is only measured and incremented for any read that has the intention to populate the block based cache. This means that for a read with the block based cache disabled, this statistic is not incremented.
This is fixed in the rocksdb main code with pull request 3442. I think it makes sense to correct this in our code too.
That brings a visibility problem: currently the difference between rocksdb_sst_read_micros (number of read calls submitted to the OS) and rocksdb_read_block_get_micros gives an indication of the number of blocks read for compaction. With the above fix, compaction will add to the rocksdb_read_block_get_micros statistic, and thus the number of DocDB client reads cannot be derived.
I would suggest create a specific read block statistic for compaction, such as rocksdb_read_block_compaction_get_micros, and a statistic rocksdb_read_block_request_get_micros for DocDB client requests, so the two can be differentiated.