WL#17324: Health Monitor: Public Scope

Affects: Server-26.x   —   Status: Complete

High Level Description

This worklog defines the public boundary for moving the component into the Community Edition source tree.

The goal is to make the public part of the Health Monitor clear before source files are moved.

The worklog identifies which code, services, variables, Performance Schema tables and behaviors belong in the Community Edition, and which parts remain internal or cloud-specific.

Functional Requirements

FR-1 Public Source Files

The Health Monitor source files identified as public are moved to components/health_monitor.

FR-2 Component Services

The Health Monitor provides and consumes only services that are available to Community Edition, except for optional weak service registration of the Option Tracker.

FR-3 Build Dependencies

The Health Monitor builds from the public source tree using the documented linked libraries.

FR-4 Public Tables

The Health Monitor registers the Performance Schema tables listed as public.

FR-5 Public Variables

The Health Monitor registers the system variables and status variables listed as public and public status variables.

FR-6 MHS Behavior

The refit preserves MHS behavior unless this worklog or a later worklog explicitly changes it.

FR-7 Option Tracking

The Health Monitor can load and run when option_tracker is not available. Option Tracking MTR tests are skipped when the option_tracker component is not available.

FR-8 Platform Support

Linux and macOS are in scope for the first Community Edition release. Windows support is out of scope.


Non-functional Requirements

NFR-1 Internal Dependencies

The public component must not include or link against internal/cloud headers or libraries.

NFR-2 Single Implementation

The Community Edition and MHS use the same Health Monitor implementation. The code must not use preprocessor defines or compile-time guards for cloud-only sections.

High Level Specification

Source Move

The component will keep the component name health_monitor and the installed component library name component_health_monitor.

The component will remain loadable with INSTALL COMPONENT 'file://component_health_monitor'.

The public source tree will contain the entire Health Monitor runtime:

  • Collector, supervisor, timer, thread, lock, log, utility, query and report code.
  • Disk, memory and system collectors.
  • Disk, memory and system state machines.
  • /proc parsing code used by the Linux implementation.
    • NOTE: This will be replaced with calls to the libmysys API in WL#17325.
  • Disk forecasting code.
  • All Performance Schema tables.
  • All system and status variables.
  • Error log status messages.
  • Diagnostic reports.

The source move will keep the build change separate from behavior changes, although some follow-up worklogs may change defaults, platform support, test simulation, naming or error handling.


Single Implementation

There will be no preprocessor defines or compile-time guards for cloud-only sections in the Health Monitor code. The Community Edition Health Monitor will be the same implementation used in MHS.


Public Interfaces

The Health Monitor component will expose these interfaces in the Community Edition:

  • Performance Schema Health Monitor tables.
  • System variables.
  • Status variables.
  • Error log messages.
  • Diagnostic log output.

Tables To Be Made Public

Table Description
performance_schema.disk_forecast Forecasted disk usage samples and state.
performance_schema.disk_forecast_summary Current disk forecast summary.
performance_schema.disk_metric Disk metrics used for forecasting.
performance_schema.health_block_device Monitored block device state.
performance_schema.health_process_memory MySQL process memory samples.
performance_schema.health_system_memory System memory samples.
performance_schema.system_cpu_stats Current CPU statistics.
performance_schema.system_cpu_stats_history Historical CPU statistics.
performance_schema.system_disk_stats Current disk statistics.
performance_schema.system_disk_stats_history Historical disk statistics.
performance_schema.system_memory_stats Current system memory statistics.
performance_schema.system_memory_stats_history Historical system memory statistics.
performance_schema.system_process_stats Current MySQL process statistics.
performance_schema.system_process_stats_history Historical MySQL process statistics.

System Variables To Be Made Public

