You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Pankaj Birat <pa...@gmail.com> on 2018/12/20 07:28:35 UTC

Getting old value for the cell after TTL expiry of latest value cell value set with TTL.

Hi,

I am using HBase version 1.2.7

Getting old value for the cell after TTL expiry of latest cell value set
with TTL.

Table:

COLUMN FAMILIES DESCRIPTION

{NAME => 'data', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY =>
'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL
=> 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE =>
'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '1'}

First time I am putting cell value without TTL and second time I am puting
value with TTL.

Eg command sequencee

> put 'sepTest', '18', 'data:value', '18'

> flush 'sepTest'

> get 'sepTest', '18'

value : 18

> put 'sepTest', '18', 'data:value', 'update_18', {TTL => 100000}

> get 'sepTest', '18'

value : update_18

>  flush 'sepTest'

> get 'sepTest', '18'

value : update_18

after around TTL expiry ( 100000 )

> get 'sepTest', '18'

value : 18

> major_compact 'sepTest'

Since my max version is set to 1, I am not able to understand why I am
getting value 18?

As per my understanding in the second put with TTL should have overridden
the old value and after the expiry of second put, I should not get any
value.

Attaching screenshot for reference.

Re: Getting old value for the cell after TTL expiry of latest value cell value set with TTL.

Posted by Wellington Chevreuil <we...@gmail.com>.
I believe this is the same issue as when deleting with specific timestamp
(HBASE-21596). The scanner triggered during flush will let the 1st version
go through because it's still the only version at that time. The second
flush will make the second version (with TTL) to also go through. TTL
expiration will then put a delete marker. However, the scanner
implementations seem to have a problem when counting deleted cells and
versions. In this situation, there are actually two cell versions on the
store. The latest one is deleted, so the scanner will correctly mark it as
deleted, but will not increase it's version counter for that cell. Then
when it get's to the older version, it's not deleted and because it had not
increased the version counter before, it will (erroneously) allow it to go
through. More details on HBASE-21596.

If you try the following sequence:

> put 'sepTest', '18', 'data:value', '18'

> put 'sepTest', '18', 'data:value', 'update_18', {TTL => 100000}

> flush 'sepTest'
That would cause only second version to be flushed. After TTL expiration,
your get would not return any value. This is because the scan ran during
flush only allowed the second version to go through.

Em qui, 20 de dez de 2018 às 17:06, Pankaj Birat <pa...@gmail.com>
escreveu:

> Hi,
>
> I am using HBase version 1.2.7
>
> Getting old value for the cell after TTL expiry of latest cell value set
> with TTL.
>
> Table:
>
> COLUMN FAMILIES DESCRIPTION
>
> {NAME => 'data', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY =>
> 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL
> => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE =>
> 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '1'}
>
> First time I am putting cell value without TTL and second time I am puting
> value with TTL.
>
> Eg command sequencee
>
> > put 'sepTest', '18', 'data:value', '18'
>
> > flush 'sepTest'
>
> > get 'sepTest', '18'
>
> value : 18
>
> > put 'sepTest', '18', 'data:value', 'update_18', {TTL => 100000}
>
> > get 'sepTest', '18'
>
> value : update_18
>
> >  flush 'sepTest'
>
> > get 'sepTest', '18'
>
> value : update_18
>
> after around TTL expiry ( 100000 )
>
> > get 'sepTest', '18'
>
> value : 18
>
> > major_compact 'sepTest'
>
> Since my max version is set to 1, I am not able to understand why I am
> getting value 18?
>
> As per my understanding in the second put with TTL should have overridden
> the old value and after the expiry of second put, I should not get any
> value.
>
> Attaching screenshot for reference.
>