This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch HBASE-24666 in repository https://gitbox.apache.org/repos/asf/hbase.git
commit add13ab6072484fcdda248ed082a4f9cdace6d1a Author: XinSun <ddu...@gmail.com> AuthorDate: Mon May 24 11:54:00 2021 +0800 HBASE-25807 Move method reportProcedureDone from RegionServerStatus.proto to Master.proto (#3205) Signed-off-by: Duo Zhang <zhang...@apache.org> --- .../src/main/protobuf/server/master/Master.proto | 20 ++++++++++++++++++++ .../protobuf/server/master/RegionServerStatus.proto | 21 +++++---------------- .../hadoop/hbase/master/MasterRpcServices.java | 6 +++--- .../master/MasterRpcServicesVersionWrapper.java | 5 +++-- .../hadoop/hbase/regionserver/HRegionServer.java | 2 +- .../regionserver/RemoteProcedureResultReporter.java | 7 +++---- 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/hbase-protocol-shaded/src/main/protobuf/server/master/Master.proto b/hbase-protocol-shaded/src/main/protobuf/server/master/Master.proto index b9ed476..13b3a35 100644 --- a/hbase-protocol-shaded/src/main/protobuf/server/master/Master.proto +++ b/hbase-protocol-shaded/src/main/protobuf/server/master/Master.proto @@ -735,6 +735,23 @@ message ListReplicationSinkServersResponse { repeated ServerName server_name = 1; } +message RemoteProcedureResult { + required uint64 proc_id = 1; + enum Status { + SUCCESS = 1; + ERROR = 2; + } + required Status status = 2; + optional ForeignExceptionMessage error = 3; +} + +message ReportProcedureDoneRequest { + repeated RemoteProcedureResult result = 1; +} + +message ReportProcedureDoneResponse { +} + service MasterService { /** Used by the client to get the number of regions that have received the updated schema */ rpc GetSchemaAlterStatus(GetSchemaAlterStatusRequest) @@ -1171,6 +1188,9 @@ service MasterService { rpc ListReplicationSinkServers(ListReplicationSinkServersRequest) returns (ListReplicationSinkServersResponse); + + rpc ReportProcedureDone(ReportProcedureDoneRequest) + returns(ReportProcedureDoneResponse); } // HBCK Service definitions. diff --git a/hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto b/hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto index c894a77..f3547da 100644 --- a/hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto +++ b/hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto @@ -29,6 +29,7 @@ option optimize_for = SPEED; import "HBase.proto"; import "server/ClusterStatus.proto"; import "server/ErrorHandling.proto"; +import "server/master/Master.proto"; message RegionServerStartupRequest { /** Port number this regionserver is up on */ @@ -147,22 +148,6 @@ message RegionSpaceUseReportRequest { message RegionSpaceUseReportResponse { } -message RemoteProcedureResult { - required uint64 proc_id = 1; - enum Status { - SUCCESS = 1; - ERROR = 2; - } - required Status status = 2; - optional ForeignExceptionMessage error = 3; -} -message ReportProcedureDoneRequest { - repeated RemoteProcedureResult result = 1; -} - -message ReportProcedureDoneResponse { -} - message FileArchiveNotificationRequest { message FileWithSize { optional TableName table_name = 1; @@ -211,6 +196,10 @@ service RegionServerStatusService { rpc ReportRegionSpaceUse(RegionSpaceUseReportRequest) returns(RegionSpaceUseReportResponse); + /** + * In HBASE-25807 this method was moved to Master.proto as replication server also need this. + * To avoid problems during upgrading, still keep this method here. + */ rpc ReportProcedureDone(ReportProcedureDoneRequest) returns(ReportProcedureDoneResponse); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index c17d699..b7c0bff 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -291,6 +291,9 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.OfflineReg import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RecommissionRegionServerRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RecommissionRegionServerResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RegionSpecifierAndState; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoteProcedureResult; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ReportProcedureDoneRequest; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ReportProcedureDoneResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RunCatalogScanRequest; @@ -378,9 +381,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProto import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionSpaceUse; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionSpaceUseReportRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionSpaceUseReportResponse; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RemoteProcedureResult; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportProcedureDoneRequest; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportProcedureDoneResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRSFatalErrorRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRSFatalErrorResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionRequest; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServicesVersionWrapper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServicesVersionWrapper.java index a98f5ae..b35b24c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServicesVersionWrapper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServicesVersionWrapper.java @@ -24,6 +24,7 @@ import org.apache.yetus.audience.InterfaceAudience; import org.apache.hbase.thirdparty.com.google.protobuf.RpcController; import org.apache.hbase.thirdparty.com.google.protobuf.ServiceException; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos; /** @@ -96,8 +97,8 @@ public class MasterRpcServicesVersionWrapper } @Override - public RegionServerStatusProtos.ReportProcedureDoneResponse reportProcedureDone( - RpcController controller, RegionServerStatusProtos.ReportProcedureDoneRequest request) + public MasterProtos.ReportProcedureDoneResponse reportProcedureDone( + RpcController controller, MasterProtos.ReportProcedureDoneRequest request) throws ServiceException { return masterRpcServices.reportProcedureDone(controller, request); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index a5eb4e7..21fab00 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -223,6 +223,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionServe import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier; import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType; import org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockService; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ReportProcedureDoneRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.GetLastFlushedSequenceIdRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.GetLastFlushedSequenceIdResponse; @@ -234,7 +235,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProto import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionSpaceUseReportRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportProcedureDoneRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRSFatalErrorRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionResponse; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RemoteProcedureResultReporter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RemoteProcedureResultReporter.java index 63e050a..e8c1766 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RemoteProcedureResultReporter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RemoteProcedureResultReporter.java @@ -30,8 +30,8 @@ import org.slf4j.LoggerFactory; import org.apache.hbase.thirdparty.com.google.protobuf.TextFormat; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RemoteProcedureResult; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportProcedureDoneRequest; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoteProcedureResult; +import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ReportProcedureDoneRequest; /** * A thread which calls {@code reportProcedureDone} to tell master the result of a remote procedure. @@ -101,8 +101,7 @@ class RemoteProcedureResultReporter extends Thread { } LOG.info("Failed procedure report " + TextFormat.shortDebugString(request) + "; retry (#" + tries + ")" + (pause ? " after " + pauseTime + "ms delay (Master is coming online...)." - : " immediately."), - e); + : " immediately."), e); Threads.sleep(pauseTime); tries++; }