alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r392251721
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFutureTask.java
 ##########
 @@ -359,36 +354,100 @@ public void start() {
             return;
 
         try {
-            Map<GroupPartitionId, GridDhtPartitionState> missed = new 
HashMap<>();
-
-            for (GroupPartitionId pair : parts) {
-                GridDhtPartitionState partState = pair.getPartitionId() == 
INDEX_PARTITION ? GridDhtPartitionState.OWNING :
-                    cctx.cache()
-                        .cacheGroup(pair.getGroupId())
-                        .topology()
-                        .localPartition(pair.getPartitionId())
-                        .state();
-
-                // Partition can be reserved.
-                // Partition can be MOVING\RENTING states.
-                // Index partition will be excluded if not all partition 
OWNING.
-                // There is no data assigned to partition, thus it haven't 
been created yet.
-                if (partState != GridDhtPartitionState.OWNING) {
-                    missed.put(pair, partState);
-
-                    continue;
+            for (Map.Entry<Integer, Set<Integer>> e : parts.entrySet()) {
+                int grpId = e.getKey();
+                Set<Integer> grpParts = e.getValue();
+
+                GridDhtPartitionTopology top = 
cctx.cache().cacheGroup(grpId).topology();
+
+                Iterator<GridDhtLocalPartition> iter;
+
+                if (e.getValue() == null)
+                    iter = top.currentLocalPartitions().iterator();
+                else {
+                    if (grpParts.contains(INDEX_PARTITION)) {
+                        throw new IgniteCheckedException("Index partition 
cannot be included into snapshot if " +
+                            " set of cache group partitions has been 
explicitly provided [grpId=" + grpId + ']');
+                    }
+
+                    iter = new Iterator<GridDhtLocalPartition>() {
 
 Review comment:
   `iter = F.iterator(grpParts, partId -> top.localPartition(partId), false);`

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


With regards,
Apache Git Services

Reply via email to