[48/50] [abbrv] hbase git commit: HBASE-19082 Reject read/write from client but accept write from replication in state S
HBASE-19082 Reject read/write from client but accept write from replication in state S Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/31dd23da Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/31dd23da Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/31dd23da Branch: refs/heads/HBASE-19064 Commit: 31dd23dab066f547e18602eef21561ceac8649fb Parents: fc4f562 Author: zhangduoAuthored: Mon Feb 12 18:20:18 2018 +0800 Committer: zhangduo Committed: Sun Apr 8 17:16:00 2018 +0800 -- .../org/apache/hadoop/hbase/HConstants.java | 3 - .../src/main/protobuf/MasterProcedure.proto | 3 +- .../hbase/replication/ReplicationUtils.java | 4 + ...ransitPeerSyncReplicationStateProcedure.java | 10 + .../hadoop/hbase/regionserver/HRegion.java | 5 +- .../hbase/regionserver/HRegionServer.java | 2 +- .../hbase/regionserver/RSRpcServices.java | 88 ++-- .../RejectRequestsFromClientStateChecker.java | 44 .../regionserver/ReplicationSink.java | 72 --- .../SyncReplicationPeerInfoProvider.java| 10 +- .../SyncReplicationPeerInfoProviderImpl.java| 19 +- .../hbase/wal/SyncReplicationWALProvider.java | 3 + .../org/apache/hadoop/hbase/wal/WALFactory.java | 4 +- .../hbase/replication/TestSyncReplication.java | 200 +++ .../wal/TestSyncReplicationWALProvider.java | 8 +- 15 files changed, 401 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/31dd23da/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java -- diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 522c2cf..9241682 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -1355,9 +1355,6 @@ public final class HConstants { public static final String NOT_IMPLEMENTED = "Not implemented"; - // TODO: need to find a better place to hold it. - public static final String SYNC_REPLICATION_ENABLED = "hbase.replication.sync.enabled"; - private HConstants() { // Can't be instantiated with this ctor. } http://git-wip-us.apache.org/repos/asf/hbase/blob/31dd23da/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto -- diff --git a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto index d1003b9..bd4b320 100644 --- a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto +++ b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto @@ -392,7 +392,8 @@ enum PeerSyncReplicationStateTransitionState { REOPEN_ALL_REGIONS_IN_PEER = 5; TRANSIT_PEER_NEW_SYNC_REPLICATION_STATE = 6; REFRESH_PEER_SYNC_REPLICATION_STATE_ON_RS_END = 7; - POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 8; + CREATE_DIR_FOR_REMOTE_WAL = 8; + POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 9; } message PeerModificationStateData { http://git-wip-us.apache.org/repos/asf/hbase/blob/31dd23da/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index e4dea83..d94cb00 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -37,6 +37,10 @@ import org.apache.yetus.audience.InterfaceAudience; @InterfaceAudience.Private public final class ReplicationUtils { + public static final String SYNC_REPLICATION_ENABLED = "hbase.replication.sync.enabled"; + + public static final String REPLICATION_ATTR_NAME = "__rep__"; + private ReplicationUtils() { } http://git-wip-us.apache.org/repos/asf/hbase/blob/31dd23da/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java index 8fc932f..69404a0 100644 ---
[48/50] [abbrv] hbase git commit: HBASE-19082 Reject read/write from client but accept write from replication in state S
HBASE-19082 Reject read/write from client but accept write from replication in state S Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/595ac441 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/595ac441 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/595ac441 Branch: refs/heads/HBASE-19064 Commit: 595ac441f9bb87b1f7cb83fc5253cfbd709f7927 Parents: b54b94b Author: zhangduoAuthored: Mon Feb 12 18:20:18 2018 +0800 Committer: zhangduo Committed: Thu Feb 22 14:48:42 2018 +0800 -- .../org/apache/hadoop/hbase/HConstants.java | 3 - .../src/main/protobuf/MasterProcedure.proto | 3 +- .../hbase/replication/ReplicationUtils.java | 4 + ...ransitPeerSyncReplicationStateProcedure.java | 10 + .../hadoop/hbase/regionserver/HRegion.java | 5 +- .../hbase/regionserver/HRegionServer.java | 2 +- .../hbase/regionserver/RSRpcServices.java | 89 +++-- .../RejectRequestsFromClientStateChecker.java | 44 .../regionserver/ReplicationSink.java | 72 --- .../SyncReplicationPeerInfoProvider.java| 10 +- .../SyncReplicationPeerInfoProviderImpl.java| 19 +- .../hbase/wal/SyncReplicationWALProvider.java | 3 + .../org/apache/hadoop/hbase/wal/WALFactory.java | 4 +- .../hbase/replication/TestSyncReplication.java | 200 +++ .../wal/TestSyncReplicationWALProvider.java | 8 +- 15 files changed, 401 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/595ac441/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java -- diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 4664778..1cd6f89 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -1351,9 +1351,6 @@ public final class HConstants { public static final String NOT_IMPLEMENTED = "Not implemented"; - // TODO: need to find a better place to hold it. - public static final String SYNC_REPLICATION_ENABLED = "hbase.replication.sync.enabled"; - private HConstants() { // Can't be instantiated with this ctor. } http://git-wip-us.apache.org/repos/asf/hbase/blob/595ac441/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto -- diff --git a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto index 8cc5c81..2bf634b 100644 --- a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto +++ b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto @@ -382,7 +382,8 @@ enum PeerSyncReplicationStateTransitionState { REOPEN_ALL_REGIONS_IN_PEER = 5; TRANSIT_PEER_NEW_SYNC_REPLICATION_STATE = 6; REFRESH_PEER_SYNC_REPLICATION_STATE_ON_RS_END = 7; - POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 8; + CREATE_DIR_FOR_REMOTE_WAL = 8; + POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 9; } message PeerModificationStateData { http://git-wip-us.apache.org/repos/asf/hbase/blob/595ac441/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index d633be9..9d0c05d 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -37,6 +37,10 @@ import org.apache.yetus.audience.InterfaceAudience; @InterfaceAudience.Private public final class ReplicationUtils { + public static final String SYNC_REPLICATION_ENABLED = "hbase.replication.sync.enabled"; + + public static final String REPLICATION_ATTR_NAME = "__rep__"; + private ReplicationUtils() { } http://git-wip-us.apache.org/repos/asf/hbase/blob/595ac441/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java index c253bff..e53abc0 100644 ---