yugabyte/yugabyte-db

[DocDB] Fix statistic RocksDB_read_block_get_micros to include all reads

Open

#11.744 aberto em 14 de mar. de 2022

Ver no GitHub
 (1 comment) (0 reactions) (1 assignee)C (1.003 forks)batch import
area/docdbgood first issuekind/bugpriority/medium

Métricas do repositório

Stars
 (8.229 stars)
Métricas de merge de PR
 (Mesclagem média 17d 21h) (92 fundiu PRs em 30d)

Description

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.

Guia do colaborador