Details
Description
When Region server's time is ahead of Master's time and the difference is more than hbase.master.maxclockskew value, region server startup is not failing with ClockOutOfSyncException.
This causes some abnormal behavior as detected by our Tests.
ServerManager.java#checkClockSkew
long skew = System.currentTimeMillis() - serverCurrentTime;
if (skew > maxSkew)
Above line results in negative value when Master's time is lesser than region server time and " if (skew > maxSkew) " check fails to find the skew in this case.
Please Note: This was tested in hbase 0.94.11 version and the trunk also currently has the same logic.
The fix for the same would be to make the skew positive value first as below:
long skew = System.currentTimeMillis() - serverCurrentTime;
skew = (skew < 0 ? -skew : skew);
if (skew > maxSkew) {.....