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

Hbase shell command 'scan' for non existent table shows unnecessary info for one unrelated existent table.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.1.0, 2.0.0
    • Client
    • None
    • Reviewed

    Description

      When scanning for a non existent table in hbase shell, error message in shell sometimes(based on META table content) displays completely unrelated table info , which seems to be unnecessary and inconsistent with other error messages:

      hbase(main):016:0> scan 'noTable'
      ROW                                              COLUMN+CELL
      
      ERROR: Unknown table Table 'noTable' was not found, got: hbase:namespace.!
      ---------------------------------------------------------------------------------------------
      hbase(main):017:0> scan '01_noTable'
      ROW                                              COLUMN+CELL
      
      ERROR: Unknown table 01_noTable!
      --------------------------------------------------
      

      Its happening when doing a META table scan (to locate input table ) and scanner stops at row of another table (beyond which table can not exist) in ConnectionManager.locateRegionInMeta:

      private RegionLocations locateRegionInMeta(TableName tableName, byte[] row,
                         boolean useCache, boolean retry, int replicaId) throws IOException {
      .................................
      ................................
      // possible we got a region of a different table...
                if (!regionInfo.getTable().equals(tableName)) {
                  throw new TableNotFoundException(
                        "Table '" + tableName + "' was not found, got: " +
                        regionInfo.getTable() + ".");
                }
      ...............................
      ...............................
      

      Here, we can simply put a debug message(if required) and just throw the TableNotFoundException(tableName) with only tableName instead of with scanner positioned row.

      Attachments

        1. HBASE-13058_v2_rebased.patch
          2 kB
          Srikanth Srungarapu
        2. HBASE-13058-v2.patch
          3 kB
          Abhishek Kumar
        3. 0001-HBASE-13058-shell-unknown-table-message-update.patch
          2 kB
          Abhishek Kumar
        4. 0001-HBASE-13058-Error-messages-in-scan-table.patch
          1 kB
          Abhishek Kumar

        Activity

          People

            a72877 Abhishek Kumar
            a72877 Abhishek Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: