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

K8SSAND-1515 ⁃ Error when parsing the system replication annotation after v1.1.0 upgrade #550

Closed
adejanovski opened this issue May 16, 2022 · 0 comments
Assignees
Labels
bug Something isn't working zh:Done Issues in the ZenHub pipeline 'Done'

Comments

@adejanovski
Copy link
Contributor

adejanovski commented May 16, 2022

What happened?
After upgrading to v1.1.0, the following error pops up in the operator logs:

1.652681134996166e+09	ERROR	controller.k8ssandracluster	System replication check failed	{"reconciler group": "k8ssandra.io", "reconciler kind": "K8ssandraCluster", "name": "dogfood", "namespace": "k8ssandra-operator", "K8ssandraCluster": "k8ssandra-operator/dogfood", "error": "json: cannot unmarshal array into Go value of type int"}
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).reconcile
	/workspace/controllers/k8ssandra/k8ssandracluster_controller.go:133
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).Reconcile
	/workspace/controllers/k8ssandra/k8ssandracluster_controller.go:87
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:227

The code is trying to unmarshall the initial-system-replication annotation to a map[string]int, but the format we get from v1.0.0 is: k8ssandra.io/initial-system-replication: '{"datacenters":["dc2","dc1"],"replicationFactor":3}'

v1.1.0 rather expects the following format it seems: {'dc1':3, 'dc2':3}

We need to support both formats and migrate the old one to the new one during an upgrade.

Did you expect to see something different?
The upgrade shouldn't trigger any error and the operator should gracefully accept both formats, performing a silent migration to the new annotation format.

How to reproduce it (as minimally and precisely as possible):
Upgrade a cluster from v1.0.x to v1.1.0.

Environment
GKE

  • K8ssandra Operator version:

    v1.1.0

    * Kubernetes cluster kind:

    GKE

┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: K8SSAND-1515
┆priority: Medium

@sync-by-unito sync-by-unito bot changed the title Error when parsing the system replication annotation after v1.1.0 upgrade K8SSAND-1515 ⁃ Error when parsing the system replication annotation after v1.1.0 upgrade May 16, 2022
@adejanovski adejanovski added zh:Ready bug Something isn't working and removed zh:Ready labels May 16, 2022
@adejanovski adejanovski added zh:In-Progress Issues in the ZenHub pipeline 'In-Progress' zh:Review Issues in the ZenHub pipeline 'Review' and removed zh:In-Progress Issues in the ZenHub pipeline 'In-Progress' labels May 16, 2022
@adejanovski adejanovski self-assigned this May 17, 2022
@adejanovski adejanovski added zh:Done Issues in the ZenHub pipeline 'Done' and removed zh:Review Issues in the ZenHub pipeline 'Review' labels May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working zh:Done Issues in the ZenHub pipeline 'Done'
Projects
None yet
Development

No branches or pull requests

1 participant