HBase
  1. HBase
  2. HBASE-2366

We should store table metadata in a single location, for HDFS table recovery, not on every region

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: regionserver
    • Labels:
      None
    • Environment:

      CentOS 5.4, x86_64

      Description

      Right now, every region has a .regioninfo file that describes what the region contains. This is used by the add_table tool to recover a table from HDFS, when there are problems with the .META. table. Right now the .regioninfo file stores both region-specific as well as table-specific metadata (the columns), which can cause problems.

      One such problem appears when some of the .regioninfo files are not updates. Workflow to reproduce this is:
      1. Create a new table with a list of columns.
      2. Push some data into the table, so at least one region exists.
      3. Do an ALTER on the table and add some new columns.
      3.1 Look at one of the .regioninfo files. They still contain the old list of columns.
      4. Push some more data into the table, containing values for the new columns.
      5. Run add_table.rb on this table.
      6. Try to push the data at point 4 again. You will get errors - NoSuchColumnFamilyExists exception.

      in our specific case, 10 out of the 140 regions of a table had the initial list of columns, and the others were updated (as part of splits, as we deduced). We had to run add_table, which replaced the .META. entries with the ones on disk, and as a result we couldn't get to our data anymore. Re-writing the .regioninfo with the correct column list (as done in HRegion.java) and re-adding the table fixed it for us,.

      It should be possible to store the table information in a single location (e.g. /hbase/table_name/.tableinfo maybe?) and work on it on table create / alter which would prevent this case from happening again.

        Issue Links

          Activity

          Cristian Ivascu created issue -
          Cristian Ivascu made changes -
          Field Original Value New Value
          Link This issue is related to HBASE-1342 [ HBASE-1342 ]
          Hide
          stack added a comment -

          Agreed. Its suboptimal (speaking euphemistically) the way it works now. Part of the master rewrite, HBASE-1816, hopefully for 0.21, includes moving schema out of .META. and up into zookeeper. Table schema including column family schemas will all be written to a single znode that all regionservers watch (on change, RSs update schema).

          Show
          stack added a comment - Agreed. Its suboptimal (speaking euphemistically) the way it works now. Part of the master rewrite, HBASE-1816 , hopefully for 0.21, includes moving schema out of .META. and up into zookeeper. Table schema including column family schemas will all be written to a single znode that all regionservers watch (on change, RSs update schema).
          Jarrod Cuzens made changes -
          Link This issue relates to HBASE-1867 [ HBASE-1867 ]
          Hide
          stack added a comment -

          Moved from 0.21 to 0.22 just after merge of old 0.20 branch into TRUNK.

          Show
          stack added a comment - Moved from 0.21 to 0.22 just after merge of old 0.20 branch into TRUNK.
          stack made changes -
          Fix Version/s 0.22.0 [ 12314223 ]
          Fix Version/s 0.21.0 [ 12313607 ]
          Hide
          stack added a comment -

          Cristian 's idea above of a .tableinfo instead of a .regioninfo is a big improvement over what we currently do.

          Show
          stack added a comment - Cristian 's idea above of a .tableinfo instead of a .regioninfo is a big improvement over what we currently do.
          Hide
          stack added a comment -

          Moving out of 0.92.0. Pull it back in if you think different.

          Show
          stack added a comment - Moving out of 0.92.0. Pull it back in if you think different.
          stack made changes -
          Fix Version/s 0.92.0 [ 12314223 ]
          Hide
          stack added a comment -

          Resolving as duplicate. Subbu is doing what Cristian suggests over in HBASE-451

          Show
          stack added a comment - Resolving as duplicate. Subbu is doing what Cristian suggests over in HBASE-451
          stack made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Cristian Ivascu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development