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

Reduce ClusterDetailsUpdated events #3112

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

nelsonkopliku
Copy link
Member

Description

This PR strips lpa_<sid>_lpt cluster node attributes during a cluster discovery, specifically when a RegisterClusterHost command is dispatched.

lpa_<sid>_lpt is a timestamp attribute attached to a cluster node that possibly changes at every discovery tick, resulting in many ClusterDetailsUpdated being emitted.

We want those possibly frequent changes to that attribute not be issuing the mentioned domain event.

Considerations:

  • change is currently implemented for hana scale up clusters only. We will extend to other cluster types when/if detected it being necessary
  • lpa_<sid>_lpt might be present for every cluster node, and it is being ignored for every cluster node
  • we accept the tradeoff that for the time being the stripped node attribute is not shown anywhere in the UI until we decide differently

Supersedes #3085

How was this tested?

Automated tests.

@nelsonkopliku nelsonkopliku self-assigned this Nov 4, 2024
@nelsonkopliku nelsonkopliku added enhancement New feature or request elixir Pull requests that update Elixir code labels Nov 4, 2024
Copy link
Contributor

@gagandeepb gagandeepb left a comment

Choose a reason for hiding this comment

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

I get the sense that this attribute is sometimes meaningful, even if frequently changing/somewhat "noisy"-ish. Omitting this attribute, sounds to me like losing some possibly meaningful information, even if 80-90% of the time it will be non-informative. Would you say this understanding is accurate ? More concretely, why are frequent changes in this timestamp(-like) attribute not meaningful enough on the whole (i.e. taken together over some longer timescales), and make necessary the changes being proposed in this PR ?

@nelsonkopliku
Copy link
Member Author

I get the sense that this attribute is sometimes meaningful

It is indeed meaningful for sap resource agents/pacemaker decisions.

...frequently changing/somewhat "noisy"-ish. Omitting this attribute, sounds to me like losing some possibly meaningful information, even if 80-90% of the time it will be non-informative.
Would you say this understanding is accurate?

Accurate.
Changes to that attribute should not be considered as a change in cluster configuration, so it is indeed pretty noisy when it leads to too many ClusterDetailsUpdated being emitted.

More concretely, why are frequent changes in this timestamp(-like) attribute not meaningful enough on the whole (i.e. taken together over some longer timescales), and make necessary the changes being proposed in this PR ?

We as trento don't do anything with that attribute and its value, other than possibly showing it.
It is also safe to assume that at this point in time its presence or absence from trento's state is equivalent.
Considering the quite invasive changes that are required to only show that attribute without its changes triggering too many unwanted events plus the limited knowledge of its counter part on clusters different than hana scale up, it's safer to keep the changes at minimum (aka only make sure that not too many events are emitted) and defer further considerations, which at a certain point might come back.

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Looks good!
Just a nitpick comment in the usage of Enum.spli_with and Map.drop

sid
) do
{_, new_attributes} =
Map.split_with(attributes, fn {key, _value} -> key == "lpa_#{String.downcase(sid)}_lpt" end)
Copy link
Contributor

@arbulu89 arbulu89 Nov 4, 2024

Choose a reason for hiding this comment

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

Now that we don't want to get the 2 modified versions, maybe simply new_attributes = Map.drop(attributes, ["lpa_#{String.downcase(sid)}_lpt"]) looks more to the point

Copy link
Member Author

Choose a reason for hiding this comment

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

true! Fixed

@nelsonkopliku nelsonkopliku force-pushed the reduce-cluster-details-updated-events branch from 16f6359 to dad5bb8 Compare November 4, 2024 12:40
Copy link
Contributor

@gagandeepb gagandeepb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the explanation!

@nelsonkopliku nelsonkopliku merged commit e72eb4a into main Nov 4, 2024
30 checks passed
@nelsonkopliku nelsonkopliku deleted the reduce-cluster-details-updated-events branch November 4, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants