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

PhoenixIndexMetaData.isIndexRebuild gives wrong results in Partial Index Rebuilding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • 4.14.1
    • None
    • None
    • None

    Description

      During Partial Rebuild, If rebuilder get index failure (because of region move/split etc), it will call PhoenixIndexFailurePolicy.handleFailure . Here it checks if mutations are part of Index Rebuild or not . 

      if (!throwing) {
      
                      SQLException sqlException =
      
                              new SQLExceptionInfo.Builder(SQLExceptionCode.INDEX_WRITE_FAILURE)
      
                                      .setRootCause(cause).setMessage(cause.getLocalizedMessage()).build()
      
                                      .buildException();
      
                      IOException ioException = ServerUtil.wrapInDoNotRetryIOException(null, sqlException, timestamp);
      
                  Mutation m = attempted.entries().iterator().next().getValue();
      
                  boolean isIndexRebuild = PhoenixIndexMetaData.isIndexRebuild(m.getAttributesMap());
      
                  // Always throw if rebuilding index since the rebuilder needs to know if it was successful
      
                  if (throwIndexWriteFailure || isIndexRebuild) {
      
                  throw ioException;
      
                  } else {
      
                          LOG.warn("Swallowing index write failure", ioException);
      
                  }
      
                  }
      

      Here isIndexRebuild becomes false even though we have set attribute for REPLY_WRITE to 

      REPLAY_ONLY_INDEX_WRITES  in UngroupedAggregateRegionObserver.rebuildIndices 

      ...
      put.setAttribute(REPLAY_WRITES, REPLAY_ONLY_INDEX_WRITES);
      ...

       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: