[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585809#comment-13585809
 ] 

Ivan Kelly commented on BOOKKEEPER-572:
---------------------------------------

{quote}
How about using queue.offer(new QueueEntry, long timeout, TimeUnit unit) and 
propagate proper errorcode/exception, instead of queue.put(new QueueEntry);. 
This way we would do a graceful handling rather than blocking indefinitely. I'm 
afraid of hanging eventhough its a corner case, also now the queue limit is 
visible and user can tune it.{quote}
I don't think there's a more elegant way to handle a full queue. The client 
will already timeout the request if it gets no response. Having a different 
error at the bookie doesn't make much sense, and would mean that configuration 
on client and server should be coordinated, which is messy. However, I can use 
offer, in a loop, and warn if the offer fails after X seconds.

{quote}
IMHO not to use a LinkedBlockingQueue in a performance sensitive area of code, 
use an ArrayBlockingQueue, anyway we are making the queue unbounded with this 
patch. I feel, ArrayBlockingQueue gives much more perf.
{quote}
This is a good point. I was only using Linked because thats what was always 
there.

Also, I will fix that test error. I attached the snapshot.
                
> Make the journal a write ahead log
> ----------------------------------
>
>                 Key: BOOKKEEPER-572
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-572
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.3.0
>
>         Attachments: 
> 0003-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch
>
>
> A bookie adds to the LedgerStorage before writing to the journal. This is the 
> fundamental problem behind BOOKKEEPER-447 and blocks a nice solution to 
> BOOKKEEPER-530. By writing to the memory state before the journal, we exposed 
> ourselves to bugs if the bookie crashed before we wrote to the journal. The 
> entry may exist in index, but not in the entrylog, a situation which cannot 
> be distinguished from an I/O error. The comments on BOOKKEEPER-447 goes into 
> more details. 

--
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

Reply via email to