You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Abinayaa Tharmmarajhan (Jira)" <ji...@apache.org> on 2026/08/14 16:57:00 UTC

[jira] [Created] (HBASE-30332) ProtobufUtil.toResult() silently discards QueryMetrics for empty (row-not-found) results

Abinayaa Tharmmarajhan created HBASE-30332:
----------------------------------------------

             Summary: ProtobufUtil.toResult() silently discards QueryMetrics for empty (row-not-found) results
                 Key: HBASE-30332
                 URL: https://issues.apache.org/jira/browse/HBASE-30332
             Project: HBase
          Issue Type: Bug
          Components: Client, IPC/RPC
            Reporter: Abinayaa Tharmmarajhan


When a {{Get}} is issued with {{setQueryMetricsEnabled(true)}} and the requested row does not exist, the {{{}QueryMetrics{}}}(specifically {{{}blockBytesScanned{}}}) are silently dropped during protobuf serialization. The client always receives {{result.getMetrics() == null}} for missing rows, even though the server did read blocks (bloom filters, index blocks) to determine the row is absent and correctly computed the byte count.

 

*Steps to Reproduce*
 # Issue a {{Get}} against a row that does not exist, with {{get.setQueryMetricsEnabled(true)}}
 # Check {{result.getMetrics()}} on the returned {{Result}}
 # Observe {{null}} despite blocks having been read server-side

 

*Expected Behavior*

{{result.getMetrics().getBlockBytesScanned()}} returns the number of bytes read to determine the row is absent — the same as it would for a row that exists.

 

*Root cause*

Based on some analysis, in {{ProtobufUtil.toResult(Result result, boolean encodeTags)}} and {{{}ProtobufUtil.toResultNoData(Result result){}}}, when a result has no cells, the code takes an early-return path that returns one of six pre-built static proto constants. This could be causing the QueryMetrics to be dropped for such cases. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)