From 62fb22a0b305bb4bf25ae818f4a72d680fcaa48d Mon Sep 17 00:00:00 2001 From: Gokcen Iskender Date: Tue, 22 Sep 2020 16:02:10 -0700 Subject: [PATCH] PHOENIX-6055: Not matching index mutation error needs to report more information rather than first expected mutation --- .../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 621c8bd2174..f428543a4c8 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 @@ -785,9 +785,10 @@ public boolean verifySingleIndexRow(Result indexRow, Map> } 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);