You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jerry Lam <ch...@gmail.com> on 2015/06/09 17:05:34 UTC

Potential bugs in HTable In incrementColumnValue method

Hi HBase community,

Can anyone confirm that the method incrementColumnValue is implemented
correctly?

I'm talking about mainly the deprecated method:

 @Deprecated

  @Override

  public long incrementColumnValue(final byte [] row, final byte [] family,

      final byte [] qualifier, final long amount, final boolean writeToWAL)

  throws IOException {

    return incrementColumnValue(row, family, qualifier, amount,

      writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);

  }


Note from the above, if writeToWAL is true, Durability is set to SKIP_WAL.

It does not make sense to me so I'm asking if this might be a potential bug.


Best Regards,


Jerry

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Jerry Lam <ch...@gmail.com>.
Done. Thanks everyone for confirming this!

HBASE-13881
https://issues.apache.org/jira/browse/HBASE-13881

On Tue, Jun 9, 2015 at 7:09 PM, Ted Yu <yu...@gmail.com> wrote:

> Did a quick search in HBase JIRA - no hit.
>
> Jerry:
> Mind logging one ?
>
> Thanks
>
> On Tue, Jun 9, 2015 at 3:30 PM, Andrew Purtell <ap...@apache.org>
> wrote:
>
> > Is there a JIRA for this?
> >
> > On Tue, Jun 9, 2015 at 11:15 AM, Ted Yu <yu...@gmail.com> wrote:
> >
> > > Seems a bug to me w.r.t. interpretation of writeToWAL
> > >
> > > Cheers
> > >
> > > On Tue, Jun 9, 2015 at 10:50 AM, Jerry Lam <ch...@gmail.com>
> wrote:
> > >
> > > > Hi Vlad,
> > > >
> > > > I copied the code from HBase version 1.0.0.
> > > > I first noticed it in version 0.98.6.
> > > >
> > > > We have codes that use HBase since 0.92. So some of the codes have
> not
> > > been
> > > > ported to the latest version therefore they are still using the
> > > deprecated
> > > > methods.
> > > >
> > > > The reason I'm asking is because I don't know if I should use
> SKIP_WAL
> > to
> > > > get the same semantic of writeToWAL (true). I'm doubting it because
> the
> > > > name SKIP_WAL implies writeToWAL false. :)
> > > >
> > > > Best Regards,
> > > >
> > > > Jerry
> > > >
> > > >
> > > >
> > > > On Tue, Jun 9, 2015 at 12:03 PM, Ted Yu <yu...@gmail.com> wrote:
> > > >
> > > > > I see code in this formation in 0.98 branch.
> > > > >
> > > > > Looking at the unit tests which exercise incrementColumnValue(),
> they
> > > all
> > > > > call:
> > > > >   public long incrementColumnValue(final byte [] row, final byte []
> > > > family,
> > > > >       final byte [] qualifier, final long amount)
> > > > > Possibly because the one mentioned by Jerry is deprecated.
> > > > >
> > > > > FYI
> > > > >
> > > > > On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <
> > > > vladrodionov@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hi, Jerry
> > > > > >
> > > > > > Which version of HBase is it?
> > > > > >
> > > > > > -Vlad
> > > > > >
> > > > > > On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com>
> > > > wrote:
> > > > > >
> > > > > > > Hi HBase community,
> > > > > > >
> > > > > > > Can anyone confirm that the method incrementColumnValue is
> > > > implemented
> > > > > > > correctly?
> > > > > > >
> > > > > > > I'm talking about mainly the deprecated method:
> > > > > > >
> > > > > > >  @Deprecated
> > > > > > >
> > > > > > >   @Override
> > > > > > >
> > > > > > >   public long incrementColumnValue(final byte [] row, final
> byte
> > []
> > > > > > family,
> > > > > > >
> > > > > > >       final byte [] qualifier, final long amount, final boolean
> > > > > > writeToWAL)
> > > > > > >
> > > > > > >   throws IOException {
> > > > > > >
> > > > > > >     return incrementColumnValue(row, family, qualifier, amount,
> > > > > > >
> > > > > > >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> > > > > > >
> > > > > > >   }
> > > > > > >
> > > > > > >
> > > > > > > Note from the above, if writeToWAL is true, Durability is set
> to
> > > > > > SKIP_WAL.
> > > > > > >
> > > > > > > It does not make sense to me so I'm asking if this might be a
> > > > potential
> > > > > > > bug.
> > > > > > >
> > > > > > >
> > > > > > > Best Regards,
> > > > > > >
> > > > > > >
> > > > > > > Jerry
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Best regards,
> >
> >    - Andy
> >
> > Problems worthy of attack prove their worth by hitting back. - Piet Hein
> > (via Tom White)
> >
>

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Ted Yu <yu...@gmail.com>.
Did a quick search in HBase JIRA - no hit.

Jerry:
Mind logging one ?

Thanks

On Tue, Jun 9, 2015 at 3:30 PM, Andrew Purtell <ap...@apache.org> wrote:

> Is there a JIRA for this?
>
> On Tue, Jun 9, 2015 at 11:15 AM, Ted Yu <yu...@gmail.com> wrote:
>
> > Seems a bug to me w.r.t. interpretation of writeToWAL
> >
> > Cheers
> >
> > On Tue, Jun 9, 2015 at 10:50 AM, Jerry Lam <ch...@gmail.com> wrote:
> >
> > > Hi Vlad,
> > >
> > > I copied the code from HBase version 1.0.0.
> > > I first noticed it in version 0.98.6.
> > >
> > > We have codes that use HBase since 0.92. So some of the codes have not
> > been
> > > ported to the latest version therefore they are still using the
> > deprecated
> > > methods.
> > >
> > > The reason I'm asking is because I don't know if I should use SKIP_WAL
> to
> > > get the same semantic of writeToWAL (true). I'm doubting it because the
> > > name SKIP_WAL implies writeToWAL false. :)
> > >
> > > Best Regards,
> > >
> > > Jerry
> > >
> > >
> > >
> > > On Tue, Jun 9, 2015 at 12:03 PM, Ted Yu <yu...@gmail.com> wrote:
> > >
> > > > I see code in this formation in 0.98 branch.
> > > >
> > > > Looking at the unit tests which exercise incrementColumnValue(), they
> > all
> > > > call:
> > > >   public long incrementColumnValue(final byte [] row, final byte []
> > > family,
> > > >       final byte [] qualifier, final long amount)
> > > > Possibly because the one mentioned by Jerry is deprecated.
> > > >
> > > > FYI
> > > >
> > > > On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <
> > > vladrodionov@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi, Jerry
> > > > >
> > > > > Which version of HBase is it?
> > > > >
> > > > > -Vlad
> > > > >
> > > > > On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com>
> > > wrote:
> > > > >
> > > > > > Hi HBase community,
> > > > > >
> > > > > > Can anyone confirm that the method incrementColumnValue is
> > > implemented
> > > > > > correctly?
> > > > > >
> > > > > > I'm talking about mainly the deprecated method:
> > > > > >
> > > > > >  @Deprecated
> > > > > >
> > > > > >   @Override
> > > > > >
> > > > > >   public long incrementColumnValue(final byte [] row, final byte
> []
> > > > > family,
> > > > > >
> > > > > >       final byte [] qualifier, final long amount, final boolean
> > > > > writeToWAL)
> > > > > >
> > > > > >   throws IOException {
> > > > > >
> > > > > >     return incrementColumnValue(row, family, qualifier, amount,
> > > > > >
> > > > > >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> > > > > >
> > > > > >   }
> > > > > >
> > > > > >
> > > > > > Note from the above, if writeToWAL is true, Durability is set to
> > > > > SKIP_WAL.
> > > > > >
> > > > > > It does not make sense to me so I'm asking if this might be a
> > > potential
> > > > > > bug.
> > > > > >
> > > > > >
> > > > > > Best Regards,
> > > > > >
> > > > > >
> > > > > > Jerry
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
> --
> Best regards,
>
>    - Andy
>
> Problems worthy of attack prove their worth by hitting back. - Piet Hein
> (via Tom White)
>

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Andrew Purtell <ap...@apache.org>.
Is there a JIRA for this?

On Tue, Jun 9, 2015 at 11:15 AM, Ted Yu <yu...@gmail.com> wrote:

> Seems a bug to me w.r.t. interpretation of writeToWAL
>
> Cheers
>
> On Tue, Jun 9, 2015 at 10:50 AM, Jerry Lam <ch...@gmail.com> wrote:
>
> > Hi Vlad,
> >
> > I copied the code from HBase version 1.0.0.
> > I first noticed it in version 0.98.6.
> >
> > We have codes that use HBase since 0.92. So some of the codes have not
> been
> > ported to the latest version therefore they are still using the
> deprecated
> > methods.
> >
> > The reason I'm asking is because I don't know if I should use SKIP_WAL to
> > get the same semantic of writeToWAL (true). I'm doubting it because the
> > name SKIP_WAL implies writeToWAL false. :)
> >
> > Best Regards,
> >
> > Jerry
> >
> >
> >
> > On Tue, Jun 9, 2015 at 12:03 PM, Ted Yu <yu...@gmail.com> wrote:
> >
> > > I see code in this formation in 0.98 branch.
> > >
> > > Looking at the unit tests which exercise incrementColumnValue(), they
> all
> > > call:
> > >   public long incrementColumnValue(final byte [] row, final byte []
> > family,
> > >       final byte [] qualifier, final long amount)
> > > Possibly because the one mentioned by Jerry is deprecated.
> > >
> > > FYI
> > >
> > > On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <
> > vladrodionov@gmail.com>
> > > wrote:
> > >
> > > > Hi, Jerry
> > > >
> > > > Which version of HBase is it?
> > > >
> > > > -Vlad
> > > >
> > > > On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com>
> > wrote:
> > > >
> > > > > Hi HBase community,
> > > > >
> > > > > Can anyone confirm that the method incrementColumnValue is
> > implemented
> > > > > correctly?
> > > > >
> > > > > I'm talking about mainly the deprecated method:
> > > > >
> > > > >  @Deprecated
> > > > >
> > > > >   @Override
> > > > >
> > > > >   public long incrementColumnValue(final byte [] row, final byte []
> > > > family,
> > > > >
> > > > >       final byte [] qualifier, final long amount, final boolean
> > > > writeToWAL)
> > > > >
> > > > >   throws IOException {
> > > > >
> > > > >     return incrementColumnValue(row, family, qualifier, amount,
> > > > >
> > > > >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> > > > >
> > > > >   }
> > > > >
> > > > >
> > > > > Note from the above, if writeToWAL is true, Durability is set to
> > > > SKIP_WAL.
> > > > >
> > > > > It does not make sense to me so I'm asking if this might be a
> > potential
> > > > > bug.
> > > > >
> > > > >
> > > > > Best Regards,
> > > > >
> > > > >
> > > > > Jerry
> > > > >
> > > >
> > >
> >
>



-- 
Best regards,

   - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein
(via Tom White)

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Ted Yu <yu...@gmail.com>.
Seems a bug to me w.r.t. interpretation of writeToWAL

Cheers

On Tue, Jun 9, 2015 at 10:50 AM, Jerry Lam <ch...@gmail.com> wrote:

> Hi Vlad,
>
> I copied the code from HBase version 1.0.0.
> I first noticed it in version 0.98.6.
>
> We have codes that use HBase since 0.92. So some of the codes have not been
> ported to the latest version therefore they are still using the deprecated
> methods.
>
> The reason I'm asking is because I don't know if I should use SKIP_WAL to
> get the same semantic of writeToWAL (true). I'm doubting it because the
> name SKIP_WAL implies writeToWAL false. :)
>
> Best Regards,
>
> Jerry
>
>
>
> On Tue, Jun 9, 2015 at 12:03 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > I see code in this formation in 0.98 branch.
> >
> > Looking at the unit tests which exercise incrementColumnValue(), they all
> > call:
> >   public long incrementColumnValue(final byte [] row, final byte []
> family,
> >       final byte [] qualifier, final long amount)
> > Possibly because the one mentioned by Jerry is deprecated.
> >
> > FYI
> >
> > On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <
> vladrodionov@gmail.com>
> > wrote:
> >
> > > Hi, Jerry
> > >
> > > Which version of HBase is it?
> > >
> > > -Vlad
> > >
> > > On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com>
> wrote:
> > >
> > > > Hi HBase community,
> > > >
> > > > Can anyone confirm that the method incrementColumnValue is
> implemented
> > > > correctly?
> > > >
> > > > I'm talking about mainly the deprecated method:
> > > >
> > > >  @Deprecated
> > > >
> > > >   @Override
> > > >
> > > >   public long incrementColumnValue(final byte [] row, final byte []
> > > family,
> > > >
> > > >       final byte [] qualifier, final long amount, final boolean
> > > writeToWAL)
> > > >
> > > >   throws IOException {
> > > >
> > > >     return incrementColumnValue(row, family, qualifier, amount,
> > > >
> > > >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> > > >
> > > >   }
> > > >
> > > >
> > > > Note from the above, if writeToWAL is true, Durability is set to
> > > SKIP_WAL.
> > > >
> > > > It does not make sense to me so I'm asking if this might be a
> potential
> > > > bug.
> > > >
> > > >
> > > > Best Regards,
> > > >
> > > >
> > > > Jerry
> > > >
> > >
> >
>

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Jerry Lam <ch...@gmail.com>.
Hi Vlad,

I copied the code from HBase version 1.0.0.
I first noticed it in version 0.98.6.

We have codes that use HBase since 0.92. So some of the codes have not been
ported to the latest version therefore they are still using the deprecated
methods.

The reason I'm asking is because I don't know if I should use SKIP_WAL to
get the same semantic of writeToWAL (true). I'm doubting it because the
name SKIP_WAL implies writeToWAL false. :)

