You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2015/09/01 22:20:49 UTC

[jira] [Created] (PHOENIX-2222) Don't increment timestamp when doing local index build

Samarth Jain created PHOENIX-2222:
-------------------------------------

             Summary: Don't increment timestamp when doing local index build
                 Key: PHOENIX-2222
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2222
             Project: Phoenix
          Issue Type: Bug
            Reporter: Samarth Jain


In MetadataClient#buildIndex, we are incrementing the timestamp by 1. From the comment it  looks like this was added to take into account clock skews on certain OSs (like windows). The side effect is that on the other OSs this could cause the select count(*) query to read more data than it should have. 

{code}
try {
                    if(plan.getContext().getScanTimeRange()==null) {
                        Long scn = connection.getSCN();
                        if (scn == null) {
                            scn = plan.getContext().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++;
                            }
                        }
                        plan.getContext().setScanTimeRange(new TimeRange(dataTableRef.getLowerBoundTimeStamp(),scn));
                    }
                }
{code}



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