OpenTSDB / asynchbase

A fully asynchronous, non-blocking, thread-safe, high-performance HBase client.
https://github.com/OpenTSDB/asynchbase
BSD 3-Clause "New" or "Revised" License
609 stars 303 forks source link

MultiAction fails on 0.92.0 #17

Closed ylangisc closed 12 years ago

ylangisc commented 12 years ago

Using the HEAD revision I get deserialization exception on the server side (HBase 0.92.0) for MultiAction operations with DeleteRequests. E.g.

2012-02-19 16:21:30,799 [IPC Reader 8 on port 57026] WARN  org.apache.hadoop.ipc.HBaseServer - Unable to read call parameters for client 192.168.1.115
java.io.IOException: Error in readFields
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:586)
    at org.apache.hadoop.hbase.ipc.Invocation.readFields(Invocation.java:125)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Connection.processData(HBaseServer.java:1238)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Connection.readAndProcess(HBaseServer.java:1167)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.doRead(HBaseServer.java:703)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.doRunLoop(HBaseServer.java:495)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Listener$Reader.run(HBaseServer.java:470)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.IOException: Error in readFields
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:586)
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:503)
    at org.apache.hadoop.hbase.client.MultiAction.readFields(MultiAction.java:116)
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:583)
    ... 9 more
Caused by: java.io.IOException: Error in readFields
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:586)
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:503)
    at org.apache.hadoop.hbase.client.Action.readFields(Action.java:101)
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:583)
    ... 12 more
Caused by: java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:375)
    at org.apache.hadoop.io.WritableUtils.readString(WritableUtils.java:113)
    at org.apache.hadoop.hbase.client.OperationWithAttributes.readAttributes(OperationWithAttributes.java:101)
    at org.apache.hadoop.hbase.client.Delete.readFields(Delete.java:262)
    at org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:583)
    ... 15 more
tsuna commented 12 years ago

Interesting, it looks like the RegionServer is trying to deserialize attributes, but asynchbase doesn't send any, so that shouldn't happen.

The good news is that I can reproduce this, so the fix should be easy.

tsuna commented 12 years ago

Thanks for the bug report, this is fixed by stumbleupon/asynchbase@7100f8af7bb9a89e9eab61759b308e9c9aabe637

It was a stupid mistake due to the fact that, surprisingly, I never tested a multi RPC composed solely of DeleteRequest. I always had a mix of DeleteRequest and PutRequest.

ylangisc commented 12 years ago

Thanks for the quick fix. I'm just going to test it.

On Feb 21, 2012, at 8:25 AM, Benoit Sigoure wrote:

Thanks for the bug report, this is fixed by stumbleupon/asynchbase@7100f8af7bb9a89e9eab61759b308e9c9aabe637

It was a stupid mistake due to the fact that, surprisingly, I never tested a multi RPC composed solely of DeleteRequest. I always had a mix of DeleteRequest and PutRequest.


Reply to this email directly or view it on GitHub: https://github.com/stumbleupon/asynchbase/issues/17#issuecomment-4070268

ylangisc commented 12 years ago

There seems to be another issue while serializing a MultiAction:

2012-02-21 09:10:56,691 [Hashed wheel timer #1] ERROR org.hbase.async.RegionClient - Uncaught exception while serializing RPC: MultiAction(batch=[DeleteRequest(table="combined", key=[105, 40, 52, -7, 0, 20, 0, 40, 0, 0, 7, -37, 0, 0, 20, 0, 0, 17], family="", qualifiers=[""], attempt=1, region=RegionInfo(table="combined", region_name="combined,,1329815372745.c2db59a7b6d03d18ba5a6bb5b121e1ea.", stop_key="")), DeleteRequest(table="daily", key=[105, 40, 52, -7, 0, 20, 0, 0, 7, -37, 0, 0, 20], family="", qualifiers=[""], attempt=1, region=RegionInfo(table="daily", region_name="daily,,1329815370711.710c0961e6a4da8db3ac2aac6553bafa.", stop_key=""))]) java.lang.ArrayIndexOutOfBoundsException: -1 at org.jboss.netty.buffer.BigEndianHeapChannelBuffer.setInt(BigEndianHeapChannelBuffer.java:103) at org.hbase.async.MultiAction.serialize(MultiAction.java:363) at org.hbase.async.RegionClient.encode(RegionClient.java:997) at org.hbase.async.RegionClient.sendRpc(RegionClient.java:750) at org.hbase.async.RegionClient.periodicFlush(RegionClient.java:236) at org.hbase.async.RegionClient.access$000(RegionClient.java:82) at org.hbase.async.RegionClient$1.run(RegionClient.java:174) at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:521) at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440) at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at java.lang.Thread.run(Thread.java:662)

tsuna commented 12 years ago

Can you open a new issue please?

tsuna commented 12 years ago

It appears that you're trying to use an empty column family name. I don't think HBase supports it. I'll check with HBase devs today. If it's not allowed, I'll have asynchbase throw an exception back.

ylangisc commented 12 years ago

I use following method

public DeleteRequest(final byte[] table, final byte[] key) {
    this(table, key, null, null, KeyValue.TIMESTAMP_NOW, RowLock.NO_LOCK);
}

Using this method you set the family to

static final byte[] WHOLE_ROW = new byte[0];