[ https://issues.apache.org/jira/browse/PHOENIX-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903381#comment-14903381 ]
Alicia Ying Shu commented on PHOENIX-2221: ------------------------------------------ Currently INDEX_RECOVERY_FAILURE_POLICY_KEY is used in Indexer.java. I can add it to QueryServices.java. Using it as a config parameter to a new class, I need to create a new class ReadableIndexFailurePolicy.java for this. However, the only difference between this new class and PhoenixIndexFailurePolicy.java is writing READABLE index state. I would like to reuse the codes in PhoenixIndexFailurePolicy.java (there are private methods in PhoenixIndexFailurePolicy.java I would like to use). Use INDEX_RECOVERY_FAILURE_POLICY_KEY to a new class that implements the IndexFailurePolicy interface would add duplicate codes from PhoenixIndexFailurePolicy.java. Also we may need to change PhoenixIndexCodec.java and other parts. My current implementation checks whether INDEX_FAILURE_BLOCK_WRITE_ATTRIB is set then set READABLE index state. This approach added least amount of codes (a few lines of codes on this part). Since we reuse INDEX_DISABLE_TIMESTAMP, it makes sense to reuse PhoenixIndexFailurePolicy.java. I would suggest keep INDEX_FAILURE_BLOCK_WRITE_ATTRIB and just make the least amount code changes. [~jamestaylor] What do you think? > 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 > Attachments: 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)