cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.95k stars 458 forks source link

db: improve context propagation for tracing of slow block loads #3728

Open sumeerbhola opened 4 months ago

sumeerbhola commented 4 months ago

We sometimes see traces in CockroachDB which suggest slowness in Pebble, but the InternalIteratorStats printed don't indicate block cache misses. This is possibly because those stats are incomplete (don't include Reader creation or loading of various block types). We have a LoggerAndTracer passed to Pebble, and tracing of slow block loads (5ms is the slow threshold in Reader.readBlock), since https://github.com/cockroachdb/pebble/issues/2055. But there are some significant gaps:

Jira issue: PEBBLE-36

[Radu] Making a checklist for context propagation:

RaduBerinde commented 1 month ago

Removing the P-2 label because the important paths have been addressed. There is only one path around value blocks that is more tricky.