Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-28330

TestUnknownServers.testListUnknownServers is flaky in branch-2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5.7
    • 2.6.0, 2.5.8
    • test
    • None

    Description

      [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.913 s <<< FAILURE! - in org.apache.hadoop.hbase.master.TestUnknownServers
      [ERROR] org.apache.hadoop.hbase.master.TestUnknownServers.testListUnknownServers  Time elapsed: 0.204 s  <<< FAILURE!
      java.lang.AssertionError: expected:<1> but was:<2> 

      The value of TestUnknownServers.SLAVES is different between branch-2 and master.

      It is 1 in master but 2 in branch-2.

      The RegionServer marked UNKNOWN_SERVER is the one that holds regions but is not tracked by the ServerManager.

      Please see HMaster.getUnknownServers

      private List<ServerName> getUnknownServers() {
        if (serverManager != null) {
          final Set<ServerName> serverNames = getAssignmentManager().getRegionStates().getRegionStates()
            .stream().map(RegionState::getServerName).collect(Collectors.toSet());
          final List<ServerName> unknownServerNames = serverNames.stream()
            .filter(sn -> sn != null && serverManager.isServerUnknown(sn)).collect(Collectors.toList());
          return unknownServerNames;
        }
        return null;
      } 

      In UT TestUnknownServers.testListUnknownServers, we start a HBase cluster with 2 RegionServer, if all region are assigned to ONE server, then only that server is called UNKNOWN_SERVER, the UT will fail.

      Attachments

        Issue Links

          Activity

            People

              Ddupg Sun Xin
              Ddupg Sun Xin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: