hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chia-Ping Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18471) Deleted qualifier re-appearing after multiple puts.
Date Wed, 02 Aug 2017 13:16:00 GMT

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

Chia-Ping Tsai commented on HBASE-18471:
----------------------------------------

We add a cell without qualifier for deleting all columns of the specified family.
{code}
  public Delete addFamily(final byte [] family, final long timestamp) {
    if (timestamp < 0) {
      throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp);
    }
    List<Cell> list = familyMap.get(family);
    if(list == null) {
      list = new ArrayList<>(1);
    } else if(!list.isEmpty()) {
      list.clear();
    }
    KeyValue kv = new KeyValue(row, family, null, timestamp, KeyValue.Type.DeleteFamily);
    list.add(kv);
    familyMap.put(family, list);
    return this;
  }
{code}

The *hint cell* created by CellUtil.createLastOnRowCol force the KVScanner to skip the remaining
cells which have the same family/qualifier with *hint cell*
{code}
  public Cell getKeyForNextColumn(Cell cell) {
    ColumnCount nextColumn = columns.getColumnHint();
    if (nextColumn == null) {
      return CellUtil.createLastOnRowCol(cell);
    } else {
      return CellUtil.createFirstOnRowCol(cell, nextColumn.getBuffer(), nextColumn.getOffset(),
        nextColumn.getLength());
    }
  }
{code}



> Deleted qualifier re-appearing after multiple puts.
> ---------------------------------------------------
>
>                 Key: HBASE-18471
>                 URL: https://issues.apache.org/jira/browse/HBASE-18471
>             Project: HBase
>          Issue Type: Bug
>          Components: Deletes, hbase, scan
>    Affects Versions: 3.0.0, 1.3.0, 1.3.1, 2.0.0-alpha-1
>            Reporter: Thomas Martens
>            Priority: Critical
>         Attachments: HBaseDmlTest.java
>
>
> The qualifier of a deleted row (with keep deleted cells true) re-appears after re-inserting
the same row multiple times (with different timestamp) with an empty qualifier.
> Scenario:
> # Put row with family and qualifier (timestamp 1).
> # Delete entire row (timestamp 2).
> # Put same row again with family without qualifier (timestamp 3).
> A scan (latest version) returns the row with family without qualifier, version 3 (which
is correct).
> # Put the same row again with family without qualifier (timestamp 4).
> A scan (latest version) returns multiple rows:
> * the row with family without qualifier, version 4 (which is correct).
> * the row with family with qualifier, version 1 (which is wrong).
> There is a test scenario attached.
> output:
> <LOG> 13:42:53,952 [main] client.HBaseAdmin - Started disable of test_dml
> <LOG> 13:42:55,801 [main] client.HBaseAdmin - Disabled test_dml
> <LOG> 13:42:57,256 [main] client.HBaseAdmin - Deleted test_dml
> <LOG> 13:42:58,592 [main] client.HBaseAdmin - Created test_dml
> Put row: 'myRow' with family: 'myFamily' with qualifier: 'myQualifier' with timestamp:
'1'
> Scan printout =>
>   Row: 'myRow', Timestamp: '1', Family: 'myFamily', Qualifier: 'myQualifier', Value:
'myValue'
> Delete row: 'myRow'
> Scan printout =>
> Put row: 'myRow' with family: 'myFamily' with qualifier: 'null' with timestamp: '3'
> Scan printout =>
>   Row: 'myRow', Timestamp: '3', Family: 'myFamily', Qualifier: '', Value: 'myValue'
> Put row: 'myRow' with family: 'myFamily' with qualifier: 'null' with timestamp: '4'
> Scan printout =>
>   Row: 'myRow', Timestamp: '4', Family: 'myFamily', Qualifier: '', Value: 'myValue'
>   {color:red}Row: 'myRow', Timestamp: '1', Family: 'myFamily', Qualifier: 'myQualifier',
Value: 'myValue'{color}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message