This is an automated email from the ASF dual-hosted git repository.
nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new f9fb5c7debe IGNITE-25496 Fix snapshot restore failure due to
non-serializable cache group names collection (#12100)
f9fb5c7debe is described below
commit f9fb5c7debe5af7a97dc1dd8aa463234cf95d0e1
Author: Vladislav Novikov <[email protected]>
AuthorDate: Wed May 28 11:44:25 2025 +0300
IGNITE-25496 Fix snapshot restore failure due to non-serializable cache
group names collection (#12100)
---
.../snapshot/SnapshotRestoreProcess.java | 2 +-
.../IgniteClusterSnapshotRestoreSelfTest.java | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
index 6bd6cac05b2..ff3cde20e74 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
@@ -401,7 +401,7 @@ public class SnapshotRestoreProcess {
F.first(dataNodes),
snpName,
snpPath,
- cacheGrpNames,
+ cacheGrpNames == null ? null : new HashSet<>(cacheGrpNames),
new HashSet<>(bltNodes),
false,
incIdx,
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java
index 090a6c0fe44..abf5413f2fa 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java
@@ -19,10 +19,13 @@ package
org.apache.ignite.internal.processors.cache.persistence.snapshot;
import java.io.File;
import java.io.IOException;
+import java.io.Serializable;
import java.nio.file.OpenOption;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -818,6 +821,24 @@ public class IgniteClusterSnapshotRestoreSelfTest extends
IgniteClusterSnapshotR
assertCacheKeys(ign.cache(DEFAULT_CACHE_NAME), keysCnt);
}
+ /**
+ * @throws Exception if failed.
+ */
+ @Test
+ public void testNonSerializableCacheGroupsRestore() throws Exception {
+ int keysCnt = dfltCacheCfg.getAffinity().partitions();
+
+ Ignite ignite = startGridsWithSnapshot(1, keysCnt, false, true);
+
+ Collection<String> grpsAsKeySet = Map.of(DEFAULT_CACHE_NAME,
0).keySet();
+
+ assertFalse(grpsAsKeySet instanceof Serializable);
+
+ ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME,
grpsAsKeySet).get(TIMEOUT);
+
+ assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), keysCnt);
+ }
+
/**
* @param state Cluster state.
* @param procType The type of distributed process on which communication
is blocked.