Fix cache config and search logging (#4732)

* make share event logging more distinguishable

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix cache stat table config

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* add changelog

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2022-10-04 14:07:11 +02:00
committed by GitHub
parent 84a775dcc3
commit b257ba6664
4 changed files with 41 additions and 5 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -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",
},
},
},

View File

@@ -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",
},
},
},