VAULT-25456 CE side of changes for snapshot restore namespace cache bug (#27474)

* VAULT-25456 CE side of changes for snapshot restore namespace cache bug

* Changelog

* Unexport function
This commit is contained in:
Violet Hynes
2024-06-13 10:25:53 -04:00
committed by GitHub
parent 837a5fef88
commit b48bc61052
3 changed files with 9 additions and 0 deletions

3
changelog/27474.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
storage/raft (enterprise): Fix issue with namespace cache not getting cleared on snapshot restore, resulting in namespaces not found in the snapshot being inaccurately represented by API responses.
```

View File

@@ -18,3 +18,5 @@ func (c *Core) NamespaceByID(ctx context.Context, nsID string) (*namespace.Names
func (c *Core) ListNamespaces(includePath bool) []*namespace.Namespace {
return []*namespace.Namespace{namespace.RootNamespace}
}
func (c *Core) resetNamespaceCache() {}

View File

@@ -850,6 +850,10 @@ func (c *Core) raftSnapshotRestoreCallback(grabLock bool, sealNode bool) func(co
return err
}
// Reset the namespace cache so that any namespaces cached
// before the snapshot restore will no longer be present.
c.resetNamespaceCache()
return nil
}
}