diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index afb7b3f8c26f..31c3282a4db0 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -981,12 +981,18 @@ func NewPebble(ctx context.Context, cfg PebbleConfig) (p *Pebble, err error) { return int(atomic.LoadUint64(&p.atomic.compactionConcurrency)) } + // NB: The ordering of the event listeners passed to TeeEventListener is + // deliberate. The listener returned by makeMetricEtcEventListener is + // responsible for crashing the process if a DiskSlow event indicates the + // disk is stalled. While the logging subsystem should also be robust to + // stalls and crash the process if unable to write logs, there's less risk + // to sequencing the crashing listener first. el := pebble.TeeEventListener( + p.makeMetricEtcEventListener(ctx), pebble.MakeLoggingEventListener(pebbleLogger{ ctx: logCtx, depth: 2, // skip over the EventListener stack frame }), - p.makeMetricEtcEventListener(ctx), ) p.eventListener = &el