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

Any metadata changes may cause unpredictable result when local indexes are using

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      The problem code is in IndexHalfStoreFileReaderGenerator#preStoreFileReaderOpen:

                      conn = QueryUtil.getConnection(ctx.getEnvironment().getConfiguration()).unwrap(
                                  PhoenixConnection.class);
                      PTable dataTable = PhoenixRuntime.getTable(conn, tableName.getNameAsString());
      

      Use case:
      1. create table & local index. Load some data.
      2. Call split.
      3a. Add new local index.
      3b. Drop local index and recreate it.
      4. Call split.
      When the earlier mentioned code is executed during (2) it caches table into ConnectionQueryServicesImpl#latestMetaData . When it is executed during (4) dataTable is getting from cache and doesn't reflect information after (3a) or (3b). As the result the data for last created index will be lost during the split because of absence of index maintainer.

      After looking into ConnectionQueryServicesImpl I don't understand how the cache was supposed to be updated, so any suggestions/comments are really appreciated.
      jamestaylor, rajeshbabu FYI

      Attachments

        1. PHOENIX-3015.patch
          4 kB
          Sergey Soldatov

        Activity

          People

            sergey.soldatov Sergey Soldatov
            sergey.soldatov Sergey Soldatov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: