Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

natsjskv store needs a migration from 5 to 6 #10098

Closed
butonic opened this issue Sep 18, 2024 · 4 comments
Closed

natsjskv store needs a migration from 5 to 6 #10098

butonic opened this issue Sep 18, 2024 · 4 comments
Labels

Comments

@butonic
Copy link
Member

butonic commented Sep 18, 2024

when using nats-js-kv, eg using the helm charts you might run into this error:

2024-09-17T14:09:40+02:00 ERR error uploading file error="Failed to store data in bucket 'spaces/f1/bdd61a-da7c-49fc-8203-0558109d1b4f/nodes/64/bb/19/df/-1598-4691-a07a-d2c2f5714815.REV.2024-09-17T08:56:50.792574043Z': nats: invalid key" datatx=simple line=/home/jfd/Repositories/reva/pkg/rhttp/datatx/manager/simple/simple.go:147 pkg=rhttp service=storage-system traceid=49388ac282e8ffca3a5165cb484669b1

this is caused by the store now encoding keys.

we need a migration for this because otherwise not only cached file metadata becomes inaccessible (this will just phase out) but because other stores use it to persist data (not as a cache).

@butonic
Copy link
Member Author

butonic commented Sep 23, 2024

stable 5 uses the OCIS_CACHE_STORE env var for these services:

./services/frontend/pkg/config/config.go:       StatCacheType               string        `yaml:"stat_cache_type" env:"OCIS_CACHE_STORE;FRONTEND_OCS_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." introductionVersion:"pre5.0"`
./services/gateway/pkg/config/config.go:        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." introductionVersion:"pre5.0"`
./services/gateway/pkg/config/config.go:        CreateHomeCacheStore              string        `yaml:"create_home_cache_store" env:"OCIS_CACHE_STORE;GATEWAY_CREATE_HOME_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." introductionVersion:"pre5.0"`
./services/settings/pkg/config/config.go:       Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;SETTINGS_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." introductionVersion:"pre5.0"`
./services/graph/pkg/config/cache.go:   Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;GRAPH_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." introductionVersion:"pre5.0"`
./services/storage-users/pkg/config/config.go:  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." introductionVersion:"pre5.0"`
./services/storage-users/pkg/config/config.go:  Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;STORAGE_USERS_ID_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." introductionVersion:"pre5.0"`
./services/ocs/pkg/config/config.go:    Store        string        `yaml:"store" env:"OCIS_CACHE_STORE;OCS_PRESIGNEDURL_SIGNING_KEYS_STORE" desc:"The type of the signing key store. Supported values are: 'redis-sentinel' and 'nats-js-kv'. See the text description for details." introductionVersion:"5.0"`
./services/proxy/pkg/config/config.go:  Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;PROXY_OIDC_USERINFO_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." introductionVersion:"pre5.0"`
./services/proxy/pkg/config/config.go:  Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;PROXY_PRESIGNEDURL_SIGNING_KEYS_STORE" desc:"The type of the signing key store. Supported values are: 'redis-sentinel', 'nats-js-kv' and 'ocisstoreservice' (deprecated). See the text description for details." introductionVersion:"5.0"`
./services/storage-system/pkg/config/config.go: Store              string        `yaml:"store" env:"OCIS_CACHE_STORE;STORAGE_SYSTEM_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." introductionVersion:"pre5.0"`

The OCIS_PERSISTENT_STORE env var is used for

./services/postprocessing/pkg/config/config.go: Store        string        `yaml:"store" env:"OCIS_PERSISTENT_STORE;POSTPROCESSING_STORE" desc:"The type of the store. Supported values are: 'memory', 'ocmem', 'etcd', 'redis', 'redis-sentinel', 'nats-js', 'noop'. See the text description for details." introductionVersion:"pre5.0"`
./services/eventhistory/pkg/config/config.go:   Store        string        `yaml:"store" env:"OCIS_PERSISTENT_STORE;EVENTHISTORY_STORE" desc:"The type of the store. Supported values are: 'memory', 'ocmem', 'etcd', 'redis', 'redis-sentinel', 'nats-js', 'noop'. See the text description for details." introductionVersion:"pre5.0"`
./services/userlog/pkg/config/config.go:        Store        string        `yaml:"store" env:"OCIS_PERSISTENT_STORE;USERLOG_STORE" desc:"The type of the store. Supported values are: 'memory', 'ocmem', 'etcd', 'redis', 'redis-sentinel', 'nats-js', 'noop'. See the text description for details." introductionVersion:"pre5.0"`

this came already with ocis v3.0.0:


  • Change - Updated Cache Configuration: #5829

    We updated all cache related environment vars to more closely follow the go
    micro naming pattern: - {service}_CACHE_STORE_TYPE becomes
    {service}_CACHE_STORE or {service}_PERSISTENT_STORE -
    {service}_CACHE_STORE_ADDRESS(ES) becomes {service}_CACHE_STORE_NODES - The
    mem store implementation name changes to memory - In yaml files the cache
    type becomes store We introduced redis-sentinel as a store implementation.

    Proxy accesstoken cache store #5829


The natsjskv encoding issue was fixed released with v6.0.0.

Before v6 nats-js-kv could not be used as a storage file metadata cache. It defaults to memory and had to be disabled in HA deployments using STORAGE_USERS_FILEMETADATA_CACHE_STORE=noop and STORAGE_SYSTEM_CACHE_STORE=noop.

Upgading does NOT need a migration. In fact, the helm chart can now use nats-js-kv instead of noop.

Also see owncloud/ocis-charts#214

@butonic butonic closed this as completed Sep 23, 2024
@github-project-automation github-project-automation bot moved this from Prio 2 to Done in Infinite Scale Team Board Sep 23, 2024
@butonic
Copy link
Member Author

butonic commented Sep 23, 2024

Ahhh, IIRC we started to also cache trash or revision metadata ... that would have introduced : in the key. Let me see if i can find the commit...

@butonic butonic reopened this Sep 23, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in Infinite Scale Team Board Sep 23, 2024
@butonic
Copy link
Member Author

butonic commented Sep 23, 2024

comparing the two lines

https://github.com/owncloud/ocis/issues/9114 
2024-05-08T17:12:59+02:00 ERR error reading blobsize xattr, using 0 error="error reading blobsize xattr: Failed to store data in bucket 'spaces/so/me-admin-user-id-0000-000000000000/nodes/04/a5/b4/86/-4ce3-492e-a98e-87eddada0146.REV.2024-05-08T14:54:24.01526906Z': nats: invalid key" name=-4ce3-492e-a98e-87eddada0146.REV.2024-05-08T14:54:24.01526906Z pkg=rgrpc service=storage-users traceid=a8a634abcc56ef9bb072699c85e5de3e
this issue
2024-09-17T14:09:40+02:00 ERR error uploading file error="Failed to store data in bucket 'spaces/f1/bdd61a-da7c-49fc-8203-0558109d1b4f/nodes/64/bb/19/df/-1598-4691-a07a-d2c2f5714815.REV.2024-09-17T08:56:50.792574043Z': nats: invalid key" datatx=simple line=/home/jfd/Repositories/reva/pkg/rhttp/datatx/manager/simple/simple.go:147 pkg=rhttp service=storage-system traceid=49388ac282e8ffca3a5165cb484669b1

same underlying issue ...

but stable5 somehow works without encoding the keys ... even when nats-js-kv is configured ...

👀

@butonic
Copy link
Member Author

butonic commented Sep 23, 2024

solved with cs3org/reva#4862

no magration needed

@butonic butonic closed this as completed Sep 23, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Infinite Scale Team Board Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

1 participant