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

Remove default limit for the number of visible instances on MC #12105

Merged
merged 1 commit into from Jan 10, 2018
Merged

Remove default limit for the number of visible instances on MC #12105

merged 1 commit into from Jan 10, 2018

Conversation

emre-aydin
Copy link
Contributor

hazelcast.mc.max.visible.instance.count group property is used for
limiting the number of visible instances on Management Center. Its
default value is updated to Integer.MAX_VALUE, effectively removing
the limit if it's not configured explicitly. The current value of 100
confuses users when it's exceeded, as the users don't configure it. Should
it be needed to limit the number of visible instances, it can still be
configured to a lower number.

Also fixes #12095

hazelcast.mc.max.visible.instance.count group property is used for
limiting the number of visible instances on Management Center. Its
default value is updated to Integer.MAX_VALUE, effectively removing
the limit if it's not configured explicitly. The current value of 100
confuses user when it's hit, as the users don't configure them. Should
it be needed to limit the number of visible instances, it can still be
configured to a lower number.

Also fixes #12095
@emre-aydin
Copy link
Contributor Author

Documentation update: hazelcast/hazelcast-reference-manual#474

@emre-aydin emre-aydin requested a review from jbee January 8, 2018 14:49
@jbee
Copy link
Contributor

jbee commented Jan 9, 2018

I am surprised by the use of List. Is there an important order to the members I am unaware of?
The name longInstanceNames seams confusing. I'm guessing the names are of any length but it might become a long list or a large set?
Also the implementation does not really prevent the list from becoming larger than the maximum set.

I also wonder why we would have the limit at all if its default is to not have it. Why was it introduced in the first place? Don't those reasons apply any longer? Because it seams some soft of protection.
Wouldn't it be the best if there is a limit but if reached the user sees a message directly at the end of the list that it has been shortened for reason X and that this can be configured using this setting?

Copy link
Contributor

@jbee jbee left a comment

Choose a reason for hiding this comment

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

See comment above ;)

@emre-aydin
Copy link
Contributor Author

Is there an important order to the members I am unaware of?

Nope. It's used just because we don't know the number of elements in advance (so pre-allocation is not possible) and the only operations on them is adding them together and sending them to Management Center as JSON by iterating the list.

The name longInstanceNames seams confusing.

Agreed. I think it has to do with the names having their prefixes in that list. I made no changes to it. I'd like to keep the PR only about the exact change I'm making, which is changing the default value and fixing a bug related to an out of memory error (see the linked issue in the PR description for that).

I also wonder why we would have the limit at all if its default is to not have it. Why was it introduced in the first place?

I believe it was introduced to prevent a very large set of data flowing from the member to Management Center. Can't remove because of backwards compatibility, and also there might be people who set it to some value other than the default value to limit the number of visible instances on Management Center (although admittedly I've never seen anyone do this yet).

Also the implementation does not really prevent the list from becoming larger than the maximum set.

It does, why do you think it doesn't? Is there something I'm missing?

Wouldn't it be the best if there is a limit but if reached the user sees a message directly at the end of the list that it has been shortened for reason X and that this can be configured using this setting?

The PRD for this work requires us to update the default value. This might be done as a separate enhancement. It also has an issue on Management Center repository: https://github.com/hazelcast/management-center/issues/536

@pveentjer
Copy link
Contributor

pveentjer commented Jan 9, 2018

What is the reason behind the original limit on returning a maximum number of members? AFAIK it isn't a big issue since I have not seen many clusters with more than 100 members.

Apart from this question, the PR looks good to me.

@emre-aydin
Copy link
Contributor Author

@pveentjer the wording is a bit confusing in this case. instance is used as a synonym for "distributed data structure" (i.e. not members) so it limits the number of distributed data structures that we send statistics for (to Management Center).

@jbee
Copy link
Contributor

jbee commented Jan 9, 2018

Nope. It's used just because we don't know the number of elements in advance (so pre-allocation is not possible)

In that case a ArrayList is still better for the sizes we expect but a HashSet (with no initial capacity set) is fine as well if we think a Set expresses the intent better. If 100 members is a big installation it really does not matter performance-wise and the collection that expresses the intent best is probably the best choice.
In general: LinkedList are mostly useful in for lists that are modified randomly (both in time and operation). For a uniformly growing list usually ArrayList is preferable as it is faster and avoids memory fragmentation.

It does, why do you think it doesn't? Is there something I'm missing?

I missed that the handleX methods also increased and checked the count internally. It was unexpected behaviour looking at the call site.

I believe it was introduced to prevent a very large set of data flowing from the member to Management Center.

If I read @pveentjer right such large sets practically don't exist. So the only reason to have the setting is backwards compatibility as far as I understand it.

@pveentjer
Copy link
Contributor

The naming is certainly confusing. The list doens't contain only member data, but it also contains all data for all distributed datastructures. So if you have 10 member cluster and 100 maps, then the returning object will contains at least 110 entries.

@emre-aydin emre-aydin merged commit 282c7c1 into hazelcast:maintenance-3.x Jan 10, 2018
@emre-aydin emre-aydin deleted the fix-mc-max-vis-instance-count branch January 10, 2018 11:13
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants