NSAmelchev commented on a change in pull request #7941:
URL: https://github.com/apache/ignite/pull/7941#discussion_r455033667



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java
##########
@@ -676,6 +962,100 @@ public void onCacheGroupDestroyed(int grpId) {
         removeGroupKey(grpId);
     }
 
+    /**
+     * @param grpId Cache group ID.
+     * @param partId Partition ID.
+     */
+    public void onDestroyPartitionStore(int grpId, int partId) {
+        try {
+            pageScan.cancel(grpId, partId);
+
+            setEncryptionState(grpId, partId, 0, 0);
+        }
+        catch (IgniteCheckedException e) {
+            log.warning("Unable to cancel reencryption [grpId=" + grpId + ", 
partId=" + partId + "]", e);
+        }
+    }
+
+    /**
+     * Callabck when WAL segment is removed.
+     *
+     * @param segmentIdx WAL segment index.
+     */
+    public void onWalSegmentRemoved(long segmentIdx) {
+        Map<Integer, Set<Integer>> rmvKeys = removeWalSegments(segmentIdx);
+
+        if (rmvKeys == null)
+            return;
+
+        synchronized (metaStorageMux) {
+            try {
+                writeToMetaStore(0, false, true);
+
+                for (Map.Entry<Integer, Set<Integer>> entry : 
rmvKeys.entrySet()) {
+                    int grpId = entry.getKey();
+
+                    if (reencryptGroups.containsKey(grpId))
+                        continue;
+
+                    Set<Integer> keyIds = entry.getValue();
+
+                    boolean rmv = removeKeysById(grpEncKeys.get(grpId), 
keyIds);
+
+                    assert rmv : keyIds;
+
+                    writeToMetaStore(grpId, true, false);

Review comment:
       Seems, it should be under master key change read lock




----------------------------------------------------------------
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:
[email protected]


Reply via email to