hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suresh Srinivas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-1974) HA: Introduce active and standby states to the namenode
Date Wed, 20 Jul 2011 21:25:58 GMT

    [ https://issues.apache.org/jira/browse/HDFS-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068653#comment-13068653

Suresh Srinivas commented on HDFS-1974:

Here is design notes.

h3. Namenode will have two states related to high availability:
# Active - In this state namenode supports all the services related to namespace and operations
related to it.
# Standby - In this state, namenode acts as warm standby and will have updated namespace and
block locations map.

h3. State machine implementation:
State machine is implemented using state pattern - http://en.wikipedia.org/wiki/State_pattern.

The base state has the following main methods:
abstract class State {
  /** Handler to transition from standby to active state */
  protected abstract void standbyToActive(NameNode nn)

  /** Handler to transition from active to standby state */
  protected abstract void activeToStandby(NameNode nn)
      throws ServiceFailedException;

  /** Method to be overridden by subclasses to perform steps start services
  required while entering a state.  */
  protected void enterState(NameNode nn) throws ServiceFailedException {
    // Nothing to do

  /** Method to be overridden by subclasses to cleanup/stop services while
   exiting a state.  */
  protected void exitState(NameNode nn) throws ServiceFailedException {
    // Nothing to do

h3. Key points:
# State does not have any members of its own. It only implements the logic necessary with
in a state. Namenode is the context for the state, using which state performs necessary function.
# Active and Standby extend this state.
# Namenode will have singletons for ActiveState and StandbyState.
#* Namenode#state points to either ActiveState or StandbyState.
#* There is no need to write if (state is Active) then do. Such decision is deleagated to
the state it self. The concrete state will provide necessary specialization.
#* Some examples such specialization: checking if a certain read/write/checkpoint operation
is supported in a state. For example ActiveState will allow Read/Write operations. StandbyState
currently does not support any of these operations. We could enhance StandbyState to support
read operations in the future.

h3. Open items that will be addressed in a separate jira:
# What services should start when entering ActiveState and StandbyState. What services should
stop when exiting ActiveState and StandbyState.
# Should StandbyState allow read operations.

Please see the initial code. Will udpate HDFS-1623 with the design information.

> HA: Introduce active and standby states to the namenode
> -------------------------------------------------------
>                 Key: HDFS-1974
>                 URL: https://issues.apache.org/jira/browse/HDFS-1974
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: name-node
>            Reporter: Suresh Srinivas
>            Assignee: Suresh Srinivas
>         Attachments: HDFS-1974.1.patch, HDFS-1974.patch
> Currently namenode supports active, secondary and backup roles. To support namenode high
availability, active and standby states are needed. Note that this is different from the existing
notion of namenode role, where a namenode cannot transition from one role to the other.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message