Skip to content

HBASE-30092 Avoid stringifying protobuf RPC parameters in task snapshots#8489

Open
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30092-monitored-rpc-handler-oom
Open

HBASE-30092 Avoid stringifying protobuf RPC parameters in task snapshots#8489
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30092-monitored-rpc-handler-oom

Conversation

@Sigma-Ma

Copy link
Copy Markdown
Contributor

JIRA: https://issues.apache.org/jira/browse/HBASE-30092

What changes were proposed in this pull request?

This change avoids calling Message.toString() when MonitoredRPCHandlerImpl generates RPC monitoring information.

For protobuf parameters, HBase now records only the protobuf message type, such as ScanRequest. The existing packetlength field continues to report the serialized request size.

Why are the changes needed?

HBASE-30092 reports that MonitoredRPCHandlerImpl.generateCallInfoMap() can cause an out-of-memory error while generating RegionServer heartbeat information for a large in-flight RPC request.

Calling toString() on a protobuf recursively materializes the complete TextFormat representation. For large RPC requests, this creates a significant additional allocation in the monitoring path and can exhaust the RegionServer heap.

Recording only the protobuf message type keeps monitoring allocation independent of the request payload size while preserving the RPC method and serialized packet length.

How was this patch tested?

Added a regression test to TestTaskMonitor, covering:

  • Cloning a monitored RPC containing a large protobuf ScanRequest.
  • The RPC parameters contain only the protobuf message type.
  • The serialized packet length is preserved.

The focused unit test can be run with:

mvn -pl hbase-server -am \
  -DskipITs \
  '-Dtest=TestTaskMonitor#testCloneDoesNotStringifyProtobufParams' \
  -Dsurefire.failIfNoSpecifiedTests=false \
  test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant