yujun777 opened a new pull request, #71062: URL: https://github.com/apache/doris/pull/71062
### Background Incrementally maintained materialized views refresh through the MTMV task scheduler. The FE already exposes aggregate IVM task metrics and saves a refresh summary for each view in its metadata. ### What problem does this PR solve? Issue Number: None Related PR: #69856 (aggregate refresh metrics and persisted summaries) PR Type: Enhancement Problem Summary: The metrics endpoint reports aggregate refresh failures and fallbacks. Diagnosing a repeatedly failing or slow view requires a per-view breakdown. This change exposes four refresh summary metrics on the Master FE so alerts can identify the affected view. ### Details - **Change map:** 297 production lines and 338 test lines, including deletions. The production change covers journal replay, Master FE snapshots, and metric rendering. The tests cover summary persistence, snapshot lifecycle, and the SQL refresh path. - **Before and after:** Master `/metrics` now exposes `doris_fe_ivm_consecutive_failures`, `doris_fe_ivm_refresh_failed_tasks_total`, `doris_fe_ivm_refresh_fallbacks_total`, and `doris_fe_ivm_refresh_duration_seconds` with `db_name`, `mv_name`, and `mv_id`. Duration appears after the first successful or failed refresh. - **Configs and defaults:** `enable_changelog_monitor` is enabled by default. The mutable `changelog_monitor_interval_seconds` defaults to 15 seconds. Scrapes read the published snapshot while catalog collection runs on the daemon. - **Impact on existing users:** Old images and journals still restore the existing summary. The per-view failed-task total starts with the first failed result recorded by an upgraded Master. A sequence recorded with each new terminal result makes summary replay idempotent. - **Behavior change:** The Master FE exports per-view series for live IVM views. A successful refresh resets consecutive failures and preserves the cumulative totals. ### Testing - Passed the FE build and Checkstyle. - Passed the FE unit tests for refresh summaries, image and journal replay, sampling lifecycle, and the Prometheus and JSON visitors. - Passed `test_ivm_refresh_method_metrics` on a local shared-nothing 1 FE and 1 BE cluster. - Verified that all four metric samples remained identical after restarting the FE. ### Release note Master FE metrics now expose consecutive failures, total failed tasks, total automatic fallbacks, and the latest refresh duration per incremental materialized view. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes. Add the metric names, labels, and Master-only behavior to the FE metrics reference. - Pre-submission status: Ready -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
