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

cass-operator should not modify spec #102

Open
arianvp opened this issue May 20, 2021 · 8 comments
Open

cass-operator should not modify spec #102

arianvp opened this issue May 20, 2021 · 8 comments
Assignees
Labels
assess Issues in the state 'assess' enhancement New feature or request

Comments

@arianvp
Copy link
Contributor

arianvp commented May 20, 2021

What is missing?

When setting spec.replaceNodes cass-operator will set it to sepc.replaceNodes = [] after it has started replacing nodes. I would like cass-operator to not do that.

// Now that we've recorded these nodes in the status, we can blank
// out this field on the spec
dc.Spec.ReplaceNodes = []string{}

Why do we need it?

This makes cass-operator hard to use with GitOps tools like Flux as it will continously apply the spec; causing a replacement procedure to be triggered over and over.

I guess cass-operator should look at status.NodeReplacements == [] && len(spec.ReplaceNodes ) > 0 to decide whether to start a new replacement instead of at len(spec.ReplaceNodes) > 0

Environment

  • Cass Operator version:

    Insert image tag or Git SHA here

    **Anything else we need to know?**:

┆Issue is synchronized with this Jira Story by Unito
┆Issue Number: CASS-62

@arianvp arianvp added the enhancement New feature or request label May 20, 2021
@burmanm
Copy link
Contributor

burmanm commented May 20, 2021

Do you mean Flux tries to fight against the cass-operator's modifications? Thus both want to maintain their state in the spec part?

@jsanda
Copy link
Contributor

jsanda commented May 20, 2021

Thanks for opening this @arianvp :) Unfortunately there are other properties in spec that the are modified:

  • rollingRestartRequested
  • stopped

Might be better to have a separate ticket for each of these and then a "parent" issues. What do you think?

@arianvp
Copy link
Contributor Author

arianvp commented Jun 4, 2021

For replaceNodes I was wondering is it a safe and sound technique to just always start up cassandra with -Dcassandra.replace_address=<previous-pod's-address> ? Just not make this configurable and always see pod restarts as "Replacements"?

If the pod happens to be using something like reattachable storage (EBS) the data is already there and the replacement will be instant. If there is no reattachable storage than it will replicate the data from other nodes.

I don't know enough about cassandra intricacies to tell if that is a good idea. But it would solve the issue at least for replaceNodes

@ErickRamirezAU
Copy link

ErickRamirezAU commented Jun 4, 2021

It isn't necessary to use the replace_address flag if the data/ directory is intact. Cassandra is smart enough to know that it's technically the "same" Cassandra node when the PV/storage is attached to a new pod.

For example, let's say Cassandra is running on bare metal servers not in a Kubernetes cluster. If the server experiences a hardware failure, you can simply pull the data disk out of the chassis and plug it into a new bare metal server. Provided that the OS + Cassandra is installed and configured, Cassandra will start up as expected even if the server has a new IP -- Cassandra will handle the change internally.

The same applies to EC2 instances (or any compute instances for other cloud providers). In the case where the EC2 instance dies for whatever reason, you can simply mount the EBS volume to a new EC2 instance and Cassandra will continue to operate as normal. :)

@sync-by-unito sync-by-unito bot changed the title cass-operator should not modify spec K8SSAND-182 ⁃ cass-operator should not modify spec Apr 4, 2022
@jsanda
Copy link
Contributor

jsanda commented Apr 19, 2022

Please add your planning poker estimate with ZenHub @burmanm

@burmanm burmanm self-assigned this May 31, 2022
@burmanm
Copy link
Contributor

burmanm commented May 31, 2022

I think both of these (rollingRestart & replaceNode) could be done as CassandraTasks, which would avoid any Spec changes. As for mentioned "Stopped", it's not cass-operator that modifies it, so that could remain.

We would then deprecate those older Spec properties, but not remove them. If they're not used, then the Spec won't be changed and all should be good.

@burmanm
Copy link
Contributor

burmanm commented May 31, 2022

ForceUpgradeRacks modifies the Spec also

@adejanovski adejanovski added zh:Product-Backlog Issues in the ZenHub pipeline 'Product-Backlog' and removed zh:Assess/Investigate labels Jun 13, 2022
@adejanovski adejanovski removed the zh:Product-Backlog Issues in the ZenHub pipeline 'Product-Backlog' label Jul 26, 2022
@adejanovski adejanovski moved this to To Groom in K8ssandra Nov 8, 2022
@burmanm burmanm moved this from To Groom to Assess/Investigate in K8ssandra Nov 13, 2023
@adejanovski adejanovski added the assess Issues in the state 'assess' label Nov 13, 2023
@burmanm
Copy link
Contributor

burmanm commented Mar 7, 2024

After #583 is done, this ticket can be closed as then all the spec modifiers are deprecated.

@sync-by-unito sync-by-unito bot changed the title K8SSAND-182 ⁃ cass-operator should not modify spec cass-operator should not modify spec Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assess Issues in the state 'assess' enhancement New feature or request
Projects
No open projects
Status: Assess/Investigate
Development

No branches or pull requests

5 participants