Skip to content

Add missingFileExceptions counter to detect swallowed HDFS replica errors - #260

Closed
tanyastickles wants to merge 2 commits into
hubspot-2.6from
tstickles/missing-file-exception-metrics-v2
Closed

tanyastickles wants to merge 2 commits into
hubspot-2.6from
tstickles/missing-file-exception-metrics-v2

Conversation

@tanyastickles

Copy link
Copy Markdown

Description

ReplicaNotFoundException and StoreFileNotFoundException are caught inside the broad Exception handler in StoreScanner#trySwitchToStreamRead and only surface in RS logs at WARN level — they never propagate to the HBase client and are completely invisible to existing alerting. During a stream-read mode switch the RS seeks newly-opened HFile scanners back to their last position; an HDFS block-read failure (e.g. a missing replica) throws here, the switch is silently abandoned, and the scan continues on the old pread scanners. No data is lost, but the event is unobservable.

This change adds a missingFileExceptions counter to the existing IPC exception metrics infrastructure. Because ReplicaNotFoundException is an HDFS server-side class not on the HBase classpath, detection walks the cause-chain checking message strings. The collectd plugin already scrapes all exceptions.* attributes from the RegionServer IPC JMX bean, so the new counter lands in VictoriaMetrics automatically as collectd_hbase_exceptions_identified_total{type="missingFileExceptions"} with no changes needed outside this repo.

Issue

BRAVE

Backwards Compatibility

Counter is additive — new JMX attribute registered in ExceptionTrackingSourceImpl.init(). No existing attributes removed or renamed.

Rollout and Rollback Plan

No config flag needed. Counter starts at zero and increments only on the specific exception message pattern. Rollback is a revert.

Automated Testing

Verification

After deploy: query collectd_hbase_exceptions_identified_total{type="missingFileExceptions"} in VictoriaMetrics on saturn-hb2-a-prod and confirm the metric appears (value may be zero if no events since deploy).

Expect Dependencies to Fail

REVIEWERS: Please review both the code changes and the answers above, and validate that they match the expectations for BRAVE

Tanya Stickles and others added 2 commits August 28, 2026 11:14
…rors

ReplicaNotFoundException and StoreFileNotFoundException are caught inside
the broad Exception handler in StoreScanner#trySwitchToStreamRead and only
appear in RS logs at WARN level — they never propagate to the client and
are invisible to existing alerting. This counter makes them observable via
the existing IPC JMX exception metrics, which collectd already scrapes as
collectd_hbase_exceptions_identified_total{type="missingFileExceptions"}.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tanyastickles

Copy link
Copy Markdown
Author

Closing — branch name contained a slash which corrupted the Maven snapshot version in the RPM build. Reopening from tstickles-missing-file-exception-metrics.

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