You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Rakesh R (JIRA)" <ji...@apache.org> on 2012/07/17 11:03:34 UTC
[jira] [Created] (BOOKKEEPER-346) Detect IOExceptions in LdgerCache
and bookie should look at next ledger dir(if any)
Rakesh R created BOOKKEEPER-346:
-----------------------------------
Summary: Detect IOExceptions in LdgerCache 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.0.0
Reporter: Rakesh R
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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476840#comment-13476840 ]
Sijie Guo commented on BOOKKEEPER-346:
--------------------------------------
sure. I tried to take a look at last week but it failed due to other blocking things. I would try to give a review today. sorry for delay.
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484686#comment-13484686 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Thanks Ivan, I will correct the logic, also correct the character limit and post a new patch soon.
> 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, 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the rebased patch. This depends on the latest patch attached to BOOKKEEPER-345
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476794#comment-13476794 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
[~hustlmsp] Can you please take a look at this patch for the transaction based movement of ledger cache index file.
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483373#comment-13483373 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
I dont like the coupling of the journal with ledger storage. It makes things hard to test and benchmark in isolation. Whats more, it's unnecessary.
If we have the copy sequence as above
1) copy A.idx to A.idx.rloc
2) delete A.idx
3) rename A.idx.rloc to A.idx
the problematic case is if we crash after 2, before 3 completes. But if on initialization of the LedgerCacheImpl, we scan all directories for A.idx.rloc, if A.idx exists the copy was incomplete, remove A.idx.rloc, if A.idx does not exist, rename A.idx.rloc to A.idx. Theres no need to mess with the journal at all.
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484151#comment-13484151 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
Theres a logic error in the patch (and in my suggested solution). It causes CompationTest to fail.
{code}
if (!index.isFile()
|| !index.getName().endsWith(".idx")
|| !index.getName().endsWith(".rloc")) {
continue;
}
{code}
should be
{code}
if (!index.isFile()
|| (!index.getName().endsWith(".idx")
&& !index.getName().endsWith(".rloc"))) {
continue;
}
{code}
Also, cutting the code at 80 chars is causing the code to be harder to read. Generally, for Java I use 120 as the character limit, as with java you've usually lost 8 characters (class and method indent) before you can write any code. HDFS does use 80, but their indent level is 2. 120 has been the defacto standard for BK/hedwig, though I can find anywhere that it's written down.
> 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, 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the patch,
depends on BOOKKEEPER-345 patch
> 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.0.0
> Reporter: Rakesh R
> Attachments: 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417079#comment-13417079 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Here, on flush failure of index file, copying the contents to another directory and continue writing.
> 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.0.0
> Reporter: Rakesh R
> Attachments: 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483726#comment-13483726 ]
Sijie Guo commented on BOOKKEEPER-346:
--------------------------------------
[~ikelly] Ah, ur right. we had LedgerCacheImpl to scan over all directories when initializing LedgerCacheImpl. so no journal needed for ledger storage.
> 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching latest patch with comment fixes
> 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, 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484018#comment-13484018 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Thanks Ivan,
You mean to say, After scanning all directories for *.idx files, one more time scan for *.idx.rloc files.
1) If one x.idx.rloc file found and corresponding x.idx not found earlier, then rename x.idx.rloc to x.idx and add x to activeLedgers list.
2) if x.idc.rloc file found and also x.idx was also found during first scan, then just delete x.idx.rloc and proceed.
Am I right?
All these things if I do in {{org.apache.bookkeeper.bookie.LedgerCacheImpl.getActiveLedgers()}} then no need of {{start()}} method. Also I can remove similar code in {{findIndexFile()}}
> 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, 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivan Kelly updated BOOKKEEPER-346:
----------------------------------
Fix Version/s: 4.2.0
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479640#comment-13479640 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Thanks [~hustlmsp] for the detailed suggestion on Journal changes and solution of ledger cache file movement. I will look into it and post a new patch ASAP.
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483899#comment-13483899 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Oh!!
Then I will post a patch with just movement using above mentioned steps. I hope that would be fine.
> 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
[jira] [Assigned] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay reassigned BOOKKEEPER-346:
--------------------------------
Assignee: Vinay
> 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
> Attachments: 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471634#comment-13471634 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
this patch depends on BOOKKEEPER-345
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484023#comment-13484023 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
Yes, you can put it in getActiveLedger(), though I think you should rename this to getActiveLedgersOnInit() to hint that it should only ever be called on initialisation, as later called could mess things up.
I would change the order a little bit also, to avoid traversing the directories more than once. Basically, Id change the current loop to the following
{code}
for (File ledgerDirectory : ledgerDirectories) {
for (File grandParent : ledgerDirectory.listFiles()) {
if (grandParent.isDirectory()) {
for (File parent : grandParent.listFiles()) {
if (parent.isDirectory()) {
for (File index : parent.listFiles()) {
if (!index.isFile()
|| !index.getName().endsWith(".idx")
|| !index.getName().endsWith(".rloc")) {
continue;
}
// We've found a ledger index file. The file name is the
// HexString representation of the ledgerId.
String ledgerIdInHex = index.getName().replace(".rloc", "").replace(".idx", "");
if (index.getName().endsWith(".rloc)) {
if (indexFileExists(ledgerIdInHex, ledgerDirectories)) {
index.delete();
continue;
} else {
index.renameTo(new File(index.getParentFile(), ledgerIdInHex + ".idx"));
}
}
activeLedgerManager.addActiveLedger(Long.parseLong(ledgerIdInHex, 16), true);
}
}
}
}
}
}
{code}
> 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, 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
[jira] [Comment Edited] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479034#comment-13479034 ]
Sijie Guo edited comment on BOOKKEEPER-346 at 10/18/12 2:34 PM:
----------------------------------------------------------------
sorry for late response. the overall of the patch looks good to me. I had some comments listed as below:
1) about Journal entries.
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.
a) AddEntry: for added entry. call logAddEntry to record a journal entry in journal.
b) MasterKeyEntry: log master key for a ledger. call logMasterKey(long ledgerId, byte[] masterKey) and in #logMasterKey, it build the ByteBuffer and write to journal.
c) LedgerStorageChanges: log changes of a ledger storage. call logLedgerStorageChanges(long ledgerId, ByteBuffer changes) and in #logLedgerStorageChanges you build the ByteBuffer and write to journal.
when replaying journal, Journal dispatched to different methods when encountering different type of journal entries. the skeleton code of Journal would be something like below (the wordings might be not correct. please feel free to correct them):
{code}
class Journal {
void logAddEntry(ByteBuffer entry, ...) // log an addEntry operation
void logMasterKey(long ledgerId, byte[] masterKey) // log the master key of a ledger
void logLedgerStorageChanges(long ledgerId, ByteBuffer changes) // log changes from a ledger storage.
}
class JournalScanner {
void onAddEntry(ByteBuffer) {
// handle add entry
}
void onMasterKey(long ledgerId, byte[] masterKey) {
// handle master key
}
void onLedgerStorageChanged(long ledgerId, ByteBuffer changes) {
// handle ledger storage changes (like a ledger index relocation in InterLeavedLedgerStorage)
}
}
{code}
so all the journal entry details and constants defines could be managed by Journal, we don't need to spread the journal format code all overal other files.
2) I am not sure is there any better solution to record the relocation? otherwise using current journal entry, you had to replay the journal twice. In most time, it wasted time. I don't have better idea now, needs to think more about it.
was (Author: hustlmsp):
sorry for late response. the overall of the patch looks good to me. I had some comments listed as below:
1) about Journal entries.
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.
a) AddEntry: for added entry. call logAddEntry to record a journal entry in journal.
b) MasterKeyEntry: log master key for a ledger. call logMasterKey(long ledgerId, byte[] masterKey) and in #logMasterKey, it build the ByteBuffer and write to journal.
c) LedgerIndexRelocate: log a relocation of a ledger index file. call logLedgerIndexRelocation(long ledgerId, File oldFile, File newFile) and in #logLedgerIndexRelocation you build the ByteBuffer and write to journal.
when replaying journal, Journal dispatched to different methods when encountering different type of journal entries. the skeleton code of Journal would be something like below (the wordings might be not correct. please feel free to correct them):
{code}
class Journal {
void logAddEntry(ByteBuffer entry, ...) // log an addEntry operation
void logMasterKey(long ledgerId, byte[] masterKey) // log the master key of a ledger
void logLedgerStorageChanges(long ledgerId, ByteBuffer changes) // log changes from a ledger storage.
}
class JournalScanner {
void onAddEntry(ByteBuffer) {
// handle add entry
}
void onMasterKey(long ledgerId, byte[] masterKey) {
// handle master key
}
void onLedgerStorageChanged(long ledgerId, ByteBuffer changes) {
// handle ledger storage changes (like a ledger index relocation in InterLeavedLedgerStorage)
}
}
{code}
so all the journal entry details and constants defines could be managed by Journal, we don't need to spread the journal format code all overal other files.
2) I am not sure is there any better solution to record the relocation? otherwise using current journal entry, you had to replay the journal twice. In most time, it wasted time. I don't have better idea now, needs to think more about it.
> 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the latest patch with above comment fixes and some more changes.
> 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
> Attachments: 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479046#comment-13479046 ]
Sijie Guo commented on BOOKKEEPER-346:
--------------------------------------
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.
so the steps would be
1) copying A.idx to B.rloc
2) deleting A.idx
3) renaming B.rloc to B.idx
so you would not find two *.idx at the same time when starting replaying journal. just a tricky place is that if failure happens between 2) and 3). there would be no *.idx for that ledger, the code needs to look up *.rloc too if there is no *.idx. the changes would be quite small. After that, it would be safe to replay the journal in one pass.
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479034#comment-13479034 ]
Sijie Guo commented on BOOKKEEPER-346:
--------------------------------------
sorry for late response. the overall of the patch looks good to me. I had some comments listed as below:
1) about Journal entries.
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.
a) AddEntry: for added entry. call logAddEntry to record a journal entry in journal.
b) MasterKeyEntry: log master key for a ledger. call logMasterKey(long ledgerId, byte[] masterKey) and in #logMasterKey, it build the ByteBuffer and write to journal.
c) LedgerIndexRelocate: log a relocation of a ledger index file. call logLedgerIndexRelocation(long ledgerId, File oldFile, File newFile) and in #logLedgerIndexRelocation you build the ByteBuffer and write to journal.
when replaying journal, Journal dispatched to different methods when encountering different type of journal entries. the skeleton code of Journal would be something like below (the wordings might be not correct. please feel free to correct them):
{code}
class Journal {
void logAddEntry(ByteBuffer entry, ...) // log an addEntry operation
void logMasterKey(long ledgerId, byte[] masterKey) // log the master key of a ledger
void logLedgerStorageChanges(long ledgerId, ByteBuffer changes) // log changes from a ledger storage.
}
class JournalScanner {
void onAddEntry(ByteBuffer) {
// handle add entry
}
void onMasterKey(long ledgerId, byte[] masterKey) {
// handle master key
}
void onLedgerStorageChanged(long ledgerId, ByteBuffer changes) {
// handle ledger storage changes (like a ledger index relocation in InterLeavedLedgerStorage)
}
}
{code}
so all the journal entry details and constants defines could be managed by Journal, we don't need to spread the journal format code all overal other files.
2) I am not sure is there any better solution to record the relocation? otherwise using current journal entry, you had to replay the journal twice. In most time, it wasted time. I don't have better idea now, needs to think more about it.
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484024#comment-13484024 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
".idx" and ".rloc" should be defined as constants somewhere also.
> 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, 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484940#comment-13484940 ]
Hudson commented on BOOKKEEPER-346:
-----------------------------------
Integrated in bookkeeper-trunk #775 (See [https://builds.apache.org/job/bookkeeper-trunk/775/])
BOOKKEEPER-346: Detect IOExceptions in LedgerCache and bookie should look at next ledger dir(if any) (Vinay via ivank) (Revision 1402464)
Result = UNSTABLE
ivank :
Files :
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCacheImpl.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java
> 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, 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443080#comment-13443080 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
LedgerDirsManager is still missing from the patch.
> 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
> Attachments: 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479985#comment-13479985 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
{quote}there would be no *.idx for that ledger, the code needs to look up *.rloc too if there is no *.idx. the changes would be quite small. After that, it would be safe to replay the journal in one pass.{quote}
OOPS!! I got your last point now.. Sorry for the confusion created by above comment.
> 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the latest patch.
This patch depends on BOOKKEEPER-345 and contains comment fixes given in BOOKKEEPER-345.
> 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
> Attachments: 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the draft patch for transaction based movement of ledger index file.
Please review...
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452902#comment-13452902 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Thanks Sijie. I agree with your point.
> 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
>
>
> 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443084#comment-13443084 ]
Vinay commented on BOOKKEEPER-346:
----------------------------------
Oh..I forgot to mention this again.. This patch depends on BOOKKEEPER-345.
I will link it..
Please take a look at BOOKKEEPER-345
> 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
> Attachments: 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the latest patch
> 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, 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the latest patch, which fixes Ivan's comments.
> 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, 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
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452889#comment-13452889 ]
Sijie Guo commented on BOOKKEEPER-346:
--------------------------------------
{code}
+ /**
+ * Copies current file contents upto specified size to the target file and
+ * deletes the current file.
+ * If size not known then pass size as Long.MAX_VALUE to copy complete file.
+ */
+ public void moveToNewLocation(File newFile, long size) throws IOException {
+ checkOpen(false);
+ if (size == Long.MAX_VALUE) {
+ size = fc.size();
+ }
+ if (!newFile.exists()) {
+ checkParents(newFile);
+ newFile.createNewFile();
+ }
+ FileChannel newFc = new RandomAccessFile(newFile, "rw").getChannel();
+ try {
+ long written = 0;
+ while (written < size) {
+ long count = fc.transferTo(written, size, newFc);
+ if (count <= 0) {
+ throw new IOException("Copying to new location failed");
+ }
+ written += count;
+ }
+ if (written <= 0 && size > 0) {
+ throw new IOException("Copying to new location failed");
+ }
+ } finally {
+ newFc.force(true);
+ }
+ fc.close();
+ fc = newFc;
+ if (!delete()) {
+ LOG.warn("Failed to delete the previous index file " + lf);
+ }
+ lf = newFile;
+ }
+
{code}
first, the operation is not synchronized. it would be called in different threads (in flush thread and thread serving requests).
second, this is not a transacted operation. so if the bookie server failed before deleted the old index file. then there are two index files existed after bookie server restarted. it would introduce the issue described in BOOKKEEPER-374.
one possible solution for the movement, we need record a transaction for the movement, say 'file1' move to 'file2'. if the bookie failed before delete the original file. 'file1' and 'file2' are both existed in the system. when the bookie server restarts, it starts to replay the journal to ensure 'file1' is copied to 'file2' and 'file1' is deleted before starting serving the requests.
and we could leverage Journal to record such transaction.
since it is not a small change, I would like to see others' comments for this change.
> 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
>
>
> 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Attachment: BOOKKEEPER-346.patch
Attaching the latest patch with deamon thread for disk scanning
> 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
> Attachments: 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483980#comment-13483980 ]
Ivan Kelly commented on BOOKKEEPER-346:
---------------------------------------
New patch misses the case of a crash between 1 & 2. In the case, on reboot A.idx & A.idx.rloc exists. Now, if we delete ledger A, A.idx is deleted. A.idx.rloc is then orphaned. This is why I think it was be better to do the scan for rloc files at the bootup, rather than just in time. You'll need to add a start() method to the LedgerCache interface, but thats not a problem. EntryLogger and LedgerStorage already have a start method.
> 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, 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
[jira] [Updated] (BOOKKEEPER-346) Detect IOExceptions in
LedgerCache and bookie should look at next ledger dir(if any)
Posted by "Vinay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vinay updated BOOKKEEPER-346:
-----------------------------
Summary: Detect IOExceptions in LedgerCache and bookie should look at next ledger dir(if any) (was: Detect IOExceptions in LdgerCache and bookie should look at next ledger dir(if any))
> 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.0.0
> Reporter: Rakesh R
>
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira