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

Document the cluster aggregate module #985

Merged
merged 3 commits into from
Nov 16, 2022
Merged

Conversation

arbulu89
Copy link
Contributor

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.

@arbulu89 arbulu89 added the documentation Improvements or additions to documentation label Nov 15, 2022
@arbulu89 arbulu89 marked this pull request as ready for review November 15, 2022 13:51
Copy link
Member

@nelsonkopliku nelsonkopliku left a 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.


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
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rephrased

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

DOCH! 📜

Copy link
Member

@fabriziosestito fabriziosestito left a 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
Copy link
Member

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.

Copy link
Member

@nelsonkopliku nelsonkopliku Nov 15, 2022

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 ☮️

@fabriziosestito fabriziosestito self-requested a review November 16, 2022 08:14
@arbulu89 arbulu89 merged commit 3faf19a into main Nov 16, 2022
@arbulu89 arbulu89 deleted the cluster-aggregate-docs branch November 16, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Development

Successfully merging this pull request may close these issues.

3 participants