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:
Many Reader.readBlock calls are using a background context, e.g. Reader.readRangeDel, readRangeKey, readMetaindex. These should use a real context.
tableCacheValue.load which creates a new Reader should accept a context. We have one in the callpath that originates in tableCacheShard.newIters.
Jira issue: PEBBLE-36
[Radu] Making a checklist for context propagation:
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 includeReader
creation or loading of various block types). We have aLoggerAndTracer
passed to Pebble, and tracing of slow block loads (5ms is the slow threshold inReader.readBlock
), since https://github.com/cockroachdb/pebble/issues/2055. But there are some significant gaps:Reader.readBlock
calls are using a background context, e.g.Reader.readRangeDel
,readRangeKey
,readMetaindex
. These should use a real context.tableCacheValue.load
which creates a newReader
should accept a context. We have one in the callpath that originates intableCacheShard.newIters
.Jira issue: PEBBLE-36
[Radu] Making a checklist for context propagation:
tableCacheValue.load
(in the newIters path)Reader
block reads (readRangeDel
,readRangeKey
,readMetaindex
)