Name Description
health_monitor.status_interval Status message interval.
health_monitor.disk_running Enables disk collection.
health_monitor.disk_sample_rate Disk sample interval.
health_monitor.disk_retention Disk sample retention.
health_monitor.disk_monitored Monitored mount point.
health_monitor.disk_fallback_enable Enables low disk fallback mode.
health_monitor.disk_fallback_force Allows forced fallback session termination.
health_monitor.disk_low_space_duration Time below threshold before fencing.
health_monitor.disk_low_space_level Low disk threshold in MiB.
health_monitor.disk_low_space_percent Low disk threshold percentage.
health_monitor.disk_low_space_critical_level Critical low disk threshold in MiB.
health_monitor.disk_usage_warning_level_1 First disk warning threshold.
health_monitor.disk_usage_warning_level_2 Second disk warning threshold.
health_monitor.disk_usage_warning_level_3 Third disk warning threshold.
health_monitor.disk_recovery_enable Enables recovery from disk fallback.
health_monitor.disk_recovery_level Disk recovery threshold percentage.
health_monitor.disk_recovery_time_1 Delay before leaving offline mode.
health_monitor.disk_recovery_time_2 Delay before clearing super read only.
health_monitor.disk_recovery_max_cycles Maximum disk recovery cycles.
health_monitor.disk_recovery_increment Recovery delay increase per cycle.
health_monitor.disk_recovery_window Time window for recovery cycle reset.
health_monitor.disk_forecast_running Enables disk forecasting.
health_monitor.disk_forecast_sample_interval Disk forecast sample interval.
health_monitor.disk_forecast_report_interval Disk forecast report interval.
health_monitor.disk_forecast_run_mode Disk forecaster run mode.
health_monitor.disk_forecast_test_filename Disk forecast test data file.
health_monitor.memory_running Enables memory collection.
health_monitor.memory_sample_rate Memory sample interval.
health_monitor.memory_retention Memory sample retention.
health_monitor.memory_usage_warning_level_1 First memory warning level.
health_monitor.memory_usage_warning_level_2 Second memory warning level.
health_monitor.memory_usage_warning_level_3 Third memory warning level.
health_monitor.memory_reporting Enables triggered memory reports.
health_monitor.memory_report_definition Memory report definition.
health_monitor.periodic_reporting Enables periodic diagnostic reports.
health_monitor.periodic_report_definition Periodic report definition.
health_monitor.system_running Enables system statistics collection.
health_monitor.system_sample_rate System statistics sample interval.
health_monitor.system_retention System statistics retention.
health_monitor.system_cpu_stats_history Enables CPU history table.
health_monitor.system_disk_stats_history Enables disk history table.
health_monitor.system_memory_stats_history Enables memory history table.
health_monitor.system_process_stats_history Enables process history table.

Status Variables To Be Made Public

Name Description
offline_mode_disk_full Whether disk fallback set offline mode.
super_read_only_disk_full Whether disk fallback set super read only.
recovery_cycles Disk recovery cycle count.
disk_forecaster_run_mode Current disk forecaster mode.
disk_forecaster_test_state Current disk forecast test state.
option_tracker_usage:Health Monitor Usage count, not used in the Community Edition.

Settings and Services That Remain Internal

  • MHS default configuration.
    • Some system variable defaults will change for Community Edition. MHS depends on the current defaults, so the Control Plane must set those values explicitly.
    • #TODO: List the system variables that will use different values in MHS and Community Edition.
    • #TODO: Create Control Plane Jira tickets to preserve the current MHS values.
  • Storage advice.
    • The autopilot_oltp_advisor component is cloud-only. It builds storage advice only by querying the Health Monitor disk tables, so it does not affect the move to Community Edition.
  • Option tracking.
    • The Health Monitor provides an event tracking service and registers a usage counter callback with the option_tracker component. The option_tracker component is internal, but the callback uses weak service registration, so the component is optional. This does not affect the move to Community Edition.

Build and Linked Libraries

The public CMake target will be defined under components/health_monitor.

The component will continue to link to these libraries:

  • library_mysys
  • extra::rapidjson

It will not link to any internal/cloud library.

The component will no longer be registered from internal/cloud/CMakeLists.txt, and instead will be discovered with the other public components.


MTR Test Suite Move

The Health Monitor MTR suite will move from internal/cloud/mysql-test/suite/health_monitor to mysql-test/suite/health_monitor.

The move includes:

  • t test files.
  • r result files.
  • Suite-local include files.
  • Suite option files and configuration files.
  • Test data needed by the public suite, including disk forecast .dfx files currently referenced from the internal cloud test data path.

MTR tests for Storage Advice are separate from the Health Monitor and will remain internal.

MTR tests for Option Tracking will move to the public suite. These tests require the option_tracker component, so they will be skipped when that component is not available.

Additional Items To Track

  • Packaging and install for component_health_monitor.
  • Documentation: Is the current documentation cloud-specific?