In your case, you need to restart B2 with unclean.leader.election=true.
This will enable B2 to become leader with 90 messages.

On Thu, Jun 28, 2018 at 11:51 PM Jordan Pilat <jrpi...@gmail.com> wrote:

> If I restart the broker, won't that cause all 100 messages to be lost?
>
> On 2018/06/28 02:59:15, Manikumar <manikumar.re...@gmail.com> wrote:
> > You can enable unclean.leader.election temporarily for specific topic by
> > using kafka-topics.sh command.
> > This requires broker restart to take effect.
> >
> >  http://kafka.apache.org/documentation/#topicconfigs
> >
> > On Thu, Jun 28, 2018 at 2:27 AM Jordan Pilat <jrpi...@gmail.com> wrote:
> >
> > > Heya,
> > >
> > > I had a question about what behavior to expect from a particular
> > > scenario.  Given:
> > > A. Unclean leader elections are disabled
> > > B. A partition is led by Broker1 and followed by Broker2
> > > C. Broker1 is on offset 100
> > > D. Broker2 is on offset 90
> > > E. Broker2 has fallen out of the ISR, leaving only Broker1 in the ISR
> > > F. Broker1 has a hard drive failure and goes down.  All messages for
> the
> > > partition in question are permanently lost.
> > >
> > > _As I understand it_, the only way for the partition to come back
> online
> > > is to bring Broker1 back online, and suffer the loss of 100 messages
> (as
> > > Broker2's log will be truncated to Broker1's offset, which will start
> from
> > > scratch due to the hard drive loss)
> > >
> > > Is there a procedure in such a case, to force-elect Broker2 the leader,
> > > and thus only lose 10 messages?
> > >
> > > Thanks!
> > > - Jordan Pilat
> > >
> >
>

Reply via email to