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

Bo Cui commented on HBASE-18242:
--------------------------------

In the constructor of ClientSideRegionScanner, the Region initialized is not 
read-only
{code:title=ClientSideRegionScanner.java}
  public ClientSideRegionScanner(Configuration conf, FileSystem fs,
      Path rootDir, HTableDescriptor htd, HRegionInfo hri, Scan scan, 
ScanMetrics scanMetrics)
          throws IOException {

    // region is immutable, set isolation level
    scan.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);

    // open region from the snapshot directory
    this.region = HRegion.openHRegion(conf, fs, rootDir, hri, htd, null, null, 
null);

    // create an internal region scanner
    this.scanner = region.getScanner(scan);
    values = new ArrayList<Cell>();

    if (scanMetrics == null) {
      initScanMetrics(scan);
    } else {
      this.scanMetrics = scanMetrics;
    }
    region.startRegionOperation();
  }
{code}
{code:title=HRegion.java}
  private long initializeRegionInternals(final CancelableProgressable reporter,
      final MonitoredTask status) throws IOException {
    ...
    if (this.writestate.writesEnabled) {
      // Remove temporary data left over from old regions
      status.setStatus("Cleaning up temporary data from old regions");
      fs.cleanupTempDir();
    }
    ...
  }
{code}

> ClientSideRegionScanner#openRegion, deleted files under regionEncodeName/.tmp
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-18242
>                 URL: https://issues.apache.org/jira/browse/HBASE-18242
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.10, 1.3.0
>            Reporter: Bo Cui
>            Priority: Minor
>
> There are two ways to open region:
> 1, RS#openRegion:flush, compact, split, merge, scan, get, etc.
> 2, Client#openRegion: only scan, get
> Either way, all files under 
> /hbase/data/default/TableName/RegionEncodeName/.tmp will be deleted when 
> region is initialized
> For method 2, this should not happen: the client opening region can only read 
> data; there is no possibility of compaction or flush; if RS is processing 
> compact, and client removes the tmp file, the RS needs to be re executed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to