Review Board 1.7.22


Support for fault tolerant, instant schema updates with out master's intervention

Review Request #1786 - Created Sept. 11, 2011 and updated

Ted Yu
trunk
Reviewers
apurtell, Subbu, tlipcon
hbase
From Subbu:
here is the latest patch that support alter_instant, an instant schema change command that supports (Add, Modify, Delete column and Modify table) actions through ZK.

1. This pattern capitalizes on the fact that HRI's are now in HDFS and need not be sent over again from Master to RS cloud on every schema change event.

2. Offers real time instant schema change as we bypass the explicit bulk reassign (unassign + assign) of regions from master to RS.

3. Offers fault tolerant schema change support as schema changes now go through ZK. Secondary master taking over a failed schema change will be addressed through a separate JIRA.
Unit tests pass.

Diff revision 6

This is not the most recent revision of the diff. The latest diff is revision 8. See what's changed.

1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8

  1. /src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java: Loading...
  2. /src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java: Loading...
  3. /src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java: Loading...
  4. /src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java: Loading...
  5. /src/main/java/org/apache/hadoop/hbase/master/HMaster.java: Loading...
  6. /src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java: Loading...
  7. /src/main/java/org/apache/hadoop/hbase/master/MasterServices.java: Loading...
  8. /src/main/java/org/apache/hadoop/hbase/master/ServerManager.java: Loading...
  9. /src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java: Loading...
  10. /src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java: Loading...
  11. /src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java: Loading...
  12. /src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java: Loading...
  13. /src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java: Loading...
  14. /src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java: Loading...
  15. /src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java: Loading...
  16. /src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java: Loading...
  17. /src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java: Loading...
  18. /src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java: Loading...
  19. /src/main/java/org/apache/hadoop/hbase/zookeeper/SchemaChangeTracker.java: Loading...
  20. /src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java: Loading...
  21. /src/main/resources/hbase-default.xml: Loading...
  22. /src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChange.java: Loading...
  23. /src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChangeFailover.java: Loading...
  24. /src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java: Loading...
  25. /src/test/java/org/apache/hadoop/hbase/util/MockRegionServerServices.java: Loading...
/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
Revision 1202381 New Change
[20] 302 lines
[+20] [+] public HMaster getMaster(int serverNumber) {
303
   * null.
303
   * null.
304
   * @return the HMaster for the active master
304
   * @return the HMaster for the active master
305
   */
305
   */
306
  public HMaster getActiveMaster() {
306
  public HMaster getActiveMaster() {
307
    for (JVMClusterUtil.MasterThread mt : masterThreads) {
307
    for (JVMClusterUtil.MasterThread mt : masterThreads) {
308
      if (mt.getMaster().isActiveMaster()) {
308
      // Ensure that the current active master is not stopped.

    
   
309
      // We don't want to return a stopping master as an active master.

    
   
310
      if (mt.getMaster().isActiveMaster()  && !mt.getMaster().isStopped()) {
309
        return mt.getMaster();
311
        return mt.getMaster();
310
      }
312
      }
311
    }
313
    }
312
    return null;
314
    return null;
313
  }
315
  }
[+20] [20] 139 lines
/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java
Revision 1202523 New Change
 
/src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java
Revision 1202381 New Change
 
/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java
New File
 
/src/main/java/org/apache/hadoop/hbase/zookeeper/SchemaChangeTracker.java
New File
 
/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java
Revision 1202381 New Change
 
/src/main/resources/hbase-default.xml
Revision 1202381 New Change
 
/src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChange.java
New File
 
/src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChangeFailover.java
New File
 
/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java
Revision 1202381 New Change
 
/src/test/java/org/apache/hadoop/hbase/util/MockRegionServerServices.java
Revision 1202381 New Change
 
  1. /src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java: Loading...
  2. /src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java: Loading...
  3. /src/main/java/org/apache/hadoop/hbase/ipc/HMasterInterface.java: Loading...
  4. /src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java: Loading...
  5. /src/main/java/org/apache/hadoop/hbase/master/HMaster.java: Loading...
  6. /src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java: Loading...
  7. /src/main/java/org/apache/hadoop/hbase/master/MasterServices.java: Loading...
  8. /src/main/java/org/apache/hadoop/hbase/master/ServerManager.java: Loading...
  9. /src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java: Loading...
  10. /src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java: Loading...
  11. /src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java: Loading...
  12. /src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java: Loading...
  13. /src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java: Loading...
  14. /src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java: Loading...
  15. /src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java: Loading...
  16. /src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java: Loading...
  17. /src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java: Loading...
  18. /src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java: Loading...
  19. /src/main/java/org/apache/hadoop/hbase/zookeeper/SchemaChangeTracker.java: Loading...
  20. /src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java: Loading...
  21. /src/main/resources/hbase-default.xml: Loading...
  22. /src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChange.java: Loading...
  23. /src/test/java/org/apache/hadoop/hbase/client/TestInstantSchemaChangeFailover.java: Loading...
  24. /src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java: Loading...
  25. /src/test/java/org/apache/hadoop/hbase/util/MockRegionServerServices.java: Loading...