Xiao Liu created HBASE-30505:
--------------------------------

             Summary: Incorrect BYTES_IN_REMOTE_RESULTS scan metric in async 
scan
                 Key: HBASE-30505
                 URL: https://issues.apache.org/jira/browse/HBASE-30505
             Project: HBase
          Issue Type: Bug
          Components: Client
            Reporter: Xiao Liu
            Assignee: Xiao Liu
             Fix For: 4.0.0-alpha-1, 2.7.0, 3.1.0, 3.0.1, 2.6.8, 2.5.17


{\{AsyncScanSingleRegionRpcRetryingCaller#onComplete}} passes 
\{{isHeartbeatMessage}} as the \{{isRegionServerRemote}} argument of 
\{{ConnectionUtils#updateResultsMetrics}}:

{code:java}
updateResultsMetrics(scanMetrics, rawResults, isHeartbeatMessage);
{code}

So whether results are counted in \{{BYTES_IN_REMOTE_RESULTS}} depends on 
whether the response is a heartbeat, not on where the region server is:
* Results from a remote region server in a normal response are not counted. The 
metric stays at or near 0.
* Results in a heartbeat response from a local region server are counted as 
remote.

{\{BYTES_IN_RESULTS}} is not affected.

The bug was introduced by HBASE-17691. \{{ScannerCallable}}, changed in the 
same commit, passes the correct flag. On branch-2, \{{Table}} scans still use 
\{{ScannerCallable}}, so only \{{AsyncTable}} scans are affected. On branch-3 
and master, \{{Table}} is implemented on top of \{{AsyncTable}}, so all scans 
are affected. The wrong value shows up in \{{ResultScanner#getScanMetrics}} and 
in the MapReduce job counters.

The fix is to pass \{{regionServerRemote}}, which the RPC call and retry 
metrics in the same class already use. HBASE-30495 fixed a similar issue for 
\{{REMOTE_RPC_RETRIES}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to