You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2024/04/03 10:36:32 UTC

[PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Vladsz83 opened a new pull request, #11298:
URL: https://github.com/apache/ignite/pull/11298

   (no comment)


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549986729


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -362,6 +362,13 @@ private Map<PartitionKeyV2, PartitionHashRecordV2> checkDumpFiles(
         SnapshotHandlerContext opCtx,
         Set<File> partFiles
     ) {
+        if (F.isEmpty(partFiles)) {
+            log.info("Dump data integrity check skipped [snpName=" + opCtx.metadata().snapshotName()

Review Comment:
   snpName -> dumpName, let's also add param for "this node" - consistentId?. 
   



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549726587


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -180,6 +180,9 @@ public SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?, ?> cctx) {
             return Collections.emptyMap();
         }
 
+        if (F.isEmpty(partFiles))
+            return Collections.emptyMap();

Review Comment:
   Let's add log here, that this part is filtered, possible due to node filter



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/Dump.java:
##########
@@ -163,10 +163,12 @@ public Dump(
      * @return Standalone kernal context.
      */
     private GridKernalContext standaloneKernalContext(File dumpDir, IgniteLogger log) {
-        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), F.first(metadata).folderName());
+        SnapshotMetadata meta = metadata.stream().filter(m -> !m.partitions().isEmpty()).findFirst().orElse(F.first(metadata));

Review Comment:
   Looks overcomplicated.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549754935


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/Dump.java:
##########
@@ -163,10 +163,12 @@ public Dump(
      * @return Standalone kernal context.
      */
     private GridKernalContext standaloneKernalContext(File dumpDir, IgniteLogger log) {
-        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), F.first(metadata).folderName());
+        SnapshotMetadata meta = metadata.stream().filter(m -> !m.partitions().isEmpty()).findFirst().orElse(F.first(metadata));
+
+        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), meta.folderName());
         File marshaller = new File(dumpDir, DFLT_MARSHALLER_PATH);
 
-        A.ensure(binaryMeta.exists(), "binary metadata directory not exists");
+        A.ensure(meta.partitions().isEmpty() || binaryMeta.exists(), "binary metadata directory not exists");

Review Comment:
   If meta.partitions() is empty, it means dump doesn't have partitions at all - it looks like an error, let's throw exception instead



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549492084


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -362,6 +362,9 @@ private Map<PartitionKeyV2, PartitionHashRecordV2> checkDumpFiles(
         SnapshotHandlerContext opCtx,
         Set<File> partFiles
     ) {
+        if (F.isEmpty(partFiles))

Review Comment:
   Fixed but works wierd. Snapshot contains meta. It is a partition but might be ignored too



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1550053784


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -362,6 +362,13 @@ private Map<PartitionKeyV2, PartitionHashRecordV2> checkDumpFiles(
         SnapshotHandlerContext opCtx,
         Set<File> partFiles
     ) {
+        if (F.isEmpty(partFiles)) {
+            log.info("Dump data integrity check skipped [snpName=" + opCtx.metadata().snapshotName()

Review Comment:
   Thought about it. All the other code uses 'snp' and 'snapshot' for dumps. But ok
   



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549754935


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/Dump.java:
##########
@@ -163,10 +163,12 @@ public Dump(
      * @return Standalone kernal context.
      */
     private GridKernalContext standaloneKernalContext(File dumpDir, IgniteLogger log) {
-        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), F.first(metadata).folderName());
+        SnapshotMetadata meta = metadata.stream().filter(m -> !m.partitions().isEmpty()).findFirst().orElse(F.first(metadata));
+
+        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), meta.folderName());
         File marshaller = new File(dumpDir, DFLT_MARSHALLER_PATH);
 
-        A.ensure(binaryMeta.exists(), "binary metadata directory not exists");
+        A.ensure(meta.partitions().isEmpty() || binaryMeta.exists(), "binary metadata directory not exists");

Review Comment:
   If meta.partitions() is empty, it means dump doesn't have partitions at all - it looks like a bug.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 closed pull request #11298: IGNITE-21656 :  Cache dump fails on a cache with a node filter. V3
URL: https://github.com/apache/ignite/pull/11298


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549466623


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -362,6 +362,9 @@ private Map<PartitionKeyV2, PartitionHashRecordV2> checkDumpFiles(
         SnapshotHandlerContext opCtx,
         Set<File> partFiles
     ) {
+        if (F.isEmpty(partFiles))

Review Comment:
   It looks like this condition should be outside of the method. If param is empty then no need to check them?



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549492084


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -362,6 +362,9 @@ private Map<PartitionKeyV2, PartitionHashRecordV2> checkDumpFiles(
         SnapshotHandlerContext opCtx,
         Set<File> partFiles
     ) {
+        if (F.isEmpty(partFiles))

Review Comment:
   Fixed but works wierd. A snapshot may contain meta. It is a partition but might be ignored too later, not in current `if`.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21656 : Cache dump fails on a cache with a node filter. V3 [ignite]

Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11298:
URL: https://github.com/apache/ignite/pull/11298#discussion_r1549753857


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/Dump.java:
##########
@@ -163,10 +163,12 @@ public Dump(
      * @return Standalone kernal context.
      */
     private GridKernalContext standaloneKernalContext(File dumpDir, IgniteLogger log) {
-        File binaryMeta = CacheObjectBinaryProcessorImpl.binaryWorkDir(dumpDir.getAbsolutePath(), F.first(metadata).folderName());
+        SnapshotMetadata meta = metadata.stream().filter(m -> !m.partitions().isEmpty()).findFirst().orElse(F.first(metadata));

Review Comment:
   Use F.view() instead



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org