You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Sijie Guo <gu...@gmail.com> on 2021/02/01 02:01:55 UTC

Re: why not process bk error code LedgerFencedException

Yang - I see. Can you point out the code? I think there might be something
we can improve there.

- Sijie

On Sat, Jan 30, 2021 at 7:40 PM yang chen <sh...@gmail.com> wrote:

> sorry for the delayed reply, I mean OpAddEntry why not handle
> LedgerFencedException to make current broker fence current ledger, when the
> ledger is recovered by another broker, the old broker will
> throw LedgerFencedException when adding an entry, I only see fence the
> current ledger when zk return badversion.
> [image: image.png]
>
> Sijie Guo <gu...@gmail.com> 于2020年12月9日周三 上午7:08写道:
>
>> Yang - Can you clarify a bit more about the question and what are you
>> looking for?
>>
>> - Sijie
>>
>> On Mon, Dec 7, 2020 at 7:20 PM yang chen <sh...@gmail.com> wrote:
>>
>> > hello, I have a question about ledger fence, why not fence the ledger
>> > in ManagedLedgerImpl
>> > and change the state to fenced when bk return LedgerFencedException
>> after
>> > adding an entry.
>> >
>>
>

Re: why not process bk error code LedgerFencedException

Posted by Sijie Guo <gu...@gmail.com>.
I see. You are right. In this case, if the exception is
LedgerFencedException, that means that the current writer already lost the
ownership. We can propagate the exception to the broker to give up the
ownership.

Thanks,
Sijie

On Mon, Feb 1, 2021 at 7:15 PM yang chen <sh...@gmail.com> wrote:

>
> https://github.com/apache/pulsar/blob/1f7448e42a7946582090e3676c20dcfb06e6398b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java#L170
> ,
> here, it will close the current ledger, but if the Exception is
> LedgerFencedException, should we fence the current ledger directly?
>
> Sijie Guo <gu...@gmail.com> 于2021年2月1日周一 上午10:02写道:
>
> > Yang - I see. Can you point out the code? I think there might be
> something
> > we can improve there.
> >
> > - Sijie
> >
> > On Sat, Jan 30, 2021 at 7:40 PM yang chen <sh...@gmail.com> wrote:
> >
> > > sorry for the delayed reply, I mean OpAddEntry why not handle
> > > LedgerFencedException to make current broker fence current ledger, when
> > the
> > > ledger is recovered by another broker, the old broker will
> > > throw LedgerFencedException when adding an entry, I only see fence the
> > > current ledger when zk return badversion.
> > > [image: image.png]
> > >
> > > Sijie Guo <gu...@gmail.com> 于2020年12月9日周三 上午7:08写道:
> > >
> > >> Yang - Can you clarify a bit more about the question and what are you
> > >> looking for?
> > >>
> > >> - Sijie
> > >>
> > >> On Mon, Dec 7, 2020 at 7:20 PM yang chen <sh...@gmail.com>
> wrote:
> > >>
> > >> > hello, I have a question about ledger fence, why not fence the
> ledger
> > >> > in ManagedLedgerImpl
> > >> > and change the state to fenced when bk return LedgerFencedException
> > >> after
> > >> > adding an entry.
> > >> >
> > >>
> > >
> >
>

Re: why not process bk error code LedgerFencedException

Posted by yang chen <sh...@gmail.com>.
https://github.com/apache/pulsar/blob/1f7448e42a7946582090e3676c20dcfb06e6398b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java#L170,
here, it will close the current ledger, but if the Exception is
LedgerFencedException, should we fence the current ledger directly?

Sijie Guo <gu...@gmail.com> 于2021年2月1日周一 上午10:02写道:

> Yang - I see. Can you point out the code? I think there might be something
> we can improve there.
>
> - Sijie
>
> On Sat, Jan 30, 2021 at 7:40 PM yang chen <sh...@gmail.com> wrote:
>
> > sorry for the delayed reply, I mean OpAddEntry why not handle
> > LedgerFencedException to make current broker fence current ledger, when
> the
> > ledger is recovered by another broker, the old broker will
> > throw LedgerFencedException when adding an entry, I only see fence the
> > current ledger when zk return badversion.
> > [image: image.png]
> >
> > Sijie Guo <gu...@gmail.com> 于2020年12月9日周三 上午7:08写道:
> >
> >> Yang - Can you clarify a bit more about the question and what are you
> >> looking for?
> >>
> >> - Sijie
> >>
> >> On Mon, Dec 7, 2020 at 7:20 PM yang chen <sh...@gmail.com> wrote:
> >>
> >> > hello, I have a question about ledger fence, why not fence the ledger
> >> > in ManagedLedgerImpl
> >> > and change the state to fenced when bk return LedgerFencedException
> >> after
> >> > adding an entry.
> >> >
> >>
> >
>