-
Notifications
You must be signed in to change notification settings - Fork 15
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
Document the cluster aggregate module #985
Conversation
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.
Nice! I noticed a little inconsistency on what happens with the designated controller.
lib/trento/domain/cluster/cluster.ex
Outdated
|
||
Each deployed cluster is registered as a new aggregate entry, meaning that all the hosts belonging | ||
to the same cluster are part of the same stream. Among all the hosts, only the cluster discovery messages | ||
coming from the **designated controller** update the aggregate. In any case, all the hosts are listed in |
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.
Among all the hosts, only the cluster discovery messages coming from the designated controller update the aggregate
Not really...
We take into account discoveries from non designated controllers to add them to the cluster, if it wasn't already registerd.
We do take into account those only after the designated controller was registered.
# If no DC node was received yet, no cluster was registered.
def execute(%Cluster{cluster_id: nil}, %RegisterClusterHost{designated_controller: false}),
do: {:error, :cluster_not_found}
def execute(
%Cluster{} = cluster,
%RegisterClusterHost{
host_id: host_id,
designated_controller: false
}
) do
maybe_emit_host_added_to_cluster_event(cluster, host_id)
end
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.
Ok, you are right. I meant that all the values "except" the host list are only updated in those conditions. That's why I added the next sentence. But I will make it more clear
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 would rephrase this with a cluster is registered/cluster details are updated only by a designated controller.
once a cluster is registered other hosts can be added to the cluster.
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.
Rephrased
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.
DOCH! 📜
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.
Great work and thanks for this!
Just a mini nitpick on DDD terminology and LGTM
the health value is updated. The checks are started from a user request or periodically following the | ||
project scheduler configuration. | ||
|
||
This domain only knows about the health, the details about the execution are stored in the |
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.
just a little change here: "This bounded context" is more accurate.
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.
Question: who is This bounded context?
If we refer to web or wanda I'd be fine, but if we refer to the Cluster Aggregate, I wouldn't agree.
Then, what about other references to domain
in this Aggregate's documentation?
That's why this domain is tailored to work on clusters managing SAP workloads.
The cluster health is one of the most relevant concepts of this domain.
What does domain refer to in these sentences?
Just asking ☮️
Basic documentation of the cluster aggregate.
I have tried to simply specify the core concepts of the aggregate, without going too technical.
At the end, the idea is that anyone coming to this code has an initial knowledge about this aggregate and boundaries.