You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/08/25 12:26:45 UTC

[GitHub] [ignite] ascherbakoff opened a new pull request #8186: IGNITE-13358

ascherbakoff opened a new pull request #8186:
URL: https://github.com/apache/ignite/pull/8186


   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](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] agoncharuk commented on a change in pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
agoncharuk commented on a change in pull request #8186:
URL: https://github.com/apache/ignite/pull/8186#discussion_r484330666



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
##########
@@ -111,13 +103,10 @@
      * @param grp Group context.
      */
     public void onCacheGroupStopped(CacheGroupContext grp) {
-        GroupEvictionContext grpEvictionCtx = evictionGroupsMap.remove(grp.groupId());
+        GroupEvictionContext grpEvictionCtx =
+            evictionGroupsMap.computeIfAbsent(grp.groupId(), p -> new GroupEvictionContext(grp));

Review comment:
       Looks like we have a slow potential memory leak here: the value is removed from the map only on group start, so if I start and then stop unique caches, the map will grow.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] agoncharuk commented on a change in pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
agoncharuk commented on a change in pull request #8186:
URL: https://github.com/apache/ignite/pull/8186#discussion_r484323121



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
##########
@@ -223,27 +223,8 @@ public boolean disableRebalancingCancellationOptimization() {
                 if (part.state() == OWNING || part.state() == LOST)
                     continue;
 
-                // If partition is currently rented prevent destroy and start clearing process.
-                if (part.state() == RENTING) {
-                    if (part.reserve()) {
-                        part.moving();
-
-                        part.clearAsync();
-
-                        part.release();
-                    }
-                }
-
-                // If partition was destroyed recreate it.
-                if (part.state() == EVICTED) {
-                    part.awaitDestroy();
-
-                    part = top.localPartition(p, topVer, true);
-
-                    assert part != null : "Partition was not created [grp=" + grp.name() + ", topVer=" + topVer + ", p=" + p + ']';
-
-                    part.resetUpdateCounter();
-                }
+                // State should be switched to MOVING (or partition recreated) during PME.

Review comment:
       Let's have a single check for these states




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] ascherbakoff commented on a change in pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
ascherbakoff commented on a change in pull request #8186:
URL: https://github.com/apache/ignite/pull/8186#discussion_r484971207



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
##########
@@ -111,13 +103,10 @@
      * @param grp Group context.
      */
     public void onCacheGroupStopped(CacheGroupContext grp) {
-        GroupEvictionContext grpEvictionCtx = evictionGroupsMap.remove(grp.groupId());
+        GroupEvictionContext grpEvictionCtx =
+            evictionGroupsMap.computeIfAbsent(grp.groupId(), p -> new GroupEvictionContext(grp));

Review comment:
       I'll create a separate ticket to resolve this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] ascherbakoff closed pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
ascherbakoff closed pull request #8186:
URL: https://github.com/apache/ignite/pull/8186


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] agoncharuk commented on a change in pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
agoncharuk commented on a change in pull request #8186:
URL: https://github.com/apache/ignite/pull/8186#discussion_r484327999



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
##########
@@ -95,7 +95,7 @@ protected final GridCacheMapEntry putEntryIfObsoleteOrAbsent(
         GridCacheMapEntry doomed = null;
 
         boolean done = false;
-        boolean reserved = false;
+        boolean reserved = clearing;

Review comment:
       Let's rename this flag to skipReserve as this is the only semantics of this flag. Also, we need to get rid of the `touch` flag in the parent call hierarchy as the naming is confusing.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] agoncharuk commented on a change in pull request #8186: IGNITE-13358

Posted by GitBox <gi...@apache.org>.
agoncharuk commented on a change in pull request #8186:
URL: https://github.com/apache/ignite/pull/8186#discussion_r484324828



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
##########
@@ -2848,25 +2795,55 @@ private void removeNode(UUID nodeId) {
     }
 
     /** {@inheritDoc} */
-    @Override public void onEvicted(GridDhtLocalPartition part, boolean updateSeq) {
+    @Override public boolean tryFinishEviction(GridDhtLocalPartition part) {
         ctx.database().checkpointReadLock();
 
         try {
+            // Write lock protects from concurrent partition creation.
             lock.writeLock().lock();
 
             try {
                 if (stopping)
-                    return;
+                    return false;
 
-                assert part.state() == EVICTED;
+                part.finishEviction();
 
-                long seq = updateSeq ? this.updateSeq.incrementAndGet() : this.updateSeq.get();
+                if (part.state() != EVICTED)
+                    return false;
+
+                long seq = this.updateSeq.incrementAndGet();
 
                 assert lastTopChangeVer.initialized() : lastTopChangeVer;
 
                 updateLocal(part.id(), part.state(), seq, lastTopChangeVer);
 
                 consistencyCheck();
+
+                grp.onPartitionEvicted(part.id());
+
+                try {
+                    grp.offheap().destroyCacheDataStore(part.dataStore());
+                }
+                catch (IgniteCheckedException e) {
+                    log.error("Unable to destroy cache data store on partition eviction [id=" + part.id() + "]", e);
+                }
+
+                part.clearDeferredDeletes();
+
+                List<GridDhtLocalPartition> parts = localPartitions();
+
+                int renting = 0;
+
+                for (GridDhtLocalPartition part0 : parts) {
+                    if (part0.state() == RENTING)
+                        renting++;

Review comment:
       Minor, but we can break the loop as soon as we found first RENTING partition, no need to keep iteration.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org