You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Monani Mihir (JIRA)" <ji...@apache.org> on 2019/01/01 18:31:00 UTC

[jira] [Updated] (PHOENIX-5079) PhoenixIndexMetaData.isIndexRebuild gives wrong results in Partial Index Rebuilding

     [ https://issues.apache.org/jira/browse/PHOENIX-5079?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Monani Mihir updated PHOENIX-5079:
----------------------------------
    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 . 
{code:java}
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);

            }

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

REPLAY_ONLY_INDEX_WRITES  in UngroupedAggregateRegionObserver.rebuildIndices 
{code:java}
...
put.setAttribute(REPLAY_WRITES, REPLAY_ONLY_INDEX_WRITES);
...{code}
 

  was:
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 . 


{code:java}
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);

            }

            }
{code}
Here isIndexRebuild becomes falls even though we have set attribute for REPLY_WRITE to 

REPLAY_ONLY_INDEX_WRITES  in UngroupedAggregateRegionObserver.rebuildIndices 
{code:java}
...
put.setAttribute(REPLAY_WRITES, REPLAY_ONLY_INDEX_WRITES);
...{code}
 


> PhoenixIndexMetaData.isIndexRebuild gives wrong results in Partial Index Rebuilding
> -----------------------------------------------------------------------------------
>
>                 Key: PHOENIX-5079
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5079
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.14.1
>            Reporter: Monani Mihir
>            Priority: Minor
>
> 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 . 
> {code:java}
> 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);
>             }
>             }
> {code}
> Here isIndexRebuild becomes false even though we have set attribute for REPLY_WRITE to 
> REPLAY_ONLY_INDEX_WRITES  in UngroupedAggregateRegionObserver.rebuildIndices 
> {code:java}
> ...
> put.setAttribute(REPLAY_WRITES, REPLAY_ONLY_INDEX_WRITES);
> ...{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)