You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/04/23 13:18:14 UTC

[ignite] 01/01: IGNITE-11796: Fix for WAL recovery stopped with 'Partition consistency failure: newPageId'

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-11796
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 6ffe429efd393ed669348675df3bc207cf62d061
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Tue Apr 23 16:17:42 2019 +0300

    IGNITE-11796: Fix for WAL recovery stopped with 'Partition consistency failure: newPageId'
---
 .../pagemem/wal/record/delta/InitNewPageRecord.java        | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
index 9ed7f35..c750d49 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
@@ -56,10 +56,18 @@ public class InitNewPageRecord extends PageDeltaRecord {
         int newPartId = PageIdUtils.partId(newPageId);
         int partId = PageIdUtils.partId(pageId);
 
-        if (newPartId != partId) {
-            throw new AssertionError("Partition consistency failure: " +
-                "newPageId=" + Long.toHexString(newPageId) + " (newPartId: " + newPartId + ") " +
+        if (newPartId == 0 && newPartId != partId) {
+            U.warn(null, "Partition consistency warning: " +
+                "newPageId=" + Long.toHexString(newPageId) + " (newPartId: 0) " +
                 "pageId=" + Long.toHexString(pageId) + " (partId: " + partId + ")");
+
+            // Partition consistency failure came from https://issues.apache.org/jira/browse/IGNITE-11030
+            // This invalid record can come from persistent stores, version < 2.7.5 where this bug was not fixed.
+            newPartId = partId; // Just hack new page ID to make this record to be correctly applied.
+            this.newPageId = PageIdUtils.pageId(
+                newPartId,
+                PageIdUtils.flag(newPageId),
+                PageIdUtils.pageIndex(newPageId));
         }
     }