remove unused stat cache

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-01-23 12:48:44 +01:00
parent 8e613bbe7a
commit cec6ea50eb
7 changed files with 0 additions and 117 deletions

View File

@@ -85,14 +85,6 @@ type StorageRegistry struct {
// Cache holds cache config
type Cache struct {
StatCacheStore string // NOTE: The stat cache is not working atm. Hence we block configuring it
StatCacheNodes []string `yaml:"stat_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_STAT_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details."`
StatCacheDatabase string `yaml:"stat_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use."`
StatCacheTTL time.Duration `yaml:"stat_cache_ttl" env:"OCIS_CACHE_TTL;GATEWAY_STAT_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details."`
StatCacheSize int `yaml:"stat_cache_size" env:"OCIS_CACHE_SIZE;GATEWAY_STAT_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default."`
StatCacheDisablePersistence bool `yaml:"stat_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GATEWAY_STAT_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the stat cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false."`
StatCacheAuthUsername string `yaml:"stat_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME;GATEWAY_STAT_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured."`
StatCacheAuthPassword string `yaml:"stat_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;GATEWAY_STAT_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured."`
ProviderCacheStore string `yaml:"provider_cache_store" env:"OCIS_CACHE_STORE;GATEWAY_PROVIDER_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details."`
ProviderCacheNodes []string `yaml:"provider_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_PROVIDER_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details."`
ProviderCacheDatabase string `yaml:"provider_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use."`

View File

@@ -39,10 +39,6 @@ func DefaultConfig() *config.Config {
DisableHomeCreationOnLogin: true,
TransferExpires: 24 * 60 * 60,
Cache: config.Cache{
StatCacheStore: "noop", // NOTE: stat cache not working
StatCacheDatabase: "ocis",
StatCacheNodes: []string{"127.0.0.1:9233"},
StatCacheTTL: 300 * time.Second,
ProviderCacheStore: "noop",
ProviderCacheNodes: []string{"127.0.0.1:9233"},
ProviderCacheDatabase: "cache-providers",

View File

@@ -61,17 +61,6 @@ func GatewayConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]i
"transfer_shared_secret": cfg.TransferSecret,
"transfer_expires": cfg.TransferExpires,
// cache and TTLs
"stat_cache_config": map[string]interface{}{
"cache_store": cfg.Cache.StatCacheStore,
"cache_nodes": cfg.Cache.StatCacheNodes,
"cache_database": cfg.Cache.StatCacheDatabase,
"cache_table": "stat",
"cache_ttl": cfg.Cache.StatCacheTTL,
"cache_size": cfg.Cache.StatCacheSize,
"cache_disable_persistenc": cfg.Cache.StatCacheDisablePersistence,
"cache_auth_username": cfg.Cache.StatCacheAuthUsername,
"cache_auth_password": cfg.Cache.StatCacheAuthPassword,
},
"provider_cache_config": map[string]interface{}{
"cache_store": cfg.Cache.ProviderCacheStore,
"cache_nodes": cfg.Cache.ProviderCacheNodes,

View File

@@ -31,7 +31,6 @@ type Config struct {
TransferExpires int64 `yaml:"transfer_expires" env:"STORAGE_USERS_TRANSFER_EXPIRES" desc:"the time after which the token for upload postprocessing expires"`
Events Events `yaml:"events"`
StatCache StatCache `yaml:"stat_cache"`
FilemetadataCache FilemetadataCache `yaml:"filemetadata_cache"`
IDCache IDCache `yaml:"id_cache"`
MountID string `yaml:"mount_id" env:"STORAGE_USERS_MOUNT_ID" desc:"Mount ID of this storage."`
@@ -182,18 +181,6 @@ type Events struct {
AuthPassword string `yaml:"password" env:"OCIS_EVENTS_AUTH_PASSWORD;STORAGE_USERS_EVENTS_AUTH_PASSWORD" desc:"The password to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services.."`
}
// StatCache holds cache config
type StatCache struct {
Store string `yaml:"store" env:"OCIS_CACHE_STORE;STORAGE_USERS_STAT_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details."`
Nodes []string `yaml:"nodes" env:"OCIS_CACHE_STORE_NODES;STORAGE_USERS_STAT_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details."`
Database string `yaml:"database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use."`
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;STORAGE_USERS_STAT_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details."`
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_USERS_STAT_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default."`
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_STAT_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false."`
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;STORAGE_USERS_STAT_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured."`
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;STORAGE_USERS_STAT_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured."`
}
// FilemetadataCache holds cache config
type FilemetadataCache struct {
Store string `yaml:"store" env:"OCIS_CACHE_STORE;STORAGE_USERS_FILEMETADATA_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details."`

View File

@@ -94,12 +94,6 @@ func DefaultConfig() *config.Config {
ClusterID: "ocis-cluster",
EnableTLS: false,
},
StatCache: config.StatCache{
Store: "memory",
Nodes: []string{"127.0.0.1:9233"},
Database: "ocis",
TTL: 300 * time.Second,
},
FilemetadataCache: config.FilemetadataCache{
Store: "memory",
Nodes: []string{"127.0.0.1:9233"},

View File

@@ -74,41 +74,6 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} {
"nats_enable_tls": cfg.Events.EnableTLS,
"nats_username": cfg.Events.AuthUsername,
"nats_password": cfg.Events.AuthPassword,
"data_txs": map[string]interface{}{
"simple": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_table": "stat",
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"spaces": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_table": "stat",
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"tus": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_table": "stat",
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
},
},
},
},

View File

@@ -132,16 +132,6 @@ func Ocis(cfg *config.Config) map[string]interface{} {
"max_concurrency": cfg.Drivers.OCIS.MaxConcurrency,
"asyncfileuploads": cfg.Drivers.OCIS.AsyncUploads,
"max_quota": cfg.Drivers.OCIS.MaxQuota,
"statcache": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"filemetadatacache": map[string]interface{}{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
@@ -195,16 +185,6 @@ func OcisNoEvents(cfg *config.Config) map[string]interface{} {
"lock_cycle_duration_factor": cfg.Drivers.OCIS.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.OCIS.MaxConcurrency,
"max_quota": cfg.Drivers.OCIS.MaxQuota,
"statcache": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"filemetadatacache": map[string]interface{}{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
@@ -267,16 +247,6 @@ func S3NG(cfg *config.Config) map[string]interface{} {
"lock_cycle_duration_factor": cfg.Drivers.S3NG.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.S3NG.MaxConcurrency,
"asyncfileuploads": cfg.Drivers.OCIS.AsyncUploads,
"statcache": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"filemetadatacache": map[string]interface{}{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
@@ -334,16 +304,6 @@ func S3NGNoEvents(cfg *config.Config) map[string]interface{} {
"max_acquire_lock_cycles": cfg.Drivers.S3NG.MaxAcquireLockCycles,
"max_concurrency": cfg.Drivers.S3NG.MaxConcurrency,
"lock_cycle_duration_factor": cfg.Drivers.S3NG.LockCycleDurationFactor,
"statcache": map[string]interface{}{
"cache_store": cfg.StatCache.Store,
"cache_nodes": cfg.StatCache.Nodes,
"cache_database": cfg.StatCache.Database,
"cache_ttl": cfg.StatCache.TTL,
"cache_size": cfg.StatCache.Size,
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
"cache_auth_username": cfg.StatCache.AuthUsername,
"cache_auth_password": cfg.StatCache.AuthPassword,
},
"filemetadatacache": map[string]interface{}{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,