[
https://issues.apache.org/jira/browse/PHOENIX-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259050#comment-17259050
]
Geoffrey Jacoby commented on PHOENIX-6298:
------------------------------------------
I just want to point out that this only affects the old indexing framework,
because the new one doesn't auto-disable indexes. (It repairs write failures at
read time.)
Since existing indexes have to be manually upgraded to the new framework
(either by dropping/recreating or by using the IndexUpgradeTool), we'll need to
support the old Indexer-style indexes for a little while yet, so still good to
fix bugs / race conditions when we find them.
> 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)