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

gokcen pushed a commit to branch 4.x
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x by this push:
     new 54ba102  PHOENIX-6055: Not matching index mutation error needs to 
report more information rather than first expected mutation
54ba102 is described below

commit 54ba102debd5fa39f5134831271d5f8b399a6720
Author: Gokcen Iskender <[email protected]>
AuthorDate: Tue Sep 22 16:02:10 2020 -0700

    PHOENIX-6055: Not matching index mutation error needs to report more 
information rather than first expected mutation
    
    Signed-off-by: Gokcen Iskender <[email protected]>
---
 .../org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
index 06a79e7..899292b 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
@@ -786,9 +786,10 @@ public class IndexRebuildRegionScanner extends 
GlobalIndexRegionScanner {
             }
             else {
                 byte[] dataKey = indexMaintainer.buildDataRowKey(new 
ImmutableBytesWritable(indexRow.getRow()), viewConstants);
-                String errorMsg = "Not matching index row";
+                String errorMsg = String.format("Not matching index row. 
expectedIndex=%d. expectedMutationSize=%d. actualIndex=%d. 
actualMutationSize=%d. expectedType=%s. actualType=%s",
+                        expectedIndex, expectedSize, actualIndex, actualSize, 
expected.getClass().getName(), (actualIndex < actualSize ? 
actual.getClass().getName() : "null"));
                 logToIndexToolOutputTable(dataKey, indexRow.getRow(),
-                        getTimestamp(expectedMutationList.get(0)), 0L, 
errorMsg, isBeforeRebuild,
+                        getTimestamp(expected), (actualIndex < actualSize ? 
getTimestamp(actual): 0L), errorMsg, isBeforeRebuild,
                     INVALID_ROW);
             }
             
verificationPhaseResult.setInvalidIndexRowCount(verificationPhaseResult.getInvalidIndexRowCount()
 + 1);

Reply via email to