[
https://issues.apache.org/jira/browse/BOOKKEEPER-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13577769#comment-13577769
]
Ivan Kelly commented on BOOKKEEPER-569:
---------------------------------------
{quote}1. Why is addEntry synchronized? Other than flush, it seems to be the
only other synchronized method.{quote}
It doesn't necessarily have to be, as EntryLogger#addEntry is synchronized and
LedgerCacheImpl seems quite threadsafe. It has always been synchronized though,
so I don't want to change it without good reason.
{quote}2. Both addEntry and flush access ledgerCache. Are you sure that making
flush unsynchronized will not cause any race?{quote}
ledgerCache is threadsafe as far as I can see. Also, up until Jan 4, flush was
no unsynchronized, as it didn't present a problem.
{quote}3. What exactly makes you think it is an obvious mistake, other than you
being the author of the 293 patch? {quote}
Its completely unrelated to the patch. Usually, for a change like that,
unrelated to the issue, I'd have noted why I did it in the jira or added a
comment. I think I had been touching that code to make it accessible for the
tests, and changed it back wrong. I need to check at home, as thats the repo
the original changes were in.
> Critical performance bug in InterleavedLedgerStorage
> ----------------------------------------------------
>
> Key: BOOKKEEPER-569
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-569
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Ivan Kelly
> Assignee: Ivan Kelly
> Priority: Blocker
> Fix For: 4.3.0, 4.2.1
>
> Attachments:
> 0001-BOOKKEEPER-569-Critical-performance-issue-in-Interle.patch
>
>
> There's a synchronization on InterleavedLedgerStorage#flush(), which kills
> performance when you're writing to many ledgers on a single bookie. Both
> #flush and #addEntry are synchronized, which blocks any adds being serviced
> while the sync thread is running.
> The sync on #addEntry has always been there, but on #flush it has only
> existed since BOOKKEEPER-293. The addition was obviously a mistake.
> Fix is simply to remove it.
--
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