Skip to content

Backport "HBASE-30473 Expose Master switch states as numeric metrics (#8758)" to branch-2.5 - #8783

Merged
junegunn merged 1 commit into
apache:branch-2.5from
junegunn:HBASE-30473-branch-2.5
Oct 16, 2026
Merged

junegunn merged 1 commit into
apache:branch-2.5from
junegunn:HBASE-30473-branch-2.5

Conversation

@junegunn

Copy link
Copy Markdown
Member

https://issues.apache.org/jira/browse/HBASE-30473

Backport of #8758 to branch-2.5.

Exposes seven switch-state gauges. rpcThrottleEnabled is omitted because this branch lacks HBASE-30409. Its RPC throttle getter reads ZooKeeper directly. Including the gauge would add remote reads during metrics collection or require new caching and synchronization code. This backport uses only existing in-memory switch state.

replicationPeerModificationEnabled is also omitted because this branch has no replication peer modification switch. Snapshot cleanup uses the existing cached tracker.

The metrics implementation stays in hbase-hadoop2-compat. Tests use the existing 2.x APIs. Website documentation stays on master.

Validation: full Maven build and 12 affected tests passed, with no failures, errors, or skips. Java 11 with Hadoop 3 profile.

Signed-off-by: Nihal Jain <nihaljain@apache.org>
Signed-off-by: Xiao Liu <liuxiaocs@apache.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reset or rebind the cached metrics source between mini-cluster lifecycles in TestMasterRepairMode.

0 open findings

What changed in this PR

Backports seven numeric master switch-state metrics to branch-2.5 using existing in-memory state.

Changes:

  • Adds switch-state APIs and metric definitions.
  • Publishes seven gauges through Hadoop 2 metrics.
  • Adds unit and integration coverage.
File Summary
hbase-server/​src/​test/​java/​org/​apache/​hadoop/​hbase/​master/​TestMasterSwitchMetrics.java Tests switch gauge behavior and availability.
hbase-server/​src/​test/​java/​org/​apache/​hadoop/​hbase/​master/​TestMasterRepairMode.java Tests maintenance-mode metrics.
hbase-server/​src/​test/​java/​org/​apache/​hadoop/​hbase/​master/​TestMasterMetrics.java Tests admin-driven switch changes.
hbase-server/​src/​main/​java/​org/​apache/​hadoop/​hbase/​master/​MetricsMasterWrapperImpl.java Collects seven switch states.
hbase-hadoop2-compat/​src/​main/​java/​org/​apache/​hadoop/​hbase/​master/​MetricsMasterSourceImpl.java Publishes switch-state gauges.
hbase-hadoop-compat/​src/​main/​java/​org/​apache/​hadoop/​hbase/​master/​MetricsMasterWrapper.java Defines the switch-state API.
hbase-hadoop-compat/​src/​main/​java/​org/​apache/​hadoop/​hbase/​master/​MetricsMasterSource.java Defines metric names and descriptions.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@junegunn
junegunn merged commit 9b7bbb5 into apache:branch-2.5 Oct 16, 2026
20 checks passed
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.

2 participants