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

Alicia Ying Shu commented on PHOENIX-2221:
------------------------------------------

[~jamestaylor] Thanks a lot for the suggestion. Below is my understanding. Let 
me know if I am wrong on it. 

I can use existing PhoenixIndexFailurePolicy.java to set the 
INDEX_DISABLE_TIMESTAMP. Thus, there is no need to have 
ReadableIndexFailurePolicy.java (and Delegate). Just to set the configuration 
"phoenix.index.failure.block.write" to be "true" to distinguish it from the 
default disabling index when rebuilding the index. At the end of rebuilding 
index, set the  value of INDEX_DISABLE_TIMESTAMP for the physical table back to 
null.

No need to set the status of the index at all - just keep it active. Instead of 
blocking writes to the table based on the index status, block them based on the 
table having a value for INDEX_DISABLE_TIMESTAMP in MutationState.validate().

About the following:
>enforce that the timestamp for the table doesn't move forward by modifying 
>MetaDataEndPointImpl.getTable() which is what is used to get the upper bound 
>of a scan for a given table. If the PTable looked up has a value for the 
>INDEX_DISABLE_TIMESTAMP, then you'd return that value instead of the current 
>time.

The above is for enforcing the scan (Reads). Writes are still blocked based on 
the table having a value for INDEX_DISABLE_TIMESTAMP in 
MutationState.validate().

> Option to make data regions not writable when index regions are not available
> -----------------------------------------------------------------------------
>
>                 Key: PHOENIX-2221
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2221
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Devaraj Das
>            Assignee: Alicia Ying Shu
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2221-v1.patch, PHOENIX-2221-v2.patch, 
> PHOENIX-2221-v3.patch, PHOENIX-2221.patch
>
>
> In one usecase, it was deemed better to not accept writes when the index 
> regions are unavailable for any reason (as opposed to disabling the index and 
> the queries doing bigger data-table scans).
> The idea is that the index regions are kept consistent with the data regions, 
> and when a query runs against the index regions, one can be reasonably sure 
> that the query ran with the most recent data in the data regions. When the 
> index regions are unavailable, the writes to the data table are rejected. 
> Read queries off of the index regions would have deterministic performance 
> (and on the other hand if the index is disabled, then the read queries would 
> have to go to the data regions until the indexes are rebuilt, and the queries 
> would suffer).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to