[
https://issues.apache.org/jira/browse/BOOKKEEPER-685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13778023#comment-13778023
]
Rakesh R commented on BOOKKEEPER-685:
-------------------------------------
Thanks Sijie for the reply.
bq.could you clarify it when you are saying it leads to trouble?
[~hustlmsp] as per my previous comments, I was thinking, just interchanging of
#addEntry and flushed.set(false) sequence won't actually solve the issue. It
can still enter into the execution flow of flush the ledger cache entries which
are not yet flushed to the entry logger.
{quote}
the only thing I could see is that it would flush index entries whose entries
are not flushed to entry logger. {quote}
BTW Ivan's problem statement is also saying about this case I guess. please
correct me if am wrong:(
Is this already handled by BOOKKEEPER-447?
{quote}
but it doesn't matter, most of the time that journal would resecure them and
even the corner case is handled by BOOKKEEPER-447.
{quote}
I didn't fully gone through the comments on BOOKKEEPER-447, as it has large
discussion thread. By initial look at the patch, I'm seeing only it handles
NoSuchEntryException and not recovering entries from Journal. I'll go through
and try understanding the background.
> Race in compaction algorithm from BOOKKEEPER-664
> ------------------------------------------------
>
> Key: BOOKKEEPER-685
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-685
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Ivan Kelly
> Priority: Blocker
> Fix For: 4.2.2
>
>
> I discovered a race in the algorithm when I was forward porting to trunk.
> 1) Thread1: flushed.set(false)
> 2) Thread2: onRotateEntryLog() // flushed.set(true)
> 3) Thread1: entryLogger addEntry L123-E456
> 4) Thread1: offsets > max, waits for flushed, flushed is true(as set in 2),
> L123-E456 updated in ledger cache
> 5) T2: L123 flushed out of ledger cache
> 6) Crash
> This will possible lose 1 entry. I've only reasoned this, not observed it,
> but it can happen.
> The fix is pretty easy. EntryLoggerListener should notify with the point
> offset in the entry log it has synced as far as.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira