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

Wrong key is used in ServerManager#getServerConnection() to retrieve from Map serverConnections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.0
    • 0.94.6
    • master
    • None
    • Reviewed

    Description

      ServerManager#getServerConnection() try to retrieve the cached connection from Map serverConnections. ServerName objects are the key with which items are saved in this map. But we use String type to get. This always returns null and in turn the Master creates a new connection with RS again and again.

      private final Map<ServerName, HRegionInterface> serverConnections =
          new HashMap<ServerName, HRegionInterface>();
      ...........
      private HRegionInterface getServerConnection(final ServerName sn)
        throws IOException {
          HRegionInterface hri = this.serverConnections.get(sn.toString());
          if (hri == null) {
            LOG.debug("New connection to " + sn.toString());
            hri = this.connection.getHRegionConnection(sn.getHostname(), sn.getPort());
            this.serverConnections.put(sn, hri);
          }
          return hri;
        }
      

      Attachments

        1. HBASE-7919_94.patch
          0.7 kB
          Anoop Sam John

        Activity

          People

            anoopsamjohn Anoop Sam John
            anoopsamjohn Anoop Sam John
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: