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

Jingyun Tian commented on HBASE-18059:
--------------------------------------

As [~Appy] said before, the only situation when the order is determined by 
getScannerOrder() is SF vs SF and both have no seqId.
For SegmentScanner vs SegmentScanner, since all cells in memstore have SeqId, 
so it's impossible to reach getScannerOrder(). 

I think it's better to modify the comment of getScannerOrder() to:
{code}
  /**
   * Get the order of this KeyValueScanner. This is only relevant for 
StoreFileScanners.
   * This is required for comparing multiple files to find out which one has 
the latest 
   * data. StoreFileScanners are ordered from 0 (oldest) to newest in 
increasing order. 
   */
{code}

And I think for CompactingMemStore and DefaultMemStore:
{code}
long order = 1 + pipelineList.size() + snapshotList.size();
{code}
Although this part doesn't work, counting order from LONG.MAX makes more sense. 
[~Apache9]




> The scanner order for memstore scanners are wrong
> -------------------------------------------------
>
>                 Key: HBASE-18059
>                 URL: https://issues.apache.org/jira/browse/HBASE-18059
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver, scan, Scanners
>    Affects Versions: 2.0.0
>            Reporter: Duo Zhang
>            Assignee: Jingyun Tian
>            Priority: Critical
>             Fix For: 2.0.0
>
>
> This is comments for KeyValueScanner.getScannerOrder
> {code:title=KeyValueScanner.java}
>   /**
>    * Get the order of this KeyValueScanner. This is only relevant for 
> StoreFileScanners and
>    * MemStoreScanners (other scanners simply return 0). This is required for 
> comparing multiple
>    * files to find out which one has the latest data. StoreFileScanners are 
> ordered from 0
>    * (oldest) to newest in increasing order. MemStoreScanner gets LONG.max 
> since it always
>    * contains freshest data.
>    */
>   long getScannerOrder();
> {code}
> As now we may have multiple memstore scanners, I think the right way to 
> select scanner order for memstore scanner is to ordered from Long.MAX_VALUE 
> in decreasing order.
> But in CompactingMemStore and DefaultMemStore, the scanner order for memstore 
> scanner is also start from 0, which will be messed up with StoreFileScanners.



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

Reply via email to