cockroachdb / cockroachdb/pebble
db: improve context propagation for tracing of slow block loads
- Dominant language
- Go
- Stars
- 6k
- Forks
- 584
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 5
Description
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:
- [x] `tableCacheValue.load` (in the newIters path)
- [x] Ingest methods
- [ ] Value block load
- [x] `Reader` block reads (`readRangeDel`, `readRangeKey`, `readMetaindex`)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.