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

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


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

commit d979357280b0973a5af360c4a1977d9ed5fa6088
Author: Xiaojian Zhou <[email protected]>
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 346049c..de8b384 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
@@ -70,7 +70,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();
   }
 
@@ -143,6 +144,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
@@ -170,6 +172,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
@@ -212,6 +215,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());
     }
   }
 

Reply via email to