[
https://issues.apache.org/jira/browse/PHOENIX-4028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16092499#comment-16092499
]
Samarth Jain commented on PHOENIX-4028:
---------------------------------------
+1.
Writing a test for this is pretty tricky as there are a few race conditions in
play. The purpose of the test really should be that without this patch, even if
index rebuild fails then the index would be marked as active (because of the
bug). Unfortunately, such a test passes with or without the patch :(. There is
a race condition between the rebuild index write failing and the index schedule
task to set the index state. If rebuild index write failure wins (which it will
most of the times in our tests) then it will flip the index state to disable.
Now if the rebuild task tries to update the index state to active it won't be
allowed. So the test will see that index state was marked as disabled which
wouldn't always be the case in a multi cluster setup. There could be a window
where the index was wrongly marked as active.
> Provide option to not throw index write failure back to client
> --------------------------------------------------------------
>
> Key: PHOENIX-4028
> URL: https://issues.apache.org/jira/browse/PHOENIX-4028
> Project: Phoenix
> Issue Type: Improvement
> Reporter: James Taylor
> Assignee: James Taylor
> Fix For: 4.12.0
>
> Attachments: PHOENIX-4028_addendum1.patch, PHOENIX-4028.patch,
> PHOENIX-4028_v2.patch, PHOENIX-4028_v3.patch, PHOENIX-4028_v4.patch,
> PHOENIX-4028_v5_wip.patch, PHOENIX-4028_wip.patch
>
>
> Much like our DISABLE_INDEX_ON_WRITE_FAILURE and
> REBUILD_INDEX_ON_WRITE_FAILURE table properties, we need a
> THROW_INDEX_WRITE_FAILURE boolean option that can be used to prevent the
> index write from being thrown back to the client. In this case, the index
> failure policy would still be executed (i.e. disabling the index on a write
> failure), but any retry logic for the client would be avoided. The index
> would be eventually consistent based on the background partial index rebuild
> thread.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)