Vladsz83 commented on code in PR #13686:
URL: https://github.com/apache/ignite/pull/13686#discussion_r4348320950


##########
modules/core/src/main/java/org/apache/ignite/internal/management/cache/VerifyBackupPartitionsTask.java:
##########
@@ -499,28 +507,38 @@ private Future<Map<PartitionKey, PartitionHashRecord>> 
calculatePartitionHashAsy
                     PartitionUpdateCounter updateCntrBefore = updCntr == null 
? null : updCntr.copy();
 
                     if (arg.checkCrc() && gctx.persistenceEnabled()) {
-                        FilePageStoreManager pageStoreMgr =
-                            
(FilePageStoreManager)ignite.context().cache().context().pageStore();
+                        FilePageStoreManager pageStoreMgr = 
(FilePageStoreManager)ignite.context().cache().context().pageStore();
 
                         checkPartitionsPageCrcSum(
                             () -> 
(FilePageStore)pageStoreMgr.getStore(gctx.groupId(), part.id()),
                             part.id(),
                             FLAG_DATA,
-                            cancelled
+                            () -> checkCancelledOrStopped(cancelled, gctx, 
false)
                         );
                     }
 
                     PartitionKey key = new PartitionKey(gctx.groupId(), 
part.id(), gctx.cacheOrGroupName());
 
-                    PartitionHashRecord hash = calculatePartitionHash(key,
-                        updateCntrBefore == null ? 0 : 
updateCntrBefore.comparableState(),
-                        
ignite.context().discovery().localNode().consistentId(),
-                        part.state(),
-                        part.primary(gctx.topology().readyTopologyVersion()),
-                        part.dataStore().fullSize(),
-                        gctx.offheap().partitionIterator(part.id()),
-                        cancelled
-                    );
+                    PartitionHashRecord hash;
+
+                    // The cache group can be destroyed concurrently.
+                    if (!gctx.offheap().enterBusy())
+                        throw cancellationException();
+
+                    try {
+                        hash = calculatePartitionHash(
+                            key,
+                            updateCntrBefore == null ? 0 : 
updateCntrBefore.comparableState(),
+                            
ignite.context().discovery().localNode().consistentId(),
+                            part.state(),
+                            
part.primary(gctx.topology().readyTopologyVersion()),
+                            part.dataStore().fullSize(),
+                            gctx.offheap().partitionIterator(part.id()),
+                            () -> checkCancelledOrStopped(cancelled, gctx, 
false)
+                        );
+                    } finally {

Review Comment:
   Done. Hm. The checkstyle seems passed. Or I forgot to run it.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to