[ 
https://issues.apache.org/jira/browse/PHOENIX-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259241#comment-17259241
 ] 

ASF GitHub Bot commented on PHOENIX-6298:
-----------------------------------------

gjacoby126 commented on a change in pull request #1060:
URL: https://github.com/apache/phoenix/pull/1060#discussion_r552224371



##########
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/PartialIndexRebuilderIT.java
##########
@@ -1060,4 +1063,70 @@ public void 
postBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, Min
             throw new DoNotRetryIOException("Simulating write failure on " + 
c.getEnvironment().getRegionInfo().getTable().getNameAsString());
         }
     }
+
+    @Test
+    public void testPendingDisableWithDisableCountTs() throws Throwable {
+        final String schemaName = generateUniqueName();
+        final String tableName = generateUniqueName();
+        final String indexName = generateUniqueName();
+        final String fullTableName = SchemaUtil.getTableName(schemaName, 
tableName);
+        final String fullIndexName = SchemaUtil.getTableName(schemaName, 
indexName);
+        final MyClock clock = new MyClock(1000);
+        EnvironmentEdgeManager.injectEdge(clock);

Review comment:
       We've seen problems in the past with HBase 2.x and injecting an 
Environment Edge before creating a table. (It can hang forever) Probably want 
to move the edge injection until after the create table / create index 
statement unless you know the HBase 2.x edge bug has been fixed, and that it's 
fixed in all HBase 2.x versions we support (2.1, 2.2, 2.3 and 2.4)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Use timestamp of PENDING_DISABLE_COUNT to calculate elapse time for 
> PENDING_DISABLE state
> -----------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6298
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6298
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.15.0
>            Reporter: Ankit Singhal
>            Assignee: Viraj Jasani
>            Priority: Major
>             Fix For: 5.1.0, 4.16.0
>
>
> Instead of taking indexDisableTimestamp to calculate the elapsed time, we 
> should be considering the last time we incr/decremented the counter for 
> PENDING_DISABLE_COUNT. as if the application writes failures span more than 
> the default threshold of 30 seconds, the index will unnecessarily get 
> disabled even though the client could have retried and made it active.
> {code}
>                     long elapsedSinceDisable = 
> EnvironmentEdgeManager.currentTimeMillis() - Math.abs(indexDisableTimestamp);
> // on an index write failure, the server side transitions to PENDING_DISABLE, 
> then the client
>                     // retries, and after retries are exhausted, disables the 
> index
>                     if (indexState == PIndexState.PENDING_DISABLE) {
>                         if (elapsedSinceDisable > pendingDisableThreshold) {
>                             // too long in PENDING_DISABLE - client didn't 
> disable the index, so we do it here
>                             IndexUtil.updateIndexState(conn, 
> indexTableFullName, PIndexState.DISABLE, indexDisableTimestamp);
>                         }
>                         continue;
>                     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to