Skip to content

HBASE-23996 Add metric for the split WAL procedure - #8515

Open
Umeshkumar9414 wants to merge 3 commits into
apache:masterfrom
Umeshkumar9414:HBASE-23996_split_wal
Open

HBASE-23996 Add metric for the split WAL procedure#8515
Umeshkumar9414 wants to merge 3 commits into
apache:masterfrom
Umeshkumar9414:HBASE-23996_split_wal

Conversation

@Umeshkumar9414

@Umeshkumar9414 Umeshkumar9414 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

We already have deprecated HBASE_SPLIT_WAL_COORDINATED_BY_ZK but some Classes only used by that flow was not marked deprecated. I have marked those deprecated in this PR only. I hope that is fine else I will create another PR for that.

Some screen shots for the old metrics and the new one.
example 1
image (11)
example 2
image (12)
Old one
image (13)

@Umeshkumar9414
Umeshkumar9414 force-pushed the HBASE-23996_split_wal branch from c3b3ed4 to bf73a3d Compare July 30, 2026 08:45
Umeshkumar9414 and others added 2 commits July 30, 2026 14:18
Assert the new splitWAL procedure metric in two places:
TestMasterMetrics#testDefaultMasterMetrics (splitWALSubmittedCount is
registered and reads 0 at rest) and TestSplitWALManager#testSplitLogs
(increments by one per SplitWALProcedure, verified against a captured
baseline on the procedure-based non-ZK split path).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Mark the legacy ZooKeeper-coordinated WAL split coordination classes
(ZKSplitLogManagerCoordination, ZkSplitLogWorkerCoordination) and the
associated MetricsMasterFileSystem source as deprecated, since the
procedure-based distributed WAL splitter (SplitWALManager) is the default
and these are only reachable under the legacy
hbase.split.writer.coordinated.by.zk path.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@Umeshkumar9414
Umeshkumar9414 force-pushed the HBASE-23996_split_wal branch from bf73a3d to 4bff3da Compare July 30, 2026 08:48
@virajjasani
virajjasani self-requested a review August 11, 2026 04:37
@apurtell
apurtell requested a balanced review from Copilot August 11, 2026 21:46

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.

Pull request overview

Adds master metrics for procedure-based WAL splitting and deprecates metrics and coordination classes tied to the legacy ZooKeeper flow.

Changes:

  • Adds submitted, failed, and timing metrics for SplitWALProcedure.
  • Verifies metric registration and submission counts.
  • Marks legacy ZooKeeper WAL-splitting components as deprecated.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java Tests split-WAL submission metrics.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java Verifies default metric registration.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitWALProcedure.java Connects the procedure to its metrics.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterFileSystem.java Deprecates legacy filesystem metrics.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java Exposes split-WAL procedure metrics.
hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZkSplitLogWorkerCoordination.java Deprecates legacy worker coordination.
hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java Deprecates legacy manager coordination.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java Registers split-WAL operation metrics.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java Defines the metric prefix and accessor.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterFilesystemSourceImpl.java Deprecates the legacy metrics implementation.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterFileSystemSource.java Deprecates the legacy metrics interface.

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

@mnpoonia

Copy link
Copy Markdown
Contributor

The new success-path integration test only verifies splitWALSubmittedCount. Please also assert that splitWALTime receives an entry after the completed procedure. splitWALFailedCount has no corresponding terminal-failure test; if a stable failure path is impractical, please explain why that metric is intentionally left without integration coverage.
@Umeshkumar9414

assertEquals(0, splitWALManager.getWALsToSplit(metaServer, true).size());
assertEquals(1, splitWALManager.getWALsToSplit(metaServer, false).size());
// The meta SplitWALProcedure should also have been counted by the split WAL metric.
METRICS_HELPER.assertCounter(MetricsMasterSource.SPLIT_WAL_METRIC_PREFIX + "SubmittedCount",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This validates splitWALSubmittedCount, but the new OperationMetrics also exports splitWALTime and splitWALFailedCount. Could we assert that the time histogram receives one sample for each successfully completed SplitWALProcedure here?

I do not see a deterministic terminal-failure path for SplitWALProcedure, so I would not require a FailedCount integration test in this PR. The generic procedure metrics test covers failure accounting; an assertion that FailedCount remains unchanged on this successful/retryable path would be a useful optional addition.


/**
* ZooKeeper based implementation of {@link SplitLogManagerCoordination}
* ZooKeeper based implementation of {@link SplitLogManagerCoordination}.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we make the replacement a Javadoc link? SplitWALManager is in org.apache.hadoop.hbase.master, so use {@link org.apache.hadoop.hbase.master.SplitWALManager}. This makes the migration target navigable in generated API docs.

* ZooKeeper based implementation of {@link SplitLogWorkerCoordination} It listen for changes in
* ZooKeeper and
* ZooKeeper based implementation of {@link SplitLogWorkerCoordination}.
* @deprecated since 2.4.0 and in 3.0.0, to be removed in 4.0.0, replaced by procedure-based

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same javadoc comment applies here


/**
* @deprecated since 2.4.0 and in 3.0.0, to be removed in 4.0.0, replaced by procedure-based
* distributed WAL splitter; see SplitWALManager. Implementation of the deprecated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same javadoc comment applies here

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.

4 participants