Skip to content

Conversation

@tkalkirill
Copy link
Contributor

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.

assert state != null : cacheName;

if (state.saved())
state.completed(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

leakage, i hope ? why u don`t call states.remove here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For in-memory cache, we can immediately delete, for persistent only after the end of the checkpoint.

private final GridBusyLock stopNodeLock = new GridBusyLock();

/** Current states. Mapping: cache name -> index rebuild state. */
private final ConcurrentMap<String, IndexRebuildState> states = new ConcurrentHashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

seems that states are never cleans ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

states is cleared here:

  • IndexRebuildStateStorage#onFinishRebuildIndexes - Using a ConcurrentMap#compute that returns null for non-persistent cache, thereby deletes the entry in the states;
  • IndexRebuildStateStorage#afterCheckpointEnd - Uses the same ConcurrentMap#compute, but removes only those with status IndexRebuildState.State#DELETE.

I also added a check to the ResumeRebuildIndexTest#testDeleteIndexRebuildStateOnDestroyCache that the states is cleared.

tkalkirill and others added 3 commits June 3, 2021 19:22
…rs/query/aware/IndexRebuildStateStorage.java

Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com>
…rs/query/aware/IndexRebuildStateStorage.java

Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com>
@AMashenkov AMashenkov merged commit 959a6be into apache:master Jun 7, 2021
xintrian pushed a commit to xintrian/ignite that referenced this pull request May 27, 2022
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.

3 participants