yugabyte/yugabyte-db

[DocDB] Fix statistic RocksDB_read_block_get_micros to include all reads

Open

#11.744 geöffnet am 14. März 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C (1.003 Forks)batch import
area/docdbgood first issuekind/bugpriority/medium

Repository-Metriken

Stars
 (8.229 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 17T 21h) (92 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide