Wire external table reads into RocksDB metrics#14839
Conversation
|
@xingbowang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108012449. |
✅ clang-tidy: No findings on changed linesCompleted in 363.3s. |
Summary: Wrap the filesystem passed to external table readers when statistics or file IO listeners are configured so reads performed by implementations such as Nimble update the same RocksDB metrics as regular SST reads. The wrapper records `SST_READ_MICROS`, activity-specific `FILE_READ_*` histograms, last/non-last-level and temperature read tickers, and forwards `OnFileReadFinish`/`OnIOError` to configured listeners so ZippyDB file-read counters observe external-table IO. `MultiRead` records the elapsed read histogram once and applies byte/listener accounting to each completed request. Add a table test that makes a dummy external table reader read through `ExternalTableOptions::fs` and verifies both `Statistics` counters/histograms and file-read listener updates. Add an unreleased-history entry for the new external table read metrics coverage. This revision also applies the RocksDB `make check-format` clang-format output for `external_table.cc`. Differential Revision: D108012449
d3e2b73 to
c16b8b2
Compare
🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit c16b8b2 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit c16b8b2 SummaryThis PR adds metrics collection for external table reads by wrapping the FileSystem with instrumentation for statistics, histograms, and listener callbacks. The filesystem-wrapper approach is sound given that external tables bypass High-severity findings (3):
Full review (click to expand)Findings🔴 HIGHH1. Listeners reference in
|
| Concern | Verdict |
|---|---|
| Double-counting via table_cache.cc | Safe. Incoming RandomAccessFileReader is discarded (file.reset()). |
ExternalTableOptions::fs dangling reference |
Safe for construction-time use. Pre-existing struct design issue, not introduced by this PR. |
is_last_level across contexts |
Correct in all known calling contexts. |
Only NewRandomAccessFile wrapped |
Acceptable for external table read path. |
Positive Observations
- Clean filesystem-wrapper approach for instrumenting external tables that bypass
RandomAccessFileReader. ExternalTableMetricsRandomAccessFilecorrectly copies listeners during construction.MultiReadcorrectly records histogram once per batch, bytes/listeners per request.is_last_levelformula handles all known calling contexts.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Summary:
Wrap the filesystem passed to external table readers when statistics or file IO listeners are configured so reads performed by implementations such as Nimble update the same RocksDB metrics as regular SST reads. The wrapper records
SST_READ_MICROS, activity-specificFILE_READ_*histograms, last/non-last-level and temperature read tickers, and forwardsOnFileReadFinish/OnIOErrorto configured listeners so ZippyDB file-read counters observe external-table IO.MultiReadrecords the elapsed read histogram once and applies byte/listener accounting to each completed request.Add a table test that makes a dummy external table reader read through
ExternalTableOptions::fsand verifies bothStatisticscounters/histograms and file-read listener updates. Add an unreleased-history entry for the new external table read metrics coverage. This revision also applies the RocksDBmake check-formatclang-format output forexternal_table.cc.Differential Revision: D108012449