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

RegionServer confused about empty row keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.89.20100621, 0.89.20100924, 0.90.0, 0.90.1, 0.90.2, 0.90.3, 0.90.4, 0.90.5, 0.90.6, 0.92.0, 0.92.1
    • 0.95.0
    • regionserver
    • None
    • Reviewed
    • If no row specified by a Get, we no longer return first row in the table. Now we fail.

    Description

      I'm no longer sure about the expected behavior when using an empty row key (e.g. a 0-byte long byte array). I assumed that this was a legitimate row key, just like having an empty column qualifier is allowed. But it seems that the RegionServer considers the empty row key to be whatever the first row key is.

      Version: 0.89.20100830, r0da2890b242584a8a5648d83532742ca7243346b, Sat Sep 18 15:30:09 PDT 2010
      
      hbase(main):001:0> scan 'tsdb-uid', {LIMIT => 1}
      ROW                           COLUMN+CELL                                                                          
       \x00                         column=id:metrics, timestamp=1288375187699, value=foo      
       \x00                         column=id:tagk, timestamp=1287522021046, value=bar         
       \x00                         column=id:tagv, timestamp=1288111387685, value=qux      
      1 row(s) in 0.4610 seconds
      
      hbase(main):002:0> get 'tsdb-uid', ''
      COLUMN                        CELL                                                                                 
       id:metrics                   timestamp=1288375187699, value=foo                         
       id:tagk                      timestamp=1287522021046, value=bar                         
       id:tagv                      timestamp=1288111387685, value=qux                      
      3 row(s) in 0.0910 seconds
      
      hbase(main):003:0> get 'tsdb-uid', "\000"
      COLUMN                        CELL                                                                                 
       id:metrics                   timestamp=1288375187699, value=foo                         
       id:tagk                      timestamp=1287522021046, value=bar                         
       id:tagv                      timestamp=1288111387685, value=qux                      
      3 row(s) in 0.0550 seconds
      

      This isn't a parsing problem with the command-line of the shell. I can reproduce this behavior both with plain Java code and with my asynchbase client.

      Since I don't actually have a row with an empty row key, I expected that the first get would return nothing.

      Attachments

        1. 3170v5.txt
          7 kB
          Michael Stack
        2. 3170-v3.patch
          7 kB
          Ted Yu
        3. 3170-v3.patch
          7 kB
          Ted Yu
        4. 3170-v2.patch
          8 kB
          Ted Yu
        5. 3170-5.patch
          5 kB
          Devaraj Das
        6. 3170-4.patch
          6 kB
          Devaraj Das
        7. 3170-3.patch
          6 kB
          Devaraj Das
        8. 3170-1.patch
          7 kB
          Devaraj Das
        9. 3170-0.94.patch
          4 kB
          Devaraj Das

        Activity

          People

            ddas Devaraj Das
            tsuna Benoit Sigoure
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: