You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Flavio Paiva Junqueira (JIRA)" <ji...@apache.org> on 2010/03/18 16:40:27 UTC

[jira] Created: (ZOOKEEPER-712) Bookie recovery

Bookie recovery
---------------

                 Key: ZOOKEEPER-712
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
             Project: Zookeeper
          Issue Type: New Feature
          Components: contrib-bookkeeper
            Reporter: Flavio Paiva Junqueira


Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-712) Bookie recovery

Posted by "Erwin Tam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwin Tam updated ZOOKEEPER-712:
--------------------------------

    Status: Patch Available  (was: Open)

First pass at implementing bookie recovery as an admin tool.  The patch uploaded has two new files:
BookieRecoveryTest.java and BookKeeperTools.java (with a corresponding new directory under bookkeeper/tools).

The main API that BookKeeperTools.java implements is the following:
    public void asyncRecoverBookieData(final InetSocketAddress bookieSrc, final InetSocketAddress bookieDest,
            final RecoverCallback cb, final Object context);

The synchronous version of this API is here:
    public void recoverBookieData(final InetSocketAddress bookieSrc, final InetSocketAddress bookieDest)
            throws InterruptedException;

This is to recover all of the bookie ledger data that was present on a dead input bookieSrc.  The other input 'bookieDest' is optional and if passed, we will recover all data to that bookie server specifically.  Otherwise for each ledger being recovered that was stored on the bookieSrc, we choose one of the other available bookie servers and re-replicate the ledger fragment entries to there.

A command line way to invoke this is done via a main method in BookKeeperTools which expects the following 2-3 input parameters.
"USAGE: BookKeeperTools zkServers bookieSrc [bookieDest]"
zkServers is a comma separated list of host:port pairs for the ZooKeeper servers in the cluster.
bookieSrc is the host:port for the bookie server we are recovering data from.
bookieDest is the host:port (optional) for the bookie server we want to recover the data to.

Current limitations: There is no way to know what each ledger's digest type or key/password are.  That metadata isn't stored anywhere we can access readily.  Thus for now, we are assuming that all ledgers to be recovered have been created with the same digest type and password.  These values are set via java system properties called "digestType" and "passwd".  Once we have  a way to store and retrieve this information (via ZK most likely and stored by the Bookie servers when new ledgers are created), we can modify this aspect of the bookie recovery tool.

Pseudocode:
Inputs: 
zkServers - Used to create a ZK client so we can read in all of the BK metadata needed to perform the bookie recovery.
bookieSrc - Used to match against ledger metadata indicating which bookie servers comprise the ensembles that make up a ledger.
bookieDest - Optionally used to write the recovered ledger data to directly.

1. Sync with ZK
2. Read from ZK to get all available bookie servers (only if bookieDest was not passed).
3. Read from ZK to get all active ledgers.
4. For each ledger, open it to obtain the LedgerHandle.
5. For each ledger fragment, see if the dead input bookieSrc is a part of the ensemble for it.
6. For each ledger fragment that needs to be recovered, find the entries that were actually stored on the bookieSrc. Since we stripe data across bookies in the ensemble, not all ledger entries in the fragment would have been stored on the bookieSrc.
7. For each of the ledger entries in the fragment that were stored on the bookieSrc, use the BookKeeper client to read it.  Using the client will take care of choosing one of the other bookies where this data is available since the bookieSrc server is dead.
8. Choosing a new bookieDest (either passed in explicitly or chosen at random currently among the available bookie servers), write this ledger entry directly to there using the BookieClient (the layer that talks to the bookie servers directly).
9. Once all ledger entries for all fragments for a ledger have been recovered and re-replicated, update ZK so the ledger's metadata now points to the new bookie server where this data has been re-replicated to.  We choose a single new bookie for each ledger to store the recovered data.

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-712) Bookie recovery

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated ZOOKEEPER-712:
------------------------------------

    Hadoop Flags: [Reviewed]

+1 looks good. thanx erwin!

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-712) Bookie recovery

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-712:
-----------------------------------

    Fix Version/s: 3.4.0

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-712) Bookie recovery

Posted by "Erwin Tam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwin Tam updated ZOOKEEPER-712:
--------------------------------

    Attachment: ZOOKEEPER-712.patch

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-712) Bookie recovery

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890524#action_12890524 ] 

Hudson commented on ZOOKEEPER-712:
----------------------------------

Integrated in ZooKeeper-trunk #881 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/881/])
    

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-712) Bookie recovery

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated ZOOKEEPER-712:
------------------------------------

        Status: Resolved  (was: Patch Available)
    Resolution: Fixed

Committed revision 962697.


> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-712) Bookie recovery

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880785#action_12880785 ] 

Hadoop QA commented on ZOOKEEPER-712:
-------------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12447283/ZOOKEEPER-712.patch
  against trunk revision 953041.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/118/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/118/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/118/console

This message is automatically generated.

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>         Attachments: ZOOKEEPER-712.patch
>
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ZOOKEEPER-712) Bookie recovery

Posted by "Erwin Tam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwin Tam reassigned ZOOKEEPER-712:
-----------------------------------

    Assignee: Erwin Tam

> Bookie recovery
> ---------------
>
>                 Key: ZOOKEEPER-712
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-712
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: contrib-bookkeeper
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Erwin Tam
>
> Recover the ledger fragments of a bookie once it crashes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.