[
https://issues.apache.org/jira/browse/PHOENIX-5018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16689901#comment-16689901
]
Geoffrey Jacoby commented on PHOENIX-5018:
------------------------------------------
[~vincentpoon] - So what's the correct path here? I'd been considering adding a
flag to the UpsertCompiler to force upsert selects with this flag to use the
timestamp of the selected KeyValue in the upserted KeyValue, which would also
take care of the non-async index build.
However, I do like the idea of unifying the index building code. That said,
since Vishal recently found an issue with the MetadataRegionObserver (which
I'll encourage him to file a JIRA for), that raises the question about whether
the current metadata observer logic can be fixed with a minor tweak or needs a
large rewrite, and either way, whether that's the right path for a unified
index rebuild.
> Index mutations created by IndexTool will have wrong timestamps
> ---------------------------------------------------------------
>
> Key: PHOENIX-5018
> URL: https://issues.apache.org/jira/browse/PHOENIX-5018
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.14.0, 5.0.0
> Reporter: Geoffrey Jacoby
> Assignee: Geoffrey Jacoby
> Priority: Major
>
> When doing a full rebuild (or initial async build) on an index using the
> IndexTool and PhoenixIndexImportDirectMapper, we generate the index mutations
> by creating an UPSERT SELECT query from the base table to the index, then
> taking the Mutations from it and inserting it directly into the index via an
> HBase HTable.
> The timestamps of the Mutations use the default HBase behavior, which is to
> take the current wall clock. However, the timestamp of an index KeyValue
> should use the timestamp of the initial KeyValue in the base table.
> Having base table and index timestamps out of sync can cause all sorts of
> weird side effects, such as if the base table has data with an expired TTL
> that isn't expired in the index yet.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)