[
https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479982#comment-13479982
]
Vinay commented on BOOKKEEPER-346:
----------------------------------
{quote}for journal entry, I would suggest to move logging journal entries to
Journal. so we had a centralized place to manage all journal entry format. so
we had 3 kind of entries now.{quote}
Ok, agree. I can move this.
{quote}One possible better solution for 2) is copying the data to a temporary
file in other directly first, then renaming the temporary file to target index
file.
1) copying A.idx to B.rloc
2) deleting A.idx
3) renaming B.rloc to B.idx
{quote}
For me this approach looks good.
But, in case of failure between 2 and 3, there is a problem if we are replaying
journal in only pass.
Here is the scenario
1. Say some 100 entries are written to one ledger (say L0).
2. last 10 entries are not yet flushed.
3. Now disk became full and we need to do cache file movement.
4. While executing step 3 of movement bookie crashed (i.e. while renaming
0.rloc to 0.idx)
5. Now there wont be any 0.idx file for the ledger.
6. And after restart Bookie will start replaying journals.
7. Now if we replay in one pass, then the 10 entries which are written before
CACHE_INDEX_MOVEMENT_KEY will not have any corresponding ledger idx file and it
will treat as new ledger and it will create and write 10 entries.
8. Now while during replay of {logLedgerStorageChanges} there will be two
files 0.rloc and 0.idx. we cannot directly rename in this case, we need to
merge both contents.
I feel since Bookie will be startup phase during replay and also journal may
not have huge data to replay, replaying in 2 passes would be fine.
Any thoughts..?
> Detect IOExceptions in LedgerCache and bookie should look at next ledger
> dir(if any)
> ------------------------------------------------------------------------------------
>
> Key: BOOKKEEPER-346
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-346
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Affects Versions: 4.1.0
> Reporter: Rakesh R
> Assignee: Vinay
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-346.patch, BOOKKEEPER-346.patch,
> BOOKKEEPER-346.patch, BOOKKEEPER-346.patch, BOOKKEEPER-346.patch,
> BOOKKEEPER-346.patch
>
>
> This jira to detect IOExceptions in "LedgerCache" to iterate over all the
> configured ledger(s).
--
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