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

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

{quote}1), I don't think we really need write WAL first (since it still has the 
problem I raised in previous comment).{quote}
This problem (assuming your referring to corrupt journal entry) is easily 
handled the same way we handle it today. If LedgerStorage#addEntry throws an 
IOException, send an error back to the client, if it throws a 
NoWritableLedgerDirException, transition to read only mode [1]. Any other 
exception would have to be a RuntimeException, and a RuntimeException indicates 
a bug in our code, which we should directly fix. But in any case, the handling 
of this is independent of whether we add to the ledger storage before or after 
the journal.

I like the COW idea. This is effectively what the skiplists do. However, I 
think we should continue to support interleaved and skiplist for the moment 
anyhow.

[1] The current patch only handles the transition to read only case, I need to 
add the IOException case which i'll do when BOOKKEEPER-564 is resolved.
                
> 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: 
> 0001-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> 0001-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> 0001-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> 0001-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> 0003-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> 0003-BOOKKEEPER-572-Write-to-the-journal-before-writing-t.patch, 
> BookieServer-2013-02-22.snapshot
>
>
> 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