From 2c900cc03231d98fade763aeeb9b65b564bc7d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 19 Jun 2023 10:43:44 +0200 Subject: [PATCH] Touch the by-type index root when linking spaces to invalidate cache --- pkg/storage/utils/decomposedfs/spaces.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index dec54991293..ba61e85a52f 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -847,7 +847,9 @@ func (fs *Decomposedfs) linkStorageSpaceType(ctx context.Context, spaceType stri } } - return err + // touch index root to invalidate caches + now := time.Now() + return os.Chtimes(filepath.Join(fs.o.Root, "indexes", "by-type"), now, now) } func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node, checkPermissions bool) (*provider.StorageSpace, error) {