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

fix(cluster update): separate cache update context from API call #4251

Merged

Conversation

karol-kokoszka
Copy link
Collaborator

@karol-kokoszka karol-kokoszka commented Feb 13, 2025

Fixes #4249

This PR "unplugs" background config-cache update from the API call context.

Before change (context cancelled):

➜  scylla-manager git:(kk/4249-update-config-cache-in-separation-from-api-call) ✗ ./sctool.dev cluster update --cluster 6bb4f1d2-8ab7-4ed8-894b-767d52b1664e --username cassandra --password cassandra

04:49:06.975    INFO    http    PUT /api/v1/cluster/6bb4f1d2-8ab7-4ed8-894b-767d52b1664e        {"from": "192.168.100.1:41228", "status": 200, "bytes": 223, "duration": "61ms", "_trace_id": "DzcJULtaRPu77hSBdQM8zw"}
04:49:06.975    INFO    cluster Creating new Scylla HTTP client {"cluster_id": "6bb4f1d2-8ab7-4ed8-894b-767d52b1664e", "_trace_id": "DzcJULtaRPu77hSBdQM8zw"}
04:49:06.976    ERROR   cluster Couldn't discover hosts using stored coordinator host, proceeding with other known ones {"coordinator-host": "192.168.200.11", "error": "context canceled", "_trace_id": "DzcJULtaRPu77hSBdQM8zw"}
github.com/scylladb/go-log.Logger.log
        github.com/scylladb/[email protected]/logger.go:101
github.com/scylladb/go-log.Logger.Error
        github.com/scylladb/[email protected]/logger.go:84
github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).discoverClusterHosts
        github.com/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:186
github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).discoverAndSetClusterHosts
        github.com/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:163
github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).CreateClientNoCache
        github.com/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:144
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).updateSingle
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:178
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).ForceUpdateCluster
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:147
04:49:06.977    ERROR   cluster There is no single valid known host for the cluster. Please update it with 'sctool cluster update -h <host>'    {"cluster": "6bb4f1d2-8ab7-4ed8-894b-767d52b1664e", "contact point": "192.168.200.11", "discovered hosts": ["192.168.200.11", "192.168.200.12", "192.168.200.13", "192.168.200.21", "192.168.200.22", "192.168.200.23"], "_trace_id": "DzcJULtaRPu77hSBdQM8zw"}
github.com/scylladb/go-log.Logger.log
        github.com/scylladb/[email protected]/logger.go:101
github.com/scylladb/go-log.Logger.Error
        github.com/scylladb/[email protected]/logger.go:84
github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).discoverAndSetClusterHosts
        github.com/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:166
github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).CreateClientNoCache
        github.com/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:144
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).updateSingle
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:178
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).ForceUpdateCluster
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:147
04:49:06.977    ERROR   Cluster config update   Couldn't create scylla client   {"cluster": "6bb4f1d2-8ab7-4ed8-894b-767d52b1664e", "cluster": "6bb4f1d2-8ab7-4ed8-894b-767d52b1664e", "error": "discover and set cluster hosts: unable to connect to any of cluster's known hosts", "_trace_id": "DzcJULtaRPu77hSBdQM8zw", "errorStack": "github.com/scylladb/scylla-manager/v3/pkg/service/cluster.(*Service).CreateClientNoCache\n\tgithub.jparrowsec.cn/scylladb/scylla-manager/v3/pkg/service/cluster/service.go:145\ngithub.jparrowsec.cn/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).updateSingle\n\tgithub.jparrowsec.cn/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:178\ngithub.jparrowsec.cn/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).ForceUpdateCluster\n\tgithub.jparrowsec.cn/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:147\nruntime.goexit\n\truntime/asm_amd64.s:1700\n"}
github.com/scylladb/go-log.Logger.log
        github.com/scylladb/[email protected]/logger.go:101
github.com/scylladb/go-log.Logger.Error
        github.com/scylladb/[email protected]/logger.go:84
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).updateSingle
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:180
github.com/scylladb/scylla-manager/v3/pkg/service/configcache.(*Service).ForceUpdateCluster
        github.com/scylladb/scylla-manager/v3/pkg/service/configcache/service.go:147

After change (no error, cache is updated):

04:51:41.638    INFO    http    PUT /api/v1/cluster/6bb4f1d2-8ab7-4ed8-894b-767d52b1664e        {"from": "192.168.100.1:44138", "status": 200, "bytes": 223, "duration": "62ms", "_trace_id": "gndfNd7jQT-Mh5KEUQxkqA"}
04:51:41.638    INFO    cluster Creating new Scylla HTTP client {"cluster_id": "6bb4f1d2-8ab7-4ed8-894b-767d52b1664e"}
04:51:41.647    INFO    cluster.client  Datacenters by latency (dec)    {"dcs": ["dc2", "dc1"]}

Please make sure that:

  • Code is split to commits that address a single change
  • Commit messages are informative
  • Commit titles have module prefix
  • Commit titles have issue nr. suffix

@karol-kokoszka karol-kokoszka merged commit 723864a into master Feb 13, 2025
51 checks passed
@karol-kokoszka karol-kokoszka deleted the kk/4249-update-config-cache-in-separation-from-api-call branch February 13, 2025 11:56
@karol-kokoszka karol-kokoszka mentioned this pull request Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Manager 3.4.1] Cluster update doesn't update config-cache properly, it's delayed
2 participants