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

IGNITE-14383 No need to update metastorage if cache statistics disabled #8924

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

zstan
Copy link
Contributor

@zstan zstan commented Mar 24, 2021

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

for (IgniteBiTuple<CacheGroupContext, Boolean> grp : grpsToStop)
stopCacheGroup(grp.get1().groupId(), grp.get2());
for (IgniteBiTuple<CacheGroupContext, Boolean> grp : grpsToStop) {
Boolean stat = grpMetricsToStop.get(grp.get1().groupId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we really need intermediate grpMetricsToStop map?
Let's just calculate statisticsEnabled flag right in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep ... cause upper we removes it context : prepareCacheStop -> sharedCtx.removeCacheContext(ctx);

@@ -3262,6 +3281,8 @@ public void processStatisticsModeChange(CacheStatisticsModeChangeMessage msg) {
private void stopCachesOnClientReconnect(Collection<GridCacheAdapter> stoppedCaches) {
assert ctx.discovery().localNode().isClient();

boolean stat = stoppedCaches.stream().anyMatch(c -> c.context().statisticsEnabled());
Copy link
Contributor

Choose a reason for hiding this comment

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

stat -> removeMetrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@nizhikov
Copy link
Contributor

@zstan What if

  1. Statistics enabled.
  2. We create cache group.
  3. Disable statistic.
  4. Remove cache group.

It seems this scenario will lead to a situation when we don't clear meta storage properly.
Can we check the presence of metal storage keys before trying to remove them?

And what is the issue with removing unexisting keys in the first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants