xtern commented on a change in pull request #8846: URL: https://github.com/apache/ignite/pull/8846#discussion_r601228659
########## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/Checkpointer.java ########## @@ -713,31 +713,34 @@ public void schedulePartitionDestroy(@Nullable CacheGroupContext grpCtx, int grp /** * @param grpId Group ID. * @param partId Partition ID. + * @return {@code True} if the request to destroy the partition was canceled. */ - public void cancelOrWaitPartitionDestroy(int grpId, int partId) throws IgniteCheckedException { + public boolean cancelOrWaitPartitionDestroy(int grpId, int partId) throws IgniteCheckedException { PartitionDestroyRequest req; + boolean canceled = false; synchronized (this) { - req = scheduledCp.getDestroyQueue().cancelDestroy(grpId, partId); - } - - if (req != null) - req.waitCompleted(); + req = scheduledCp.getDestroyQueue().removeRequest(grpId, partId); - CheckpointProgressImpl cur; + if (req == null) { + CheckpointProgressImpl cur = curCpProgress; - synchronized (this) { - cur = curCpProgress; + if (cur != null) + req = cur.getDestroyQueue().removeRequest(grpId, partId); + } - if (cur != null) - req = cur.getDestroyQueue().cancelDestroy(grpId, partId); + if (req != null) + canceled = req.cancel(); } - if (req != null) - req.waitCompleted(); + if (req != null) { + if (!canceled) + req.waitCompleted(); + else if (log.isInfoEnabled()) + log.info("Partition file destroy has cancelled [grpId=" + grpId + ", partId=" + partId + "]"); Review comment: Done, thanks -- 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: us...@infra.apache.org