virajjasani commented on a change in pull request #1828:
URL: https://github.com/apache/hbase/pull/1828#discussion_r434062695
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
##########
@@ -223,6 +226,41 @@ public void testReportForDutyWithMasterChange() throws
Exception {
}
+ /**
+ * Tests region sever reportForDuty with manual environment edge
+ */
+ @Test(timeout = 60000)
Review comment:
Yeah, this looks good 👍
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RSProcedureDispatcher.java
##########
@@ -233,13 +234,19 @@ public void run() {
private int numberOfAttemptsSoFar = 0;
private long maxWaitTime = -1;
+ private final long rsRpcRetryInterval;
+ public static final String RS_RPC_RETRY_INTERVAL_CONF_KEY =
Review comment:
Can be `private`?
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
##########
@@ -223,6 +226,41 @@ public void testReportForDutyWithMasterChange() throws
Exception {
}
+ /**
+ * Tests region sever reportForDuty with manual environment edge
+ */
+ @Test(timeout = 60000)
+ public void testReportForDutyWithEnvironmentEdge() throws Exception {
+ // Start a master and wait for it to become the active/primary master.
+ // Use a random unique port
+ cluster.getConfiguration().setInt(HConstants.MASTER_PORT,
HBaseTestingUtility.randomFreePort());
+ // Set the dispatch and retry delay to 0 since we want the rpc request to
be sent immediately
+
cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec",
0);
+ cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval",
0);
+
+ // master has a rs. defaultMinToStart = 2
+ boolean tablesOnMaster =
LoadBalancer.isTablesOnMaster(testUtil.getConfiguration());
+
cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART,
+ tablesOnMaster ? 2 : 1);
+
cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART,
+ tablesOnMaster ? 2 : 1);
+
+ EnvironmentEdge previousEdge = EnvironmentEdgeManager.getDelegate();
+ // Inject manual environment edge for clock skew computation between RS
and master
+ ManualEnvironmentEdge edge = new ManualEnvironmentEdge();
+ EnvironmentEdgeManager.injectEdge(edge);
+ master = cluster.addMaster();
+ rs = cluster.addRegionServer();
+ LOG.debug("Starting master: " + master.getMaster().getServerName());
+ master.start();
+ rs.start();
+
+ waitForClusterOnline(master);
+
+ // Reset the manual environment edge
+ EnvironmentEdgeManager.injectEdge(previousEdge);
Review comment:
This reset is done so that other tests don't get our manual edge right?
----------------------------------------------------------------
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]