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-1167 ⁃ Check for schema agreement before applying schema changes #295

Closed
jsanda opened this issue Jan 14, 2022 · 2 comments · Fixed by #366
Closed

K8SSAND-1167 ⁃ Check for schema agreement before applying schema changes #295

jsanda opened this issue Jan 14, 2022 · 2 comments · Fixed by #366
Assignees

Comments

@jsanda
Copy link
Contributor

jsanda commented Jan 14, 2022

What is missing?
This is a follow up to #21. With the changes being introduced in #262, there several places/scenarios where we can apply schema changes in Cassandra. Specifically we change the replication of several keyspaces. We should be checking for schema agreement in the C* cluster before we apply each change.

Why do we need it?
Applying schema changes when the version is not consistent across the cluster can introduce instability. Its a good practice in general to check for schema version agreement before applying changes.

This should be done as a follow up to #262.

Environment

  • K8ssandra Operator version:
0538e957

┆Issue is synchronized with this Jira Bug by Unito
┆Reviewer: Miles Garnsey
┆fixVersions: k8ssandra-operator-v1.0.0
┆friendlyId: K8SSAND-1167
┆priority: High

@sync-by-unito sync-by-unito bot changed the title Check for schema agreement after applying schema changes K8SSAND-1167 ⁃ Check for schema agreement after applying schema changes Jan 14, 2022
@jsanda jsanda self-assigned this Jan 19, 2022
@jsanda
Copy link
Contributor Author

jsanda commented Jan 19, 2022

This is being handled by #262.

@jsanda jsanda changed the title K8SSAND-1167 ⁃ Check for schema agreement after applying schema changes K8SSAND-1167 ⁃ Check for schema agreement before applying schema changes Feb 7, 2022
@jsanda
Copy link
Contributor Author

jsanda commented Feb 7, 2022

I started looking into this. This really needs to be done in defaultManagementApiFacade. Schema version checks should be done in each of the following methods:

  • CreateKeyspaceIfNotExists
  • AlterKeyspace
  • CreateTable
  • EnsureKeyspaceReplication

If we do not have schema agreement, then those methods should not make any changes. We want to requeue the reconcile request at that point.

I will introduce a custom error type to indicate schema disagreement. The caller can check the error type to determine if a requeue is necessary.

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 a pull request may close this issue.

1 participant