Skip to content

Commit

Permalink
PHOENIX-6055: Not matching index mutation error needs to report more …
Browse files Browse the repository at this point in the history
…information rather than first expected mutation
  • Loading branch information
gokceni committed Sep 22, 2020
1 parent f5cc0ad commit 4c7beb2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public boolean verifySingleIndexRow(Result indexRow, IndexToolVerificationResult
int actualSize = actualMutationList.size();
Mutation expected = null;
Mutation previousExpected;
Mutation actual;
Mutation actual = null;
while (expectedIndex < expectedSize && actualIndex <actualSize) {
previousExpected = expected;
expected = expectedMutationList.get(expectedIndex);
Expand Down Expand Up @@ -768,7 +768,8 @@ public boolean verifySingleIndexRow(Result indexRow, IndexToolVerificationResult
}
} else {
byte[] dataKey = indexMaintainer.buildDataRowKey(new ImmutableBytesWritable(indexRow.getRow()), viewConstants);
String errorMsg = "Not matching index row";
String errorMsg = String.format("Not matching index row. matchingCount=0. expectedIndex=%d. expectedMutationSize=%d. actualIndex=%d. actualMutationSize=%d. expectedTs=%d. actualTs=%d",
expectedIndex, expectedSize, actualIndex, actualSize, (expected == null ? 0:getTimestamp(expected)), (actual == null ? 0: getTimestamp(actual)));
logToIndexToolOutputTable(dataKey, indexRow.getRow(),
getTimestamp(expectedMutationList.get(0)), 0L, errorMsg);
verificationPhaseResult.setInvalidIndexRowCount(verificationPhaseResult.getInvalidIndexRowCount() + 1);
Expand Down

0 comments on commit 4c7beb2

Please sign in to comment.