Skip to content

PMM-15195 Fixes and MySQL 9.7 changes. - #1152

Open
JiriCtvrtka wants to merge 11 commits into
3.xfrom
PMM-15195-mysql-97
Open

PMM-15195 Fixes and MySQL 9.7 changes.#1152
JiriCtvrtka wants to merge 11 commits into
3.xfrom
PMM-15195-mysql-97

Conversation

@JiriCtvrtka

@JiriCtvrtka JiriCtvrtka commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

PMM-15195

  • The contributed code is licensed under GPL v2.0
  • Contributor Licence Agreement (CLA) is signed
  • util/update-modules has been ran
  • Documentation updated - no changes needed
  • Test suite update

PMM PR: percona/pmm#5648
MySQL Exporter PR: percona/mysqld_exporter#387
FB: Percona-Lab/pmm-submodules#4479

Summary

Updates pt-mysql-summary for MySQL 9.7 and removes an unnecessary historical
dependency on mysqldump.

  • Reports InnoDB Log File Size from innodb_redo_log_capacity on MySQL
    8.0.30+ and MySQL 9.7, where the legacy redo log variables no longer exist.
  • Retains the legacy innodb_log_file_size / innodb_log_files_in_group
    rendering for older MySQL versions, and falls back to a multiplier of 1
    when only innodb_log_file_size is exposed (MariaDB 10.5+), so a value the
    server does report is no longer discarded as Unknown.
  • Requires mysqldump only when schema analysis is explicitly requested with
    --databases or --all-databases; the default summary no longer fails when
    mysqldump is missing.
  • Documents in =head1 OUTPUT that the Log File Size rendering is version
    dependent, so the change from count * per-file = total to a bare total on
    8.0.30+ is not a surprise.
  • Bumps Go to 1.26.5 to address CVE-2026-39822 in the generated Go binaries and
    aligns config/scripts/pt_builder.sh with the version declared in go.mod.

Compatibility

Default pt-mysql-summary and PMM Service Summary reports carry the same
information as before. On MySQL 8.0.30+ the Log File Size line prints the
total redo log capacity instead of files * size = total, because the
per-file variables are gone. Schema analysis still requires mysqldump.

Test plan

  • Added coverage for the redo log variable layouts that actually differ: the
    8.0.30 shape (all three variables present, capacity wins), the 9.7 shape
    (capacity only, legacy variables gone), the MariaDB shape (innodb_log_file_size
    only), and the Unknown branch.
  • Added tests asserting mysqldump is optional for the default summary and
    required for --databases / --all-databases.
  • Verified the default summary and the reported redo log capacity against
    Oracle MySQL 9.7.
  • Verified the PMM Client mysqldump binary can connect to MySQL 9.7.
  • Built all Go binaries reported by Trivy using Go 1.26.5 and validated the
    package builder shell syntax.

JiriCtvrtka and others added 5 commits July 17, 2026 13:58
Avoid requiring mysqldump for reports without schema analysis and use dynamic redo log capacity when legacy log variables are unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fail early when mysqldump is unavailable so Service Summary cannot silently omit schema-related information.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JiriCtvrtka JiriCtvrtka changed the title Pmm 15195 mysql 97 PMM-15195 Fixes and MySQL 9.7 changes. Jul 18, 2026
@JiriCtvrtka

Copy link
Copy Markdown
Contributor Author

@copilot review

@JiriCtvrtka
JiriCtvrtka marked this pull request as ready for review July 18, 2026 14:25
Copilot AI review requested due to automatic review settings July 18, 2026 14:25
@JiriCtvrtka
JiriCtvrtka requested review from 4nte and ademidoff July 18, 2026 14:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates pt-mysql-summary to better support MySQL 8.0.30+ / MySQL 9.7 InnoDB redo logging, while making mysqldump optional unless schema analysis is explicitly requested. Also aligns Go toolchain versions for generated binaries/package builds.

Changes:

  • Report InnoDB “Log File Size” using innodb_redo_log_capacity when available, with legacy fallback to innodb_log_file_size * innodb_log_files_in_group.
  • Require mysqldump only when --databases or --all-databases schema analysis is requested; add test coverage for this behavior.
  • Bump Go version to 1.26.5 and align the package builder script with go.mod.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
t/pt-mysql-summary/samples/expected_output_temp_enc009.txt Updates expected InnoDB log size output to match redo capacity reporting.
t/pt-mysql-summary/samples/expected_output_temp_enc008.txt Same expected-output update for another sample fixture.
t/pt-mysql-summary/pt-mysql-summary.t Adds tests ensuring mysqldump is optional for default summary but required for schema analysis.
t/lib/bash/report_mysql_info.sh Adds a focused test validating formatting via innodb_redo_log_capacity; updates TAP plan.
lib/bash/report_mysql_info.sh Implements redo-capacity-based “Log File Size” reporting with legacy fallback and “Unknown” fallback.
go.mod Bumps the Go toolchain directive to 1.26.5.
config/scripts/pt_builder.sh Aligns builder-installed Go version with go.mod.
bin/pt-mysql-summary Mirrors redo-capacity logic in the shipped script and gates mysqldump validation on schema-analysis options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JiriCtvrtka

