Skip to content

Add DataNodeExceptionMetrics with suspected disk exception counter - #18554

Merged
JackieTien97 merged 5 commits into
masterfrom
diskExceptionCounter
Aug 31, 2026
Merged

Add DataNodeExceptionMetrics with suspected disk exception counter#18554
JackieTien97 merged 5 commits into
masterfrom
diskExceptionCounter

Conversation

@shuwenwei

Copy link
Copy Markdown
Member

Description

Add a unified DataNode disk exception monitoring metric using a Counter that tracks suspicious disk exceptions across the DataNode write path.

Design

  • New DataNodeExceptionMetrics class with a Counter named suspected_disk_exception_count
  • Uses exact type matching (getClass() ==) instead of instanceof for java.nio.file.FileSystemException because subclasses (e.g. NoSuchFileException, NotDirectoryException) typically indicate logical file-state errors rather than real disk failures
  • Walks the cause chain of the provided throwable to find the exact exception type

Integration points

Write path:

  • TsFileProcessor (flush, fsync, close, mod file write, truncate)
  • MemTableFlushTask (writePlanIndices, writeToFileWriter)
  • WALBuffer (roll, force/fsync, close, read)
  • CheckpointManager (write, fsync, roll, close)
  • DataRegion (recovery)

Compaction:

  • AbstractCompactionTask, CompactionScheduler

WAL recovery:

  • WALNodeRecoverTask, UnsealedTsFileRecoverPerformer, SealedTsFileRecoverPerformer

Schema engine:

  • SchemaRegionPBTreeImpl (writeToMLog — single point covering all mlog writes)
  • SchemaRegionMemoryImpl, MemMTreeSnapshotUtil, PBTreeFlushExecutor, SchemaFile

Load:

  • LoadTsFileManager, FileLoaderUtils

Disk management:

  • TierManager

…r DataNode

Add a new DataNodeExceptionMetrics class with a counter that tracks
suspicious disk exceptions. The counter only increments when an
exception in the cause chain is exactly java.nio.file.FileSystemException
(not subclasses), because subclasses like NoSuchFileException or
NotDirectoryException typically indicate logical file-state errors
rather than real disk failures.

Integration points cover:
- Write path: TsFileProcessor, MemTableFlushTask, WALBuffer, CheckpointManager
- Compaction: AbstractCompactionTask, CompactionScheduler
- WAL recovery: WALNodeRecoverTask, Unsealed/SealedTsFileRecoverPerformer
- Schema engine: SchemaRegionPBTreeImpl (writeToMLog), SchemaRegionMemoryImpl,
  MemMTreeSnapshotUtil, PBTreeFlushExecutor, SchemaFile
- Load: LoadTsFileManager, FileLoaderUtils
- Disk management: TierManager
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.48193% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.34%. Comparing base (0116168) to head (5272f9c).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
...b/db/service/metrics/DataNodeExceptionMetrics.java 47.05% 9 Missing ⚠️
...ageengine/dataregion/memtable/TsFileProcessor.java 0.00% 9 Missing ⚠️
...gine/schemaregion/impl/SchemaRegionPBTreeImpl.java 38.46% 8 Missing ⚠️
...e/dataregion/wal/checkpoint/CheckpointManager.java 0.00% 5 Missing ⚠️
...ine/execution/operator/source/FileLoaderUtils.java 0.00% 3 Missing ⚠️
...eIndex/tsfile/TsFileTableDiskUsageIndexWriter.java 0.00% 3 Missing ⚠️
...iotdb/db/storageengine/load/LoadTsFileManager.java 0.00% 3 Missing ⚠️
...otdb/db/storageengine/rescon/disk/TierManager.java 0.00% 3 Missing ⚠️
...n/tvf/read_tsfile/ExternalTsFileQueryResource.java 0.00% 2 Missing ⚠️
...rageengine/dataregion/flush/MemTableFlushTask.java 0.00% 2 Missing ⚠️
... and 16 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18554      +/-   ##
============================================
+ Coverage     42.24%   42.34%   +0.09%     
  Complexity      413      413              
============================================
  Files          5409     5411       +2     
  Lines        389958   390231     +273     
  Branches      50978    51071      +93     
============================================
+ Hits         164742   165233     +491     
+ Misses       225216   224998     -218     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JackieTien97
JackieTien97 merged commit 7a38e7e into master Aug 31, 2026
39 of 40 checks passed
@JackieTien97
JackieTien97 deleted the diskExceptionCounter branch August 31, 2026 11:16
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