Hudi 表健康状态检查
hudi-table-health
通过运行 HoodieTableHealthChecker 工具并解读其 JSON 报告,检查 Apache Hudi 表的表服务(compaction、cleaning、archival、savepoints)是否能跟上数据摄入。当用户询问 Hudi 表是否健康、compaction 或 cleaning 是否滞后、活动 timeline 为何持续增长,或如何处理阻塞 archival 的 savepoint 时,调用此技能。
- License 许可
- Apache-2.0
- 所属仓库
- apache/hudi
- 最近更新
- 2026-11-13
- Stars
- ★ 6.4k
- Forks
- 2.5k
01 前言 Front Matter
- name
- hudi-table-health
- description
- Checks whether an Apache Hudi table's table services (compaction, cleaning, archival, savepoints) are keeping up with ingestion, by running the HoodieTableHealthChecker utility and interpreting its JSON report. Invoke when a user asks whether a Hudi table is healthy, whether compaction or cleaning is falling behind, why the active timeline keeps growing, or what to do about a savepoint blocking archival.
02 资源文件 2
- 参考文档README.md2.4 KB
- 参考文档references/checks.md4.6 KB
03 SKILL.md 正文
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
Hudi Table Health
You are helping an operator find out whether a Hudi table is progressing as expected, and what to
do if it is not. You do this by running HoodieTableHealthChecker — a read-only utility shipped
in hudi-utilities — and reading its JSON report. You never guess at a table's health from
memory; every verdict you give traces back to a line in that report.
What the tool answers
| Check | Question |
|---|---|
compaction |
Are delta commits piling up past the configured trigger on a Merge-on-Read table? |
cleaner |
Are write commits piling up without a clean completing? |
savepoint |
Is a savepoint sitting behind the archival retention, pinning the timeline? |
archival |
Is the active timeline staying bounded? |
Each check reports HEALTHY, UNHEALTHY, or SKIPPED. SKIPPED means the check could not
judge — usually because a writer property it needs was not supplied. It is silence, not a pass.
Step 1 — collect what the tool needs
Two things, and the second is the one users forget:
- The table base path.
- The writer properties the table is written with. Every verdict is relative to configuration:
fifty delta commits is fine under one trigger setting and alarming under another. Ask for a
properties file or the individual
hoodie.*values. The properties that matter per check are listed inreferences/checks.md.
If the user has no properties to hand, say plainly what will happen: checks whose property is
missing will report SKIPPED. Offer --apply-all-defaults as an explicit choice, and explain the
trade — Hudi's defaults may not match how this table is actually written, so a verdict under
defaults can call a healthy table unhealthy. Never pass --apply-all-defaults without the user
choosing it.
Step 2 — run it
The tool needs the hudi-utilities-bundle jar on the classpath. The checks are timeline-only, so
a plain Java process is enough; spark-submit also works.
java -cp "$HUDI_UTILITIES_BUNDLE" org.apache.hudi.utilities.HoodieTableHealthChecker \
--base-path <table base path> \
--props <writer.properties> \
--output JSON
Always request --output JSON. Capture the exit code as well as stdout: 0 every check healthy or
skipped, 3 at least one check UNHEALTHY, 4 no check unhealthy but at least one could not run,
2 the tool itself could not run (bad arguments or an unreadable table). No verdict uses exit code
1: the JVM exits 1 when the process fails to start, so a bad classpath can never read as a
finding about the table. A rejected command line (no arguments, a missing --base-path, an unknown
flag) also exits 1 today, because the argument parser runs before the tool's own error handling;
treat 1 as "the tool did not run", never as a verdict. On 2 or 4, read the errors array and
stderr before saying anything about the table; on 3, the UNHEALTHY checks are the finding.
Use --checks compaction,cleaner to narrow the run when the user is investigating one service.
Step 3 — read the report
The JSON envelope is documented in references/checks.md. Dispatch on each check's status:
UNHEALTHY— quote thesummary, then thefindingsverbatim. Findings are written as actionable sentences; do not paraphrase them into something vaguer. Then add the remedy fromreferences/checks.mdfor that check.SKIPPED— thesummarynames the missing property. Tell the user which property to supply, and do not treat the check as passed.HEALTHY— say so in one line. Do not pad.
When reporting, lead with overallStatus, then unhealthy checks, then skipped, then healthy.
Include the observed.* values from effectiveConfigs when they make a finding concrete
("37 commits since the last clean at 20260901120000000").
Step 4 — recommend, don't act
This skill diagnoses. It does not run compaction, delete savepoints, or change configuration.
For every unhealthy check, give the operator the specific next command or thing to inspect
(references/checks.md has these), and say whether the action is reversible. Deleting a savepoint
is not.
Guardrails
- Every claim about the table's health must come from the report. If you have not run the tool, say you have not, and do not speculate.
- Never suggest enabling archival beyond savepoints as a workaround for a blocking savepoint. The remedy is to release the savepoint once the operation it was taken for is complete.
- Never pass
--apply-all-defaultswithout the user's explicit choice. - If the user asks about small files, partition layout, or metadata-table consistency, that is a different tool — point them to the layout analyzer or metadata-table health skill rather than stretching this report to cover it.
04 同仓库更多 Skills
Hudi 表物理布局分析
hudi-table-layout
通过运行 HoodieTableLayoutAnalyzer 工具并解读其 JSON 报告,分析 Apache Hudi 表的物理布局(分区与文件大小分布、数据倾斜、微分区、小文件堆积、热点分区)。当用户询问 Hudi 表或其分区有多大、表是否存在小文件问题、是否分区过细、哪些分区占用了大部分写入,或分区倾斜程度如何时,调用此技能。
Hudi 故障根因分析
hudi-rca
解释 Apache Hudi 作业失败的原因。将粘贴的堆栈跟踪和辅助材料对照已知故障模式目录进行分类,说明推理所依据的证据,并给出按优先级排序的缓解措施阶梯。当没有匹配的模式时,叙述 Hudi 当时正在执行的操作以及失败的阶段。当用户遇到 Hudi 故障、令人困惑的异常、表停滞,或询问写入、compaction 或表服务为何不工作时,调用此技能。
Hudi性能调优
hudi-optimizer
找出 Apache Hudi 部署在表上遗留的问题。读取写入器属性、Spark 事件日志和表本身,相互印证各方面观察到的情况,并推荐配置和功能变更,附带风险等级和验证步骤。当 Hudi 作业能正常运行但速度慢、成本高或占用存储超出预期时,或当用户询问记录级索引、聚类等功能是否对其表有帮助时调用。
Hudi元数据表健康检查
hudi-mdt-health
通过运行 HoodieTableHealthChecker 工具的元数据表检查并解读其 JSON 报告,检查 Apache Hudi 表的元数据表是否健康——是否跟上数据表、与存储上的文件保持一致、是否按计划压缩,以及记录级索引的大小是否与该表匹配。当用户询问元数据表是否同步或滞后、元数据表的文件列表是否可信、为何元数据表压缩未运行、记录索引文件组是否过少,或元数据表是否需要重建时调用。
Hudi配置咨询
hudi-config-consultant
基于从 Hudi 源码树生成的目录,回答关于 Apache Hudi `hoodie.*` 配置属性的问题——某个配置的作用、其默认值和有效取值、在代码中实际被读取的位置、哪些条件会制约它从而导致设置后可能静默无效,以及还需要搭配设置哪些其他配置。当用户询问某个配置的作用、为达成某目标应设置什么、为何已设置的配置没有生效、两个配置有何区别,或哪些配置应一起使用时调用。
Hudi表设计顾问
hudi-architect
交互式 Apache Hudi 表设计顾问。通过分层对话流程,将工作负载需求转化为架构指导和架构决策记录(Architecture Decision Record),并为已实现的可执行路径提供配置包。当用户需要帮助设计新的 Hudi 表或评估现有设计时调用。