hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chenrongwei (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-15097) When the scan operation covered two regions,sometimes the final results have duplicated rows.
Date Wed, 13 Jan 2016 09:47:39 GMT

     [ https://issues.apache.org/jira/browse/HBASE-15097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

chenrongwei updated HBASE-15097:
--------------------------------
    Description: 
When the scan operation‘s start key and end key covered two regions,the first region returned
the rows which were beyond of its' end key.So,this finally leads to duplicated rows in the
results.

To avoid this problem,we should add a judgment before setting the variable "stopRow" in the
class of HRegion,like follow:

            if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) && !scan.isGetScan())
{
                this.stopRow = null;
            } else {
                if (Bytes.compareTo(scan.getStopRow(), this.getRegionInfo().getEndKey()) >=
0) {
                    this.stopRow = this.getRegionInfo().getEndKey();
                } else {
                    this.stopRow = scan.getStopRow();
                }
            }

  was:
When the scan operation‘s start key and end key covered two regions,the first region returned
the rows which were beyond of its' end key.So,this finally leads to duplicated rows in the
results.

To avoid this problem,we should add a judgment before setting the variable "stopRow" in the
class of RegionScannerImpl,like follow:

            if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) && !scan.isGetScan())
{
                this.stopRow = null;
            } else {
                if (Bytes.compareTo(scan.getStopRow(), this.getRegionInfo().getEndKey()) >=
0) {
                    this.stopRow = this.getRegionInfo().getEndKey();
                } else {
                    this.stopRow = scan.getStopRow();
                }
            }


> When the scan operation covered two regions,sometimes the final results have duplicated
rows.
> ---------------------------------------------------------------------------------------------
>
>                 Key: HBASE-15097
>                 URL: https://issues.apache.org/jira/browse/HBASE-15097
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 1.1.2
>         Environment: centos 6.5
> hbase 1.1.2 
>            Reporter: chenrongwei
>            Assignee: chenrongwei
>             Fix For: 1.1.2
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When the scan operation‘s start key and end key covered two regions,the first region
returned the rows which were beyond of its' end key.So,this finally leads to duplicated rows
in the results.
> To avoid this problem,we should add a judgment before setting the variable "stopRow"
in the class of HRegion,like follow:
>             if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) &&
!scan.isGetScan()) {
>                 this.stopRow = null;
>             } else {
>                 if (Bytes.compareTo(scan.getStopRow(), this.getRegionInfo().getEndKey())
>= 0) {
>                     this.stopRow = this.getRegionInfo().getEndKey();
>                 } else {
>                     this.stopRow = scan.getStopRow();
>                 }
>             }



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

Mime
View raw message