Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5546

TASK_TS being set as HConstants.LATEST_TIMESTAMP in SYSTEM.TASK table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.15.0, 5.1.0
    • 4.15.0, 5.1.0
    • None
    • None

    Description

      When we upsert DropChildViewTask entries into SYSTEM.TASK, the TASK_TS field which is designated as a ROW_TIMESTAMP always gets the HConstants.LATEST_TIMESTAMP value instead of the current server-side wall clock time.

      The main side-effect of this bug is, subsequent creation and dropping of the same base table will not upsert new DropChildViewTasks into the SYSTEM.TASK table.

      Steps to reproduce:
      1) Start HBase server with 4.15.0 Phoenix
      2) Create a base table and a view on top of that base table:

      CREATE TABLE IF NOT EXISTS Z_BASE_TABLE (ID INTEGER NOT NULL PRIMARY KEY, HOST VARCHAR(10), FLAG BOOLEAN);
      
      CREATE VIEW Z_VIEW1 (col1 INTEGER, col2 INTEGER, col3 INTEGER, col4 INTEGER, col5 INTEGER) AS SELECT * FROM Z_BASE_TABLE WHERE ID>10;
      

      3) Drop the base table with the cascade option:

      DROP TABLE Z_BASE_TABLE CASCADE;
      

      4) Observe the SYSTEM.TASK table:

      SELECT TASK_TYPE, TASK_TS, TABLE_NAME, TASK_STATUS FROM SYSTEM.TASK;
      

      --> gives the following:

      +------------+-------------------------------+---------------+--------------+
      | TASK_TYPE  |            TASK_TS            |  TABLE_NAME   | TASK_STATUS  |
      +------------+-------------------------------+---------------+--------------+
      | 1          | 292278994-08-16 23:12:55.807  | Z_BASE_TABLE  | COMPLETED    |
      +------------+-------------------------------+---------------+--------------+
      

      That timestamp is basically HConstants.LATEST_TIMESTAMP.

      5) Recreate the base table and view, then drop the base table, then observe SYSTEM.TASK again (Steps 2 to 4) and no new DropChildViewTask is added for the base table created the second time

      +------------+-------------------------------+---------------+--------------+
      | TASK_TYPE  |            TASK_TS            |  TABLE_NAME   | TASK_STATUS  |
      +------------+-------------------------------+---------------+--------------+
      | 1          | 292278994-08-16 23:12:55.807  | Z_BASE_TABLE  | COMPLETED    |
      +------------+-------------------------------+---------------+--------------+
      

      Thus, the views are still there and this seems to be an issue with the ROW_TIMESTAMP being assigned HConstants.LATEST_TIMESTAMP.

      Attachments

        1. sqlline-after-change.png
          104 kB
          Chinmay Kulkarni
        2. sqlline.png
          92 kB
          Chinmay Kulkarni
        3. PHOENIX-5546-4.x-HBase-1.3-v2.patch
          20 kB
          Chinmay Kulkarni
        4. PHOENIX-5546-4.x-HBase-1.3-v1.patch
          17 kB
          Chinmay Kulkarni
        5. MaxTs-repro-test.txt
          2 kB
          Chinmay Kulkarni
        6. created-after-change.png
          112 kB
          Chinmay Kulkarni
        7. created.png
          130 kB
          Chinmay Kulkarni
        8. completed-after-change.png
          125 kB
          Chinmay Kulkarni
        9. completed.png
          185 kB
          Chinmay Kulkarni

        Issue Links

          Activity

            People

              ckulkarni Chinmay Kulkarni
              ckulkarni Chinmay Kulkarni
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m