-
Notifications
You must be signed in to change notification settings - Fork 122
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
[POC] any-event #1554
base: main
Are you sure you want to change the base?
[POC] any-event #1554
Conversation
This is a duplicate of #1108, and I think the reason we closed that one still mostly applies. However, we are seeing/promoting the holistic pattern more now, so a few additional thoughts:
Regarding your solution in #1108 and the three events you're seeing as a result of for event in self.on.events().values():
if not issubclass(event.event_type, ops.LifecycleEvent):
self.framework.observe(event, self._on_event) I'll leave this issue open for comments for another week. And it might be good to have further discussion -- if so, let us know and we'll schedule a nice little discussion for Frankfurt. |
I think the whole point of a well-written reconciler is that it truly is idempotent. There's no 'running it too often'. The only case in which there can be confusion is when the event doesn't match the state (e.g. you get a relation-removed, but the relation and its data are still readable).
I think this argument only holds for charms that don't use a reconciler. A holistic charm will only look at the parts of the state it knows, and if juju adds an event type it will only mean it will reconcile 'more often'. So long as the semantics of the state don't change we're safe.
Side-note: we also realized along the way that the only domain where 'true delta charming' really is useful is machine charms: there 'start'/'remove' really mean something. In k8s world, where everything can churn at any moment and go up and down at any time, that's where holistic charming is more natural.
Yes, absolutely.
I wonder if the workload-statefulness thing is a distinction that more people feel we should be philosophizing about; if so, I'd happily discuss it in frankfurt. Since we already have a framework.on.commit we can (abuse) to do this, and the only difference with what we want is that we'd like our reconciler to run before all other events are emitted (and before the framework has closed all databases) rather than after... would you feel differently about adding a |
brainstorming proof of concept API for introducing an 'any' event in ops
Issue 1:
examples:
Issue 2:
Proposed solution: