Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

add statefulset recovery action #97

Closed
wants to merge 1 commit into from
Closed

add statefulset recovery action #97

wants to merge 1 commit into from

Conversation

mackwong
Copy link
Contributor

I think the reason for #96 is that after deleting the pod, the lastClusterAction has not been updated, and lastClusterActionStatus is always Done, so the status.Phase can not be updated
https://github.com/Orange-OpenSource/cassandra-k8s-operator/blob/73fd24e4d80d853a640defa42b91345cb29847ba/pkg/controller/cassandracluster/reconcile.go#L527

logrus.WithFields(logrus.Fields{"cluster": cc.Name, "rack": dcRackName}).Info("Statefulset is Ready")
lastAction.Status = api.StatusDone
lastAction.EndTime = &now
labels := map[string]string{"operation-name": api.OperationCleanup}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why there is a cleanup operation in that case.

@@ -182,6 +187,20 @@ func UpdateStatusIfUpdateResources(cc *api.CassandraCluster, dcRackName string,
}
*/

//UpdateStatusIfStatefulSetStatusHasChanged updates CassandraCluster Action Status if any pod is not Ready
func UpdateStatusIfStatefulSetStatusHasChanged(cc *api.CassandraCluster, dcRackName string, storedStatefulSet *appsv1.StatefulSet, status *api.CassandraClusterStatus) bool {
Copy link
Contributor

@Orange-cscetbon Orange-cscetbon Aug 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks dangerous to me. It can happen during the creation of the cluster, whenever there is an operation at the stfs level etc..
@allamand don't hesitate to weigh in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I didn't take into account the creation of the cluster,
I will close it.

@Orange-cscetbon
Copy link
Contributor

I think there is a misunderstanding of what the operator does and the way it checks different status changes or if there are pending operation.

@mackwong mackwong closed this Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants