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

Client can only write on Index Table and skip data table if failure happens because of region split/move etc

    XMLWordPrintableJSON

Details

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

    Description

      With Phoenix 4.14.1 client, There is a scenario where client would skip data table write but do successful index table write. In this case, we should treat it as Data loss scenario.

       

      Relevant code path :-

      https://github.com/apache/phoenix/blob/4.x-HBase-1.3/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java#L994-L1043

      https://github.com/apache/phoenix/blob/4.x-HBase-1.3/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java#L1089-L1109

       

      Here is what happens :-

      • Consider below assumptions for scenario :- 
        • max no row in single batch = 100
        • max size of batch = 2 MB
      • When client faces SQLException Code 1121, it sets variable shouldRetryIndexedMutation=true.
      • In scenarios where client sends batch of 100 rows only as per configuration, but batch size is >2 MB, MutationState.java#991 will split this 100 row batch into multiple smaller batches which are <2MB.
      • Suppose there are 5 batches of 20 rows but client faces 1121 SQLExceptionCode on 2nd batch , then it will set shouldRetryIndexedMutation=true and it will retry all 5 batches again with only Index updates. This will results in rows missing from Data table.

      Attachments

        1. PHOENIX-5266-4.x-HBase-1.3.02.patch
          17 kB
          Mihir Monani
        2. PHOENIX-5266-4.x-HBase-1.3.01.patch
          16 kB
          Mihir Monani
        3. PHOENIX-5266.patch
          16 kB
          Mihir Monani
        4. PHOENIX-5266.patch
          16 kB
          Mihir Monani
        5. PHOENIX-5266.01.patch
          17 kB
          Mihir Monani

        Activity

          People

            mihir6692 Mihir Monani
            mihir6692 Mihir Monani
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: