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

Descriptions for dividing subscription should be generated after related localizations was synced #688

Open
abstractmj opened this issue May 17, 2023 · 3 comments · May be fixed by #772
Open
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@abstractmj
Copy link
Contributor

Sometimes when the base arrives at the hub before the localization, the deployment in one member cluster may first expands from 0 to N, and then immediately shrinks to M;
0 < M < N

@abstractmj abstractmj added the kind/bug Something isn't working label May 17, 2023
@dixudx
Copy link
Member

dixudx commented May 17, 2023

newBaseName := fmt.Sprintf("%s-%s", sub.Namespace, sub.Name)
base, err := deployer.syncBase(sub, baseTemplate, newBaseName)
if err != nil {
allErrs = append(allErrs, err)
msg := fmt.Sprintf("Failed to sync Base %s: %v", klog.KObj(base), err)
klog.ErrorDepth(5, msg)
deployer.recorder.Event(sub, corev1.EventTypeWarning, "FailedSyncingBase", msg)
// if sync base error, all base(new and old name format) need keep exist
basesToBeDeleted.Delete(klog.KObj(baseTemplate).String())
baseTemplate.Name = newBaseName
basesToBeDeleted.Delete(klog.KObj(baseTemplate).String())
continue
}
basesToBeDeleted.Delete(klog.KObj(base).String())
// populate Localizations for dividing scheduling.
err = deployer.populateLocalizations(sub, base, idx)
if err != nil {
allErrs = append(allErrs, err)
klog.ErrorDepth(5, fmt.Sprintf("Failed to sync Localizations: %v", err))
}

Normally Localization objects are created and updated after Base objects. Then controller Description will begin the rendering of descriptions objects.

Sometimes when the base arrives at the hub before the localization, the deployment in one member cluster may first expands from 0 to N, and then immediately shrinks to M;
0 < M < N

For newly created objects, there should only be from 0 to M.

But if a subscription is updated, then there will be an interim transition from N to M, just like what you said. In this case, it seems there is no way to avoid such transitions, unless we introduce a new flag to indicate the outdated localizations and hold the rendering of description objects.

@abstractmj
Copy link
Contributor Author

abstractmj commented May 17, 2023

"Normally Localization objects are created and updated after Base objects. Then controller Description will begin the rendering of descriptions objects."

But we cannot guarentee the creation order between Localization and Description, so description may be already applied in member cluster before Localization is handled by hub

@dixudx
Copy link
Member

dixudx commented May 17, 2023

But we cannot guarentee the creation order between Localization and Description, so description may be already applied in member cluster before Localization is handled by hub

@abstractmj That's true. That's why I think we may introduce a new flag to indicate the outdated localizations and hold the rendering of description objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
2 participants