You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2021/11/23 17:53:30 UTC

[geode] branch support/1.14 updated: GEODE-9838: Log key info for deserialization issue while index update (#7136)

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

zhouxj pushed a commit to branch support/1.14
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.14 by this push:
     new fd3672e  GEODE-9838: Log key info for deserialization issue while index update (#7136)
fd3672e is described below

commit fd3672e2ac902a9851ff2daa6c3180541d3f7ff0
Author: Xiaojian Zhou <ge...@users.noreply.github.com>
AuthorDate: Tue Nov 23 09:22:19 2021 -0800

    GEODE-9838: Log key info for deserialization issue while index update (#7136)
    
    (cherry picked from commit f56d60a6227fc46fbf3e8f3f5ba48d8be453e69e)
---
 .../cache/query/internal/index/IndexManagerIntegrationTest.java     | 6 +++++-
 .../org/apache/geode/cache/query/internal/index/IndexManager.java   | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexManagerIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexManagerIntegrationTest.java
index 42ebb3a..e89351c 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexManagerIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexManagerIntegrationTest.java
@@ -71,7 +71,8 @@ public class IndexManagerIntegrationTest {
     TestQueryObject.throwException = false;
 
     logFile = temporaryFolder.newFile(testName.getMethodName() + ".log");
-    serverStarterRule.withProperty("log-file", logFile.getAbsolutePath()).startServer();
+    serverStarterRule.withProperty("log-file", logFile.getAbsolutePath())
+        .withProperty("log-level", "debug").startServer();
     internalCache = serverStarterRule.getCache();
   }
 
@@ -144,6 +145,7 @@ public class IndexManagerIntegrationTest {
         .contains(String.format(
             "Updating the Index %s failed. The index is corrupted and marked as invalid.",
             indexName));
+    LogFileAssert.assertThat(logFile).contains("Corrupted key is " + newKey);
   }
 
   @Test
@@ -171,6 +173,7 @@ public class IndexManagerIntegrationTest {
         .contains(String.format(
             "Updating the Index %s failed. The index is corrupted and marked as invalid.",
             indexName));
+    LogFileAssert.assertThat(logFile).contains("Corrupted key is " + existingKey);
   }
 
   @Test
@@ -213,6 +216,7 @@ public class IndexManagerIntegrationTest {
         .contains(String.format(
             "Updating the Index %s failed. The index is corrupted and marked as invalid.",
             indexName));
+    LogFileAssert.assertThat(logFile).contains("Corrupted key is " + existingKey);
   }
 
   private static class TestQueryObject implements Serializable {
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
index fa8db50..7fbfe17 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
@@ -1157,6 +1157,7 @@ public class IndexManager {
       logger.warn(String.format(
           "Updating the Index %s failed. The index is corrupted and marked as invalid.",
           ((AbstractIndex) index).indexName), exception);
+      logger.debug("Corrupted key is " + entry.getKey());
     }
   }
 
@@ -1169,6 +1170,7 @@ public class IndexManager {
       logger.warn(String.format(
           "Updating the Index %s failed. The index is corrupted and marked as invalid.",
           ((AbstractIndex) index).indexName), exception);
+      logger.debug("Corrupted key is " + entry.getKey());
     }
   }