You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2018/12/05 00:21:00 UTC

[jira] [Commented] (PHOENIX-5061) PhoenixIndexImportDirectMapper doesn't set SCN correctly for indexes on transactional tables

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

Thomas D'Silva commented on PHOENIX-5061:
-----------------------------------------

We only want to set the scn if the table is not transactional TXN_SCN_VALUE is used in DirectHTableWriter.write(). We should change it to the following to make it clear (which is how we create the connection in {{PhoenixInpuFormat.getQueryPlan()}})
{code}
if(txnScnValue==null && currentScnValue!=null) {
  overridingProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, currentScnValue);
}
{code}



> PhoenixIndexImportDirectMapper doesn't set SCN correctly for indexes on transactional tables
> --------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-5061
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5061
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.14.1
>            Reporter: Geoffrey Jacoby
>            Priority: Major
>
> In PhoenixIndexImportDirectMapper, there's a section where the scn is set before getting the Phoenix connection.
> It appears the intention is to use a transactional scn value if one exists (it's set in IndexTool if a table's transactional), otherwise use a normal scn. However, the transactional scn value is never used. 
> {code:java}
> final Properties overrideProps = new Properties();
> String scn = configuration.get(PhoenixConfigurationUtil.CURRENT_SCN_VALUE);
> String txScnValue = configuration.get(PhoenixConfigurationUtil.TX_SCN_VALUE);
>  if(txScnValue==null) {
>         overrideProps.put(PhoenixRuntime.BUILD_INDEX_AT_ATTRIB, scn);
> }
> connection = ConnectionUtil.getOutputConnection(configuration, overrideProps);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)