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

Flavio Junqueira commented on BOOKKEEPER-572:
---------------------------------------------

Sijie, Your observation is a good one, but now it sounds like we are discussing 
two issues:

# Do we really need to make the journal a write-ahead log? If it is not asking 
too much, I'd like to have a clear statement of why we are doing this jira. At 
least to me it is not 100% clear. My suspicion is what I mentioning in my last 
post.
# Assuming we write to the journal/WAL first, there is the problem you mention 
that the journal entry is corrupt. To get around that problem, you're 
suggesting a copy-on-write scheme.

Let me dig a bit more into the second point because I'm not entirely sure I 
understand what you're proposing. We don't update ledger entries, so the only 
possibility for overwriting ledger data or index is upon recovery. 
Consequently, I think you're proposing that when we recover (apply or re-apply 
journal records), we don't actually apply changes in place, and instead we 
write them separately and swap the new data with the old data. 

Independent of whether this interpretation is correct or not, if there is an 
exception when writing the new data, then I'm wondering why we can't clean up 
the left-overs of executing the buggy record. If we are able to do it, then it 
seems to me that the result of using COW and replacing in place are equivalent, 
unless you're treating a whole recovery procedure (or chunks of it, say index 
pages) as a transaction. 
                
> 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