phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PHOENIX-5289) IndexRebuildTaskIT fails with HBase 1.5.x
Date Mon, 20 May 2019 22:29:00 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16844329#comment-16844329
] 

Lars Hofhansl edited comment on PHOENIX-5289 at 5/20/19 10:28 PM:
------------------------------------------------------------------

Looks like this is abusing the KeyValue class. The byte[] passed does not represent a proper
KV, yet, it is needed, it seems, as is later in the process.

Quick fix (just do what super(...) would have done):
{code:java}
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
index f01dc06..1397849 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
@@ -53,7 +53,9 @@ public class IndexedKeyValue extends KeyValue {
     public IndexedKeyValue() {}
 
     public IndexedKeyValue(byte[] bs, Mutation mutation) {
-        super(mutation.getRow(), 0, mutation.getRow().length);
+        this.bytes = mutation.getRow();
+        this.offset = 0;
+        this.length = mutation.getRow().length;
         this.indexTableName = new ImmutableBytesPtr(bs);
         this.mutation = mutation;
         this.hashCode = calcHashCode(indexTableName, mutation);
{code}
Even when I fix that, there is another problem with HBase 1.5.0 it seems. (The index rebuild
never progresses to the "COMPLETED" stage.) This seems to be another problem, so I'd like
to commit this change here.


was (Author: lhofhansl):
Looks like this is abusing the KeyValue class. The byte[] passed does not represent a proper
KV, yet, it is needed, it seems, as is later in the process.

Quick fix (just do what super(...) would have done):
{code}
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
index f01dc06..1397849 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/wal/IndexedKeyValue.java
@@ -53,7 +53,9 @@ public class IndexedKeyValue extends KeyValue {
     public IndexedKeyValue() {}
 
     public IndexedKeyValue(byte[] bs, Mutation mutation) {
-        super(mutation.getRow(), 0, mutation.getRow().length);
+        this.bytes = mutation.getRow();
+        this.offset = 0;
+        this.length = mutation.getRow().length;
         this.indexTableName = new ImmutableBytesPtr(bs);
         this.mutation = mutation;
         this.hashCode = calcHashCode(indexTableName, mutation);
{code}

Even when I fix that, there is another problem with HBase 1.5.0 it seems.


> IndexRebuildTaskIT fails with HBase 1.5.x
> -----------------------------------------
>
>                 Key: PHOENIX-5289
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5289
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.15.0
>            Reporter: Lars Hofhansl
>            Priority: Major
>
> {code}
> [INFO] Running org.apache.phoenix.end2end.IndexRebuildTaskIT
> [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 74.425 s <<<
FAILURE! - in org.apache.phoenix.end2end.IndexRebuildTaskIT
> [ERROR] testIndexRebuildTask(org.apache.phoenix.end2end.IndexRebuildTaskIT)  Time elapsed:
24.307 s  <<< ERROR!
> org.apache.phoenix.execute.CommitException: 
> org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 1 action:
org.apache.phoenix.hbase.index.builder.IndexBuildingFailureException: Failed to build index
for unexpected reason!
> 	at org.apache.phoenix.hbase.index.util.IndexManagementUtil.rethrowIndexingException(IndexManagementUtil.java:198)
> 	at org.apache.phoenix.hbase.index.Indexer.preBatchMutate(Indexer.java:348)
> 	at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$35.call(RegionCoprocessorHost.java:1024)
> 	at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1729)
> 	at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1814)
> 	at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1770)
> 	at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.preBatchMutate(RegionCoprocessorHost.java:1020)
> 	at org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:3401)
> 	at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:3148)
> 	at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:3090)
> 	at org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:944)
> 	at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:872)
> 	at org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2466)
> 	at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:36621)
> 	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2380)
> 	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124)
> 	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:297)
> 	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:277)
> Caused by: java.lang.IllegalArgumentException: Invalid key length in KeyValue. keyLength=0,
KeyValueBytesHex=\x00\x00\x00\x00\x00\x00\x00\x00tenant1\x00y\x000, offset=0, length=19
> 	at org.apache.hadoop.hbase.KeyValueUtil.checkKeyValueBytes(KeyValueUtil.java:605)
> 	at org.apache.hadoop.hbase.KeyValue.<init>(KeyValue.java:359)
> 	at org.apache.phoenix.hbase.index.wal.IndexedKeyValue.<init>(IndexedKeyValue.java:56)
> 	at org.apache.phoenix.hbase.index.Indexer.preBatchMutateWithExceptions(Indexer.java:534)
> 	at org.apache.phoenix.hbase.index.Indexer.preBatchMutate(Indexer.java:345)
> 	... 16 more
> ...
> at org.apache.phoenix.end2end.IndexRebuildTaskIT.testIndexRebuildTask(IndexRebuildTaskIT.java:112)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message