[
https://issues.apache.org/jira/browse/PHOENIX-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14078946#comment-14078946
]
James Taylor commented on PHOENIX-1112:
---------------------------------------
Looking good. One minor tweak:
- Now that you store the lowerTimeStamp on the TableRef, you don't need it on
StatementContext
- Modify this bit of code in BasicQueryPlan to check for a lowerTimeStamp on
the context.getCurrentTable() and set the lower bound of the scan (just
add/modify ScanUtil.setTimeRange(scan, scn) to take a TimeRange or another
argument). Then you can remove both of those if statements in
MetaDataClient.buildIndex() where you're doing this.
public final ResultIterator iterator(final List<SQLCloseable> dependencies)
throws SQLException {
if (context.getScanRanges() == ScanRanges.NOTHING) {
return ResultIterator.EMPTY_ITERATOR;
}
Scan scan = context.getScan();
// Set producer on scan so HBase server does round robin processing
//setProducer(scan);
// Set the time range on the scan so we don't get back rows newer than
when the statement was compiled
// The time stamp comes from the server at compile time when the meta
data
// is resolved.
// TODO: include time range in explain plan?
PhoenixConnection connection = context.getConnection();
Long scn = connection.getSCN();
if(scn == null) {
scn = context.getCurrentTime();
// Add one to server time since max of time range is exclusive
// and we need to account of OSs with lower resolution clocks.
if(scn < HConstants.LATEST_TIMESTAMP) {
scn++;
}
}
ScanUtil.setTimeRange(scan, scn);
bq. The last thing I want to mention is that we still throw exception when we
successfully disable index. This is wrong because index update is done in
postBatchMutate after WAL sync and we have to roll-forward(meaning commit).
That's one of reason we have to abort RS.
Is this something you've fixed, or is this some follow up work?
> Atomically rebuild index partially when index update fails
> ------------------------------------------------------------
>
> Key: PHOENIX-1112
> URL: https://issues.apache.org/jira/browse/PHOENIX-1112
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Jeffrey Zhong
> Assignee: Jeffrey Zhong
> Attachments: Phoenix-1112-v2.patch, Phoenix-1112-v3.patch,
> Phoenix-1112.patch
>
>
> This is a short-term work around & safe approach. Currently we disable an
> index when index update failed(still possible bring down the whole cluster).
> After an index is disable, human needs to be involved to rebuild entire index
> which maybe not ideal.
> The patch adds the support to automatically rebuild an disable index
> partially from where it failed. In addition, it removes RS abort during WAL
> recovery to prevent chain failures because we don't have to.
> To disable automatically rebuilding failed index, add the following
> configuration into hbase-site.xml:
> {noformat}
> <property>
> <name>phoenix.index.failure.handling.rebuild</name>
> <value>false</value>
> </property>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)