You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by mukund murrali <mu...@gmail.com> on 2015/10/15 12:45:59 UTC
HBase versions problem
Hi
I am using hbase-1.0. I had two column families C1 and C2.
C1 => 'VERSIONS => 1, MIN_VERSIONS => 0 (default)
C2 => 'VERSIONS' => 1, MIN_VERSIONS => 1
I inserted two versions as follows
put 'test','ro1','C1:col1,'value1'
put 'test','ro1','C2:col1,'value1'
put 'test','ro1','C1:col1,'value2'
put 'test','ro1','C2:col1,'value2'
I did a delete using java API with addColumn ( not Columns) for both C1 and
C2 column families. On a get call I got the result as
C1:col1 timestamp=1444904709797,value=value1
C2:col1 timestamp=1444904695656, value=value1
on doing a *flush* on the table, the C2 data got vanished and subsequent
get call returned with first version of C1.
C1:col1 timestamp=1444904709797,value=value1
On deeper analysis, we found that a flush before delete will purge both of
those data.
My question is with MIN_VERSIONS => 0 and VERSIONS => 1, why does the
second version gets promoted during deletion and does not get removed even
after flush?
In other words with VERSIONS =>1 , why should the earlier versions be
stored?
Also with MIN_VERSIONS => 1 and VERSIONS => 1, though the second version
promoted but subsequent flush purged it.
Is this an inconsistency or my understanding is wrong?
Thanks
Regards
Mukund Murrali
Re: HBase versions problem
Posted by mukund murrali <mu...@gmail.com>.
Ya thanks Ram. With VERSIONS => 1 it means max versions? If yes, why should
the old value be stored when there is a latest version.
Thanks
Regards
Mukund Murrali
On Fri, Oct 16, 2015 at 1:40 PM, ramkrishna vasudevan <
ramkrishna.s.vasudevan@gmail.com> wrote:
> With VERSIONS=>1 and MIN_VERSIONS=0, I think the intended behaviour is to
> always have the current version as the one to be returned. So in your cases
> you inserted two cells at different timestamp. But the Delete with
> addColumn will always try to delete the latest version. So in this case
> the latest version happens to be the value 2 version. Hence for C1 that
> value got masked and whether u do the flush or not you always end up in the
> value 1 cell. (ie the first one).
>
> Coming to the family 2 where you want atleast one version to be maintained
> . I need to check the code more thoroughly to determine the behaviour
> difference between flush and no flush.
>
> REgards
> Ram
>
> On Fri, Oct 16, 2015 at 1:05 PM, mukund murrali <mu...@gmail.com>
> wrote:
>
> > Can anyone enlighten why this is happening. This is causing problems in
> our
> > production.
> >
> > On Thu, Oct 15, 2015 at 4:15 PM, mukund murrali <
> mukundmurrali9@gmail.com>
> > wrote:
> >
> > > Hi
> > >
> > > I am using hbase-1.0. I had two column families C1 and C2.
> > >
> > > C1 => 'VERSIONS => 1, MIN_VERSIONS => 0 (default)
> > > C2 => 'VERSIONS' => 1, MIN_VERSIONS => 1
> > >
> > > I inserted two versions as follows
> > > put 'test','ro1','C1:col1,'value1'
> > > put 'test','ro1','C2:col1,'value1'
> > >
> > >
> > > put 'test','ro1','C1:col1,'value2'
> > > put 'test','ro1','C2:col1,'value2'
> > >
> > > I did a delete using java API with addColumn ( not Columns) for both C1
> > > and C2 column families. On a get call I got the result as
> > >
> > > C1:col1 timestamp=1444904709797,value=value1
> > >
> > > C2:col1 timestamp=1444904695656,
> value=value1
> > >
> > > on doing a *flush* on the table, the C2 data got vanished and
> subsequent
> > > get call returned with first version of C1.
> > >
> > > C1:col1 timestamp=1444904709797,value=value1
> > >
> > > On deeper analysis, we found that a flush before delete will purge both
> > of
> > > those data.
> > >
> > > My question is with MIN_VERSIONS => 0 and VERSIONS => 1, why does the
> > > second version gets promoted during deletion and does not get removed
> > even
> > > after flush?
> > >
> > > In other words with VERSIONS =>1 , why should the earlier versions be
> > > stored?
> > >
> > > Also with MIN_VERSIONS => 1 and VERSIONS => 1, though the second
> version
> > > promoted but subsequent flush purged it.
> > >
> > > Is this an inconsistency or my understanding is wrong?
> > >
> > > Thanks
> > >
> > > Regards
> > > Mukund Murrali
> > >
> >
>
Re: HBase versions problem
Posted by ramkrishna vasudevan <ra...@gmail.com>.
With VERSIONS=>1 and MIN_VERSIONS=0, I think the intended behaviour is to
always have the current version as the one to be returned. So in your cases
you inserted two cells at different timestamp. But the Delete with
addColumn will always try to delete the latest version. So in this case
the latest version happens to be the value 2 version. Hence for C1 that
value got masked and whether u do the flush or not you always end up in the
value 1 cell. (ie the first one).
Coming to the family 2 where you want atleast one version to be maintained
. I need to check the code more thoroughly to determine the behaviour
difference between flush and no flush.
REgards
Ram
On Fri, Oct 16, 2015 at 1:05 PM, mukund murrali <mu...@gmail.com>
wrote:
> Can anyone enlighten why this is happening. This is causing problems in our
> production.
>
> On Thu, Oct 15, 2015 at 4:15 PM, mukund murrali <mu...@gmail.com>
> wrote:
>
> > Hi
> >
> > I am using hbase-1.0. I had two column families C1 and C2.
> >
> > C1 => 'VERSIONS => 1, MIN_VERSIONS => 0 (default)
> > C2 => 'VERSIONS' => 1, MIN_VERSIONS => 1
> >
> > I inserted two versions as follows
> > put 'test','ro1','C1:col1,'value1'
> > put 'test','ro1','C2:col1,'value1'
> >
> >
> > put 'test','ro1','C1:col1,'value2'
> > put 'test','ro1','C2:col1,'value2'
> >
> > I did a delete using java API with addColumn ( not Columns) for both C1
> > and C2 column families. On a get call I got the result as
> >
> > C1:col1 timestamp=1444904709797,value=value1
> >
> > C2:col1 timestamp=1444904695656, value=value1
> >
> > on doing a *flush* on the table, the C2 data got vanished and subsequent
> > get call returned with first version of C1.
> >
> > C1:col1 timestamp=1444904709797,value=value1
> >
> > On deeper analysis, we found that a flush before delete will purge both
> of
> > those data.
> >
> > My question is with MIN_VERSIONS => 0 and VERSIONS => 1, why does the
> > second version gets promoted during deletion and does not get removed
> even
> > after flush?
> >
> > In other words with VERSIONS =>1 , why should the earlier versions be
> > stored?
> >
> > Also with MIN_VERSIONS => 1 and VERSIONS => 1, though the second version
> > promoted but subsequent flush purged it.
> >
> > Is this an inconsistency or my understanding is wrong?
> >
> > Thanks
> >
> > Regards
> > Mukund Murrali
> >
>
Re: HBase versions problem
Posted by mukund murrali <mu...@gmail.com>.
Can anyone enlighten why this is happening. This is causing problems in our
production.
On Thu, Oct 15, 2015 at 4:15 PM, mukund murrali <mu...@gmail.com>
wrote:
> Hi
>
> I am using hbase-1.0. I had two column families C1 and C2.
>
> C1 => 'VERSIONS => 1, MIN_VERSIONS => 0 (default)
> C2 => 'VERSIONS' => 1, MIN_VERSIONS => 1
>
> I inserted two versions as follows
> put 'test','ro1','C1:col1,'value1'
> put 'test','ro1','C2:col1,'value1'
>
>
> put 'test','ro1','C1:col1,'value2'
> put 'test','ro1','C2:col1,'value2'
>
> I did a delete using java API with addColumn ( not Columns) for both C1
> and C2 column families. On a get call I got the result as
>
> C1:col1 timestamp=1444904709797,value=value1
>
> C2:col1 timestamp=1444904695656, value=value1
>
> on doing a *flush* on the table, the C2 data got vanished and subsequent
> get call returned with first version of C1.
>
> C1:col1 timestamp=1444904709797,value=value1
>
> On deeper analysis, we found that a flush before delete will purge both of
> those data.
>
> My question is with MIN_VERSIONS => 0 and VERSIONS => 1, why does the
> second version gets promoted during deletion and does not get removed even
> after flush?
>
> In other words with VERSIONS =>1 , why should the earlier versions be
> stored?
>
> Also with MIN_VERSIONS => 1 and VERSIONS => 1, though the second version
> promoted but subsequent flush purged it.
>
> Is this an inconsistency or my understanding is wrong?
>
> Thanks
>
> Regards
> Mukund Murrali
>