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

Index mutations created by UPSERT SELECT will have wrong timestamps

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.14.0, 5.0.0
    • 4.15.0, 5.1.0, 4.14.2, 5.0.1
    • None
    • None

    Description

      When doing a full rebuild (or initial async build) of a local or global index using IndexTool and PhoenixIndexImportDirectMapper, or doing a synchronous initial build of a global index using the index create DDL, we generate the index mutations by using an UPSERT SELECT query from the base table to the index.

      The timestamps of the mutations use the default HBase behavior, which is to take the current wall clock. However, the timestamp of an index KeyValue should use the timestamp of the initial KeyValue in the base table.

      Having base table and index timestamps out of sync can cause all sorts of weird side effects, such as if the base table has data with an expired TTL that isn't expired in the index yet. Also inserting old mutations with new timestamps may overwrite the data that has been newly overwritten by the regular data path during index build, which would lead to data loss and inconsistency issues.

      Attachments

        1. PHOENIX-5018.master.004.patch
          71 kB
          Kadir OZDEMIR
        2. PHOENIX-5018.master.003.patch
          72 kB
          Kadir OZDEMIR
        3. PHOENIX-5018.master.002.patch
          71 kB
          Kadir OZDEMIR
        4. PHOENIX-5018.master.001.patch
          69 kB
          Kadir OZDEMIR
        5. PHOENIX-5018.4.x-HBase-1.4.002.patch
          71 kB
          Kadir OZDEMIR
        6. PHOENIX-5018.4.x-HBase-1.4.001.patch
          72 kB
          Kadir OZDEMIR
        7. PHOENIX-5018.4.x-HBase-1.3.002.patch
          71 kB
          Kadir OZDEMIR
        8. PHOENIX-5018.4.x-HBase-1.3.001.patch
          72 kB
          Kadir OZDEMIR

        Issue Links

          Activity

            People

              kozdemir Kadir OZDEMIR
              gjacoby Geoffrey Jacoby
              Votes:
              0 Vote for this issue
              Watchers:
              8 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 - 5h 40m
                  5h 40m