Copy link
Copy Markdown
Contributor Author

@copilot review

@ademidoff ademidoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two inline comments below. Two points that don't anchor to the diff:

=head1 OUTPUT POD is now stale

bin/pt-mysql-summary:3136 still documents:

Log File Size | 2 * 5.0M = 10.0M

and the sample config just below at bin/pt-mysql-summary:3245 reinforces it with innodb_log_file_size = 5M. Nothing tells the reader that on 8.0.30+ this field switches from count * per-file = total to a bare total. "Documentation updated - no changes needed" is fair for =head1 SYSTEM REQUIREMENTS (it never mentioned mysqldump), but the OUTPUT section now describes only the legacy rendering. A one-sentence note there should head off some "why did my summary format change?" reports.

Changelog

Changelog isn't updated, and at least one user-visible item here arguably belongs in it: Log File Size output format change for MySQL 8.0.30+. Convention in this repo looks like release-time updates rather than per-PR, so if release prep picks these up, could you confirm both land in the next version? Otherwise a short entry in this PR would be good.

Comment on lines +1036 to +1043
local log_size="$(get_var innodb_log_file_size "$variables_file")"
local log_file="$(get_var innodb_log_files_in_group "$variables_file")"
if [ -n "${log_size}" ] && [ -n "${log_file}" ]; then
local log_total=$(awk "BEGIN {printf \"%.2f\n\", ${log_size}*${log_file}}" )
name_val "Log File Size" \
"${log_file} * $(shorten ${log_size} 1) = $(shorten ${log_total} 1)"
else
name_val "Log File Size" "Unknown"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring both log_size and log_file means a server that exposes only innodb_log_file_size now reports Unknown, discarding a value it actually has. Verified by driving section_innodb with innodb_log_files_in_group stripped and no innodb_redo_log_capacity present:

Log File Size | Unknown

That combination is MariaDB 10.5+, which dropped innodb_log_files_in_group and never had innodb_redo_log_capacity. The old code wasn't correct there either — it emitted a malformed * 92.0M = — so this isn't a clean regression, but it trades garbage for no information instead of for the number. Defaulting the multiplier costs one line:

Suggested change
local log_size="$(get_var innodb_log_file_size "$variables_file")"
local log_file="$(get_var innodb_log_files_in_group "$variables_file")"
if [ -n "${log_size}" ] && [ -n "${log_file}" ]; then
local log_total=$(awk "BEGIN {printf \"%.2f\n\", ${log_size}*${log_file}}" )
name_val "Log File Size" \
"${log_file} * $(shorten ${log_size} 1) = $(shorten ${log_total} 1)"
else
name_val "Log File Size" "Unknown"
local log_size="$(get_var innodb_log_file_size "$variables_file")"
local log_file="$(get_var innodb_log_files_in_group "$variables_file")"
if [ -n "${log_size}" ]; then
[ -n "${log_file}" ] || log_file=1
local log_total=$(awk "BEGIN {printf \"%.2f\n\", ${log_size}*${log_file}}" )
name_val "Log File Size" \
"${log_file} * $(shorten ${log_size} 1) = $(shorten ${log_total} 1)"
else
name_val "Log File Size" "Unknown"

Worth confirming whether MariaDB is in scope for pt-mysql-summary at all — there are no MariaDB samples under t/pt-mysql-summary/samples/, so CI wouldn't catch it either way.

Comment thread t/lib/bash/report_mysql_info.sh Outdated
Comment on lines +686 to +687
cp "$samples/temp001/mysql-variables" "$PT_TMPDIR/mysql-variables-redo-capacity"
printf 'innodb_redo_log_capacity\t104857600\n' >> "$PT_TMPDIR/mysql-variables-redo-capacity"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appends innodb_redo_log_capacity to a sample that still contains both legacy variables, so the test proves precedence — the MySQL 8.0.30 case where all three exist. It doesn't cover the MySQL 9.7 shape (redo capacity present, legacy variables gone), which is what the ticket is actually about. The Unknown branch is untested too.

I confirmed the 9.7 path renders correctly by hand, but nothing in CI would catch a regression in it. One extra case closes the gap:

grep -vE '^innodb_log_file_size|^innodb_log_files_in_group' \
   "$samples/temp001/mysql-variables" > "$PT_TMPDIR/mysql-variables-97"
printf 'innodb_redo_log_capacity\t104857600\n' >> "$PT_TMPDIR/mysql-variables-97"

(with plan 48 bumped accordingly)

@JiriCtvrtka

Copy link
Copy Markdown
Contributor Author

Hi @svetasmirnova, I saw that you opened this PR yesterday: #1155. My ticket on the PMM side is to add support for MySQL 9.7. To implement it fully, I also created a PR for Percona Toolkit with the necessary changes. What do you think would be the best approach at this point?

Thank you.

@JiriCtvrtka
JiriCtvrtka requested a review from ademidoff July 30, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants