You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by Venkateswara Rao Jujjuri <ju...@gmail.com> on 2015/09/20 16:59:54 UTC

Repeted LedgerIds after delete / rewrite returning old data

Hi All,

I started to implement ledgerId API changes which allows user to pass in an
unique
ledgerId instead of  BK generating it.

I have created a test which create/write/verify/delete a ledger with a
ledgerId
in a loop. This test is failing in second iteration as we are reading stale
data.
Can you please advise me if this is a bug or I am missing something in my
implementation?

Pushed the work-in-progress code to github.
https://github.com/jvrao/bookkeeper/commit/765194d2490021ed76ff46fe489430015961e345

https://github.com/jvrao/bookkeeper/commits/forSijie (top commit)

Here is how the failure is:

First loop:
2015-09-20 07:16:56,478 - INFO  - [New I/O worker
#5:PerChannelBookieClient$1@190] - Successfully connected to bookie: [id:
0xf5c19fe8, /192.168.1.10:63232 => /192.168.1.10:15003]
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: 2053591346
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: 2053591346
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: 1119029279
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: 1119029279
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: *1036910072*
2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: *1036910072*


Second loop:

2015-09-20 07:16:56,715 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: 952803458
2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: 952803458
2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: 170728527
2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: 170728527
2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
Original entry: *1987418365*
2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
Retrieved entry: *1036910072* *<--- Retrieved value is what we wrote in
first loop. *

Thanks for your help.


-- 
Jvrao
---
First they ignore you, then they laugh at you, then they fight you, then
you win. - Mahatma Gandhi

Re: Repeted LedgerIds after delete / rewrite returning old data

Posted by Sijie Guo <si...@apache.org>.
When you delete ledger, the data of the ledger isn't delete immediately.
They are removed lazily with garbage collection. So the system is designed
not to reuse a ledger id.

- Sijie

On Sun, Sep 20, 2015 at 12:02 PM, Venkateswara Rao Jujjuri <
jujjuri@gmail.com> wrote:

> Even after deleting it? I am deleting and recreating it. Can you please
> educate be the reason behind it?
> How long we can't reuse the same name?
>
> On Sun, Sep 20, 2015 at 11:54 AM, Sijie Guo <si...@apache.org> wrote:
>
> > You can't create a ledger with same ledger id twice.
> >
> > - Sijie
> >
> > On Sun, Sep 20, 2015 at 7:59 AM, Venkateswara Rao Jujjuri <
> > jujjuri@gmail.com
> > > wrote:
> >
> > > Hi All,
> > >
> > > I started to implement ledgerId API changes which allows user to pass
> in
> > an
> > > unique
> > > ledgerId instead of  BK generating it.
> > >
> > > I have created a test which create/write/verify/delete a ledger with a
> > > ledgerId
> > > in a loop. This test is failing in second iteration as we are reading
> > stale
> > > data.
> > > Can you please advise me if this is a bug or I am missing something in
> my
> > > implementation?
> > >
> > > Pushed the work-in-progress code to github.
> > >
> > >
> >
> https://github.com/jvrao/bookkeeper/commit/765194d2490021ed76ff46fe489430015961e345
> > >
> > > https://github.com/jvrao/bookkeeper/commits/forSijie (top commit)
> > >
> > > Here is how the failure is:
> > >
> > > First loop:
> > > 2015-09-20 07:16:56,478 - INFO  - [New I/O worker
> > > #5:PerChannelBookieClient$1@190] - Successfully connected to bookie:
> > [id:
> > > 0xf5c19fe8, /192.168.1.10:63232 => /192.168.1.10:15003]
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: 2053591346
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: 2053591346
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: 1119029279
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: 1119029279
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: *1036910072*
> > > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: *1036910072*
> > >
> > >
> > > Second loop:
> > >
> > > 2015-09-20 07:16:56,715 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: 952803458
> > > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: 952803458
> > > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: 170728527
> > > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: 170728527
> > > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643]
> -
> > > Original entry: *1987418365*
> > > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645]
> -
> > > Retrieved entry: *1036910072* *<--- Retrieved value is what we wrote in
> > > first loop. *
> > >
> > > Thanks for your help.
> > >
> > >
> > > --
> > > Jvrao
> > > ---
> > > First they ignore you, then they laugh at you, then they fight you,
> then
> > > you win. - Mahatma Gandhi
> > >
> >
>
>
>
> --
> Jvrao
> ---
> First they ignore you, then they laugh at you, then they fight you, then
> you win. - Mahatma Gandhi
>

Re: Repeted LedgerIds after delete / rewrite returning old data

Posted by Venkateswara Rao Jujjuri <ju...@gmail.com>.
Even after deleting it? I am deleting and recreating it. Can you please
educate be the reason behind it?
How long we can't reuse the same name?

On Sun, Sep 20, 2015 at 11:54 AM, Sijie Guo <si...@apache.org> wrote:

> You can't create a ledger with same ledger id twice.
>
> - Sijie
>
> On Sun, Sep 20, 2015 at 7:59 AM, Venkateswara Rao Jujjuri <
> jujjuri@gmail.com
> > wrote:
>
> > Hi All,
> >
> > I started to implement ledgerId API changes which allows user to pass in
> an
> > unique
> > ledgerId instead of  BK generating it.
> >
> > I have created a test which create/write/verify/delete a ledger with a
> > ledgerId
> > in a loop. This test is failing in second iteration as we are reading
> stale
> > data.
> > Can you please advise me if this is a bug or I am missing something in my
> > implementation?
> >
> > Pushed the work-in-progress code to github.
> >
> >
> https://github.com/jvrao/bookkeeper/commit/765194d2490021ed76ff46fe489430015961e345
> >
> > https://github.com/jvrao/bookkeeper/commits/forSijie (top commit)
> >
> > Here is how the failure is:
> >
> > First loop:
> > 2015-09-20 07:16:56,478 - INFO  - [New I/O worker
> > #5:PerChannelBookieClient$1@190] - Successfully connected to bookie:
> [id:
> > 0xf5c19fe8, /192.168.1.10:63232 => /192.168.1.10:15003]
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: 2053591346
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: 2053591346
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: 1119029279
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: 1119029279
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: *1036910072*
> > 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: *1036910072*
> >
> >
> > Second loop:
> >
> > 2015-09-20 07:16:56,715 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: 952803458
> > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: 952803458
> > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: 170728527
> > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: 170728527
> > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> > Original entry: *1987418365*
> > 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> > Retrieved entry: *1036910072* *<--- Retrieved value is what we wrote in
> > first loop. *
> >
> > Thanks for your help.
> >
> >
> > --
> > Jvrao
> > ---
> > First they ignore you, then they laugh at you, then they fight you, then
> > you win. - Mahatma Gandhi
> >
>



-- 
Jvrao
---
First they ignore you, then they laugh at you, then they fight you, then
you win. - Mahatma Gandhi

Re: Repeted LedgerIds after delete / rewrite returning old data

Posted by Sijie Guo <si...@apache.org>.
You can't create a ledger with same ledger id twice.

- Sijie

On Sun, Sep 20, 2015 at 7:59 AM, Venkateswara Rao Jujjuri <jujjuri@gmail.com
> wrote:

> Hi All,
>
> I started to implement ledgerId API changes which allows user to pass in an
> unique
> ledgerId instead of  BK generating it.
>
> I have created a test which create/write/verify/delete a ledger with a
> ledgerId
> in a loop. This test is failing in second iteration as we are reading stale
> data.
> Can you please advise me if this is a bug or I am missing something in my
> implementation?
>
> Pushed the work-in-progress code to github.
>
> https://github.com/jvrao/bookkeeper/commit/765194d2490021ed76ff46fe489430015961e345
>
> https://github.com/jvrao/bookkeeper/commits/forSijie (top commit)
>
> Here is how the failure is:
>
> First loop:
> 2015-09-20 07:16:56,478 - INFO  - [New I/O worker
> #5:PerChannelBookieClient$1@190] - Successfully connected to bookie: [id:
> 0xf5c19fe8, /192.168.1.10:63232 => /192.168.1.10:15003]
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: 2053591346
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: 2053591346
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: 1119029279
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: 1119029279
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: *1036910072*
> 2015-09-20 07:16:56,599 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: *1036910072*
>
>
> Second loop:
>
> 2015-09-20 07:16:56,715 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: 952803458
> 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: 952803458
> 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: 170728527
> 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: 170728527
> 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@643] -
> Original entry: *1987418365*
> 2015-09-20 07:16:56,716 - INFO  - [Thread-2:BookieWriteLedgerTest@645] -
> Retrieved entry: *1036910072* *<--- Retrieved value is what we wrote in
> first loop. *
>
> Thanks for your help.
>
>
> --
> Jvrao
> ---
> First they ignore you, then they laugh at you, then they fight you, then
> you win. - Mahatma Gandhi
>