You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Arul Ramachandran <ar...@gmail.com> on 2015/01/02 20:07:47 UTC

While performing append operations, on region split, some of the data is lost

Hello folks,

Hbase 0.96.1.2.0.6.1

We see the following behavior.

With append operation, data gets appended as expected until existing
regions are getting populated. But as soon as hbase does a split on one of
the region as it gets to its capacity, some of the append operations which
are already submitted to hbase get impacted. Due to this some of the data
is lost evident after running get operation on appended rows. We don't see
appended data.

Is this a bug or feature? Any comments/suggestions for work around?

code snippet:
Code:
List<Row> recordsToProcess = new ArrayList<Row>();
--- Loop through below code to generate multiple Append operations:
Append appendRow = new Append(Bytes.toBytes("rowKey");
appendRow.setReturnResults(false);
for (String columnFamily : hBaseRow.getColumnValues().keySet()){
for(Entry<String, String> column :
hBaseRow.getColumnFamily(columnFamily).entrySet()){
byte[] columnFamilyName = Bytes.toBytes(columnFamily);
byte[] columnName = Bytes.toBytes(column.getKey());
byte[] columnValue = Bytes.toBytes(column.getValue());
appendRow.add(columnFamilyName, columnName, columnValue);
}
}
recordsToProcess.add(appendRow);

Object[] results = new Object[recordsToProcess.size()];
HTableInterface hTable = getHTable();
hTable.batch(recordsToProcess, results);



Regards,
Arul

Re: While performing append operations, on region split, some of the data is lost

Posted by Ted Yu <yu...@gmail.com>.
Can you pastebin log from the region server which hosted the parent region
around the time of split ?

Thanks

On Fri, Jan 2, 2015 at 11:07 AM, Arul Ramachandran <ar...@gmail.com>
wrote:

> Hello folks,
>
> Hbase 0.96.1.2.0.6.1
>
> We see the following behavior.
>
> With append operation, data gets appended as expected until existing
> regions are getting populated. But as soon as hbase does a split on one of
> the region as it gets to its capacity, some of the append operations which
> are already submitted to hbase get impacted. Due to this some of the data
> is lost evident after running get operation on appended rows. We don't see
> appended data.
>
> Is this a bug or feature? Any comments/suggestions for work around?
>
> code snippet:
> Code:
> List<Row> recordsToProcess = new ArrayList<Row>();
> --- Loop through below code to generate multiple Append operations:
> Append appendRow = new Append(Bytes.toBytes("rowKey");
> appendRow.setReturnResults(false);
> for (String columnFamily : hBaseRow.getColumnValues().keySet()){
> for(Entry<String, String> column :
> hBaseRow.getColumnFamily(columnFamily).entrySet()){
> byte[] columnFamilyName = Bytes.toBytes(columnFamily);
> byte[] columnName = Bytes.toBytes(column.getKey());
> byte[] columnValue = Bytes.toBytes(column.getValue());
> appendRow.add(columnFamilyName, columnName, columnValue);
> }
> }
> recordsToProcess.add(appendRow);
>
> Object[] results = new Object[recordsToProcess.size()];
> HTableInterface hTable = getHTable();
> hTable.batch(recordsToProcess, results);
>
>
>
> Regards,
> Arul
>