Best Regards,

Jerry



On Tue, Jun 9, 2015 at 12:03 PM, Ted Yu <yu...@gmail.com> wrote:

> I see code in this formation in 0.98 branch.
>
> Looking at the unit tests which exercise incrementColumnValue(), they all
> call:
>   public long incrementColumnValue(final byte [] row, final byte [] family,
>       final byte [] qualifier, final long amount)
> Possibly because the one mentioned by Jerry is deprecated.
>
> FYI
>
> On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <vl...@gmail.com>
> wrote:
>
> > Hi, Jerry
> >
> > Which version of HBase is it?
> >
> > -Vlad
> >
> > On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com> wrote:
> >
> > > Hi HBase community,
> > >
> > > Can anyone confirm that the method incrementColumnValue is implemented
> > > correctly?
> > >
> > > I'm talking about mainly the deprecated method:
> > >
> > >  @Deprecated
> > >
> > >   @Override
> > >
> > >   public long incrementColumnValue(final byte [] row, final byte []
> > family,
> > >
> > >       final byte [] qualifier, final long amount, final boolean
> > writeToWAL)
> > >
> > >   throws IOException {
> > >
> > >     return incrementColumnValue(row, family, qualifier, amount,
> > >
> > >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> > >
> > >   }
> > >
> > >
> > > Note from the above, if writeToWAL is true, Durability is set to
> > SKIP_WAL.
> > >
> > > It does not make sense to me so I'm asking if this might be a potential
> > > bug.
> > >
> > >
> > > Best Regards,
> > >
> > >
> > > Jerry
> > >
> >
>

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Ted Yu <yu...@gmail.com>.
I see code in this formation in 0.98 branch.

Looking at the unit tests which exercise incrementColumnValue(), they all
call:
  public long incrementColumnValue(final byte [] row, final byte [] family,
      final byte [] qualifier, final long amount)
Possibly because the one mentioned by Jerry is deprecated.

FYI

On Tue, Jun 9, 2015 at 8:49 AM, Vladimir Rodionov <vl...@gmail.com>
wrote:

> Hi, Jerry
>
> Which version of HBase is it?
>
> -Vlad
>
> On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com> wrote:
>
> > Hi HBase community,
> >
> > Can anyone confirm that the method incrementColumnValue is implemented
> > correctly?
> >
> > I'm talking about mainly the deprecated method:
> >
> >  @Deprecated
> >
> >   @Override
> >
> >   public long incrementColumnValue(final byte [] row, final byte []
> family,
> >
> >       final byte [] qualifier, final long amount, final boolean
> writeToWAL)
> >
> >   throws IOException {
> >
> >     return incrementColumnValue(row, family, qualifier, amount,
> >
> >       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
> >
> >   }
> >
> >
> > Note from the above, if writeToWAL is true, Durability is set to
> SKIP_WAL.
> >
> > It does not make sense to me so I'm asking if this might be a potential
> > bug.
> >
> >
> > Best Regards,
> >
> >
> > Jerry
> >
>

Re: Potential bugs in HTable In incrementColumnValue method

Posted by Vladimir Rodionov <vl...@gmail.com>.
Hi, Jerry

Which version of HBase is it?

-Vlad

On Tue, Jun 9, 2015 at 8:05 AM, Jerry Lam <ch...@gmail.com> wrote:

> Hi HBase community,
>
> Can anyone confirm that the method incrementColumnValue is implemented
> correctly?
>
> I'm talking about mainly the deprecated method:
>
>  @Deprecated
>
>   @Override
>
>   public long incrementColumnValue(final byte [] row, final byte [] family,
>
>       final byte [] qualifier, final long amount, final boolean writeToWAL)
>
>   throws IOException {
>
>     return incrementColumnValue(row, family, qualifier, amount,
>
>       writeToWAL? Durability.SKIP_WAL: Durability.USE_DEFAULT);
>
>   }
>
>
> Note from the above, if writeToWAL is true, Durability is set to SKIP_WAL.
>
> It does not make sense to me so I'm asking if this might be a potential
> bug.
>
>
> Best Regards,
>
>
> Jerry
>