-
Notifications
You must be signed in to change notification settings - Fork 25
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
Remove sandbox and subclusters from vdb at the same time #959
Conversation
vdb.Spec.Subclusters = vdb.Spec.Subclusters[1:] | ||
vdb.Spec.Subclusters = vdb.Spec.Subclusters[:2] | ||
scNames = append(scNames[0:1], scNames[3]) | ||
verifySubclusters(ctx, vdb, scNames, []int32{0, 0}, sbName, FindNotInVdbAcrossSandboxes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the size is set to {0, 0}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because when the operator constructs subclusters no longer in vdb from their statefulsets, it gives them size 0 as they will soon be removed.
api/v1/verticadb_webhook.go
Outdated
// find subclusters that are sandboxed in old vdb but removed in new vdb | ||
// checkSandboxSubclustersRemoved checks subclusters that are sandboxed in old vdb but removed in new vdb | ||
func (v *VerticaDB) checkSandboxSubclustersRemoved(allErrs field.ErrorList, oldObj *VerticaDB, oldScIndexMap map[string]int, | ||
oldScMap, newScMap map[string]*Subcluster, path *field.Path) field.ErrorList { | ||
oldScInSandbox := oldObj.GenSubclusterSandboxMap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should modify this to: newScInSandbox := v.GenSubclusterSandboxMap(). Then in line 1647, verify the removed sc isn't in newScInSandbox. The check in line 1650(if v.GetSandbox(sb) == nil) is not accurate since the sc could be in a new sandbox of new vdb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I always add the impression that moving a subcluster from one sandbox to another would not work. Then I need to change my definition of zombie
subcluster as it will also cover the case where sandbox still exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your next PR: you can remove the timeout you added in the e2e tests.
This fixes the issue that happens when you remove a sandbox and all its subclusters at the same time from the vdb, the pods will be down but will never get deleted.
Now, as soon as unsandbox is done the operator will find the statefulset make it rejoin the main cluster where it will be removed.