saintstack opened a new pull request #2451:
URL: https://github.com/apache/hbase/pull/2451


   …hen hbase:meta assigned to RS
   
   Fill in gap left by HBASE-11183 'Timeline Consistent region replicas - Phase 
2 design'.
   HBASE-11183 left off implementing 'async WAL Replication' on the hbase:meta
   Table; hbase:meta Table could only do Phase 1 Region Replicas reading
   the primary Regions' hfiles. Here we add 'async WAL Replication' to
   hbase:meta so Replicas can be more current with the primary's changes.
   
   Adds a 'special' ReplicationSource that reads hbase:meta WAL files and 
replicates
   all edits to the configured in-cluster endpoint (Defaults to the
   RegionReadReplicaEndpoint.class -- set hbase.region.meta.replica.replication 
to
   target a different endpoint implementation).
   
   Set hbase.region.meta.replica.replication.enabled to enable async WAL
   Replication for hbase:meta region replicas. Its off by default.
   
   The HBaseMetaReplicationSource for async WAL Replication of hbase:meta does
   NOT need to keep up WAL offset or a queue of WALs-to-replicate in the
   replication queue store as is done in other ReplicationSource 
implementations;
   the HBaseMetaReplicationSource is for Region Replicas only. General
   Replication does not replicate hbase:meta. hbase:meta Region Replicas reset
   on crash of the primary replica so there is no need to 'recover'
   replication that was running on the crashed server.
   
   Because it so different in operation, the HBaseMetaReplicationSource is 
bolted
   on to the side of the ReplicationSourceManager. It is lazily
   instantiated to match the lazy instantiation of the hbase:meta
   WALProvider, created and started on the open of the first Region of an
   hbase:meta table. Thereafter it stays up till the process dies, even if
   all hbase:meta Regions have moved off the server, in case a hbase:meta
   Region is moved back (Doing this latter simplifies the implementation)
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
     Read configuration to see if we need to wait on setting a Region 
read-enabled
     (if so, replicas will only flip to enable read after confirming a
     flush of the primary so they for sure are a replica of a known point)
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/AssignRegionHandler.java
    If configured, on open of hbase:meta, ask the ReplicationSourceManager
    to add a ReplicationSource (if it hasn't already).
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/RegionReplicaFlushHandler.java
    Edit log message.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/UnassignRegionHandler.java
    If configured, on close of hbase:meta, update ReplicationSourceManager
    that a source Region has closed.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceFactory.java
    javadoc and make constructor private.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceInterface.java
    Add logPositionAndCleanOldLogs w/ default of the old behavior so
    HBaseMetaReplicationSource can bypass updating store with WAL position,
    etc.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
    Add creation and start of an HBaseMetaReplicationSource.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceShipper.java
    Go via ReplicationSource when calling logPostionAndCleanOldLogs.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALFileLengthProvider.java
    Javadoc.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
    Add utility for reading configurations for hbase:meta region replicas.
   
   hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALEdit.java
    Add an isFlushMarker utility.
   
   hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
    Javadoc.
   
   
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java
    Use define.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseMetaReplicationSource.java
    Specical version of ReplicationSource for Region Replicas on
    hbase:meta.
   
   
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseMetaReplicationSourcePeer.java
    Needs a special peer too (peers are baked into replication though we
    don't use 'peers' here)
   
   
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplicationEndpoint.java
   hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALProvider.java
    Tests.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to