diff --git a/changelog/unreleased/fix-cache-config.md b/changelog/unreleased/fix-cache-config.md new file mode 100644 index 000000000..105517d2a --- /dev/null +++ b/changelog/unreleased/fix-cache-config.md @@ -0,0 +1,5 @@ +Bugfix: Fix cache stat table config + +We have aligned the cache table config for the gateway and the dataprovider to make them actually use the same cache instance. + +https://github.com/owncloud/ocis/pull/4732 diff --git a/services/search/pkg/search/provider/events.go b/services/search/pkg/search/provider/events.go index 525daf3e8..af62c7841 100644 --- a/services/search/pkg/search/provider/events.go +++ b/services/search/pkg/search/provider/events.go @@ -38,7 +38,12 @@ func (p *Provider) handleEvent(ev interface{}) { } statRes, err := p.statResource(ownerCtx, ref, owner) if err != nil { - p.logger.Error().Err(err).Msg("failed to stat the changed resource") + p.logger.Error().Err(err). + Str("storageid", ref.GetResourceId().GetStorageId()). + Str("spaceid", ref.GetResourceId().GetSpaceId()). + Str("opaqueid", ref.GetResourceId().GetOpaqueId()). + Str("path", ref.GetPath()). + Msg("failed to make stat call for the restored resource") return } @@ -46,10 +51,20 @@ func (p *Provider) handleEvent(ev interface{}) { case rpc.Code_CODE_OK: err = p.indexClient.Restore(statRes.Info.Id) if err != nil { - p.logger.Error().Err(err).Msg("failed to restore the changed resource in the index") + p.logger.Error().Err(err). + Str("storageid", ref.GetResourceId().GetStorageId()). + Str("spaceid", ref.GetResourceId().GetSpaceId()). + Str("opaqueid", ref.GetResourceId().GetOpaqueId()). + Str("path", ref.GetPath()). + Msg("failed to restore the changed resource in the index") } default: - p.logger.Error().Interface("statRes", statRes).Msg("failed to stat the changed resource") + p.logger.Error().Interface("statRes", statRes). + Str("storageid", ref.GetResourceId().GetStorageId()). + Str("spaceid", ref.GetResourceId().GetSpaceId()). + Str("opaqueid", ref.GetResourceId().GetOpaqueId()). + Str("path", ref.GetPath()). + Msg("failed to stat the restored resource") } return @@ -122,11 +137,21 @@ func (p *Provider) handleEvent(ev interface{}) { statRes, err := p.statResource(ownerCtx, ref, owner) if err != nil { - p.logger.Error().Err(err).Msg("failed to stat the changed resource") + p.logger.Error().Err(err). + Str("storageid", ref.GetResourceId().GetStorageId()). + Str("spaceid", ref.GetResourceId().GetSpaceId()). + Str("opaqueid", ref.GetResourceId().GetOpaqueId()). + Str("path", ref.GetPath()). + Msg("failed to make stat call for changed resource") return } if statRes.Status.Code != rpc.Code_CODE_OK { - p.logger.Error().Interface("statRes", statRes).Msg("failed to stat the changed resource") + p.logger.Error().Interface("statRes", statRes). + Str("storageid", ref.GetResourceId().GetStorageId()). + Str("spaceid", ref.GetResourceId().GetSpaceId()). + Str("opaqueid", ref.GetResourceId().GetOpaqueId()). + Str("path", ref.GetPath()). + Msg("failed to stat the changed resource") return } diff --git a/services/storage-system/pkg/revaconfig/config.go b/services/storage-system/pkg/revaconfig/config.go index e97580250..b7026b180 100644 --- a/services/storage-system/pkg/revaconfig/config.go +++ b/services/storage-system/pkg/revaconfig/config.go @@ -112,14 +112,17 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} { "simple": map[string]interface{}{ "cache_store": "noop", "cache_database": "system", + "cache_table": "stat", }, "spaces": map[string]interface{}{ "cache_store": "noop", "cache_database": "system", + "cache_table": "stat", }, "tus": map[string]interface{}{ "cache_store": "noop", "cache_database": "system", + "cache_table": "stat", }, }, }, diff --git a/services/storage-users/pkg/revaconfig/config.go b/services/storage-users/pkg/revaconfig/config.go index 333815d2c..873b84984 100644 --- a/services/storage-users/pkg/revaconfig/config.go +++ b/services/storage-users/pkg/revaconfig/config.go @@ -57,16 +57,19 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} { "cache_store": cfg.Cache.Store, "cache_nodes": cfg.Cache.Nodes, "cache_database": cfg.Cache.Database, + "cache_table": "stat", }, "spaces": map[string]interface{}{ "cache_store": cfg.Cache.Store, "cache_nodes": cfg.Cache.Nodes, "cache_database": cfg.Cache.Database, + "cache_table": "stat", }, "tus": map[string]interface{}{ "cache_store": cfg.Cache.Store, "cache_nodes": cfg.Cache.Nodes, "cache_database": cfg.Cache.Database, + "cache_table": "stat", }, }, },