yuluo-yx opened a new pull request, #4448: URL: https://github.com/apache/rocketmq-dashboard/pull/4448
<!-- Make sure the base branch is `master`: that is the RocketMQ Studio trunk. --> ### Which Issue(s) This PR Fixes - Fixes #4447 - Replaces #4131, closed by the branch switch in #4379. ### Brief Description This is a resubmission of #4131 against `master`, following the branch switch notice in #4379. The fork branch is unchanged; `master` is now the RocketMQ Studio trunk. 排查 CommitLog 冷读和页缓存行为时,运维人员需要在明确节点上读取、调整预读建议并保留恢复依据。本 PR 为真实 Apache Broker 增加 Read-ahead 入口,使用原生 setCommitLogReadAheadMode 操作现有映射文件。 ## 改动说明 - 读取及提交均绑定所选实例、Broker 名称与已登记地址,不自动换节点。缺失或未知 dataReadAheadEnable 不能当作关闭。 - 先读取旧值,再确认新值;提交前核对旧配置,相同值不重复扫描。Normal 对应 MADV_NORMAL=0,Random 对应 MADV_RANDOM=1。 - 回执分别记录 RPC 确认、原配置和配置回读。仅配置回读一致时显示 CONFIG_CONFIRMED;异常或不一致显示 UNKNOWN,不自动重试。审计失败不覆盖已有结果。 - 中文文档说明维护窗口、I/O 观察、恢复原值与重启配置限制。UI 在提交期间锁定,并在实例切换或关闭后丢弃迟到响应。 确认范围依据官方源码:[AdminBrokerProcessor](https://github.com/apache/rocketmq/blob/rocketmq-all-5.5.0/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java#L1007) 修改运行时配置;[CommitLog.scanFileAndSetReadMode](https://github.com/apache/rocketmq/blob/rocketmq-all-5.5.0/store/src/main/java/org/apache/rocketmq/store/CommitLog.java#L2513) 在 Windows 跳过扫描,并可能仅记录文件建议失败。因此不把配置确认称为内核调用全部成功,也不承诺性能提升。 ### How Did You Test This Change? ## 原提交验证记录 本地后端 63 项、前端 23 项测试通过;新增服务 51/51 行、36/40 分支覆盖。Checkstyle、TypeScript/Vite 构建及后端打包通过;ESLint 0 错误、10 条现有告警。浏览器在同一脚本内明确拦截本地 GET/POST,验证节点、旧值、目标值与 CONFIG_CONFIRMED 回执,无真实 Broker 写入。 全部 Issue/PR 标题正文和在线 read ahead、setCommitLogReadAheadMode、dataReadAheadEnable、预读关键词检索未发现重复。与消费组冷读流控不同,这里调整单节点映射文件的读取建议,接口、界面、权限及故障测试和文档合并交付。 ## 兼容性与回滚 无新增依赖或数据库迁移;撤销代码提交可移除接口和入口,运行时模式需重新读取并恢复原值。原生命令没有显式持久化,其他后续配置保存可能写入当前字段,不能把重启当作自动回滚。真实 Linux/Windows 内核效果、性能、压力、容量和故障切换测试未执行。既有全量测试与依赖审计缺口仍记录。提交含 [skip ci],未运行远端工作流。核验日期:2026-09-08。 ### Checklist - [x] One coherent change; unrelated modifications are not bundled in - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / `refactor:` / `chore:` / `docs:` / `perf:`) - [x] Tests added or updated for non-trivial changes, test methods named `...Test` - [x] New UI text has both Chinese and English entries under `web/src/i18n/`, or the change does not add UI text - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks), or the original verification scope is stated above - [x] New source files carry the ASF license header, or no new source files were added - [x] Documentation touched where behaviour changed (README / `docs/` / in-app help), or no documentation change was required -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
