From d7483836082e88cc3142bcf774caf4017f6dee1e Mon Sep 17 00:00:00 2001 From: Nick Travers Date: Mon, 15 May 2023 11:17:17 -0700 Subject: [PATCH] storage: close over disk slow event listener When addressing an interface change in a recent vendor bump (#102882), a closure over the existing event listener (passed in via `opts`) was removed in favor of instantiating Pebble's event listener directly. This had the effect of dropping disk slow events. Revert to using a function that closed over the `opts`, making use of the existing event listener. Fixes: #103185 Fixes: #102946 Fixes: #102944 Fixes: #102940 Release note: None. --- pkg/storage/pebble.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index 817a0a973b02..b5c91c93bffe 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -664,7 +664,14 @@ func wrapFilesystemMiddleware(opts *pebble.Options) (vfs.FS, io.Closer) { // wraps the filesystem with a layer that times all write-oriented // operations. fs, closer := vfs.WithDiskHealthChecks(opts.FS, diskHealthCheckInterval, - opts.EventListener.DiskSlow) + func(info vfs.DiskSlowInfo) { + opts.EventListener.DiskSlow(pebble.DiskSlowInfo{ + Path: info.Path, + OpType: info.OpType, + Duration: info.Duration, + WriteSize: info.WriteSize, + }) + }) // If we encounter ENOSPC, exit with an informative exit code. fs = vfs.OnDiskFull(fs, func() { exit.WithCode(exit.DiskFull())