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

ObservedGeneration in conditions #275

Merged
merged 22 commits into from
Jan 28, 2025

Conversation

kobzonega
Copy link
Contributor

@kobzonega kobzonega commented Dec 4, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

missing info about observed generation for object

What is the new behavior?

  • add field ObservedGeneration inside .status.conditions
  • check and compare ObservedGeneration for NodeSet objects

Other information

@kobzonega kobzonega changed the title Observed generation ObservedGeneration in conditions Dec 4, 2024
@kobzonega kobzonega force-pushed the observed-generation branch from 16e8f1b to 0a41cb4 Compare January 27, 2025 05:33
@@ -630,16 +654,6 @@ func (r *Reconciler) syncNodeSetSpecInline(
}
}

if !meta.IsStatusConditionTrue(database.Status.Conditions, DatabasePreparedCondition) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kobzonega а это получается, у нас на NodeSet-ах прокручивалась одна лишняя итерация reconcile всегда, которая навешивала DatabasePreparedCondition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Именно в этой строчке скорее была опечатка, код перенес выше в метод handleResourcesSync https://github.com/ydb-platform/ydb-kubernetes-operator/pull/275/files#diff-fdcac52a438f64dabd1c874f4afc8106d2804e90eac89634771c2b1846257e7cR473-R481

Но если отвечать в общем, то всегда после изменения .status.state для объекта выполняется Update и вызывается повторный Reconcile спустя 1сек (StatusUpdateRequeueDelay). Это происходит для явного сохранения state объекта в k8s api, например чтобы по полю status явно определять этап на котором остановилось выполнение из-за ошибки/ожидания.

@kobzonega kobzonega merged commit c3664d0 into ydb-platform:master Jan 28, 2025
3 checks passed
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 this pull request may close these issues.

4 participants