Skip to content

PMM-15195 Report the InnoDB redo log size on MySQL 8.0.30+ and 9.7 in pt-mysql-summary. - #1152

Merged
svetasmirnova merged 15 commits into
3.xfrom
PMM-15195-mysql-97
Sep 2, 2026
Merged

PMM-15195 Report the InnoDB redo log size on MySQL 8.0.30+ and 9.7 in pt-mysql-summary.#1152
svetasmirnova merged 15 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
  • 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+, which is the value the server honours there even while the legacy
    variables are still present. innodb_log_file_size and
    innodb_log_files_in_group were deprecated in 8.0.30 and removed in 9.3.0 —
    measured: 9.0.1, 9.1.0 and 9.2.0 still expose all three variables, while
    9.3.0, 9.4.0 and 9.7.0 expose only the capacity.
  • Retains the legacy innodb_log_files_in_group * innodb_log_file_size
    rendering for older MySQL versions.
  • When only innodb_log_file_size is exposed (MariaDB 10.6+, which removed
    innodb_log_files_in_group and never had innodb_redo_log_capacity), reports
    that size as a bare total rather than discarding it as Unknown, matching how
    the redo capacity is rendered on 8.0.30+. MariaDB 10.5 still exposes the file
    count with value 1 — it was deprecated and ignored in 10.5.2 and only removed
    in 10.6.0 — so there the legacy 1 * 96.0M = 96.0M rendering still applies.
    Measured on 10.5.29 and 10.6.28.
  • Falls back to Unknown only when no redo size variable of any spelling is
    present. A capacity that is present but zero or non-numeric degrades to the
    legacy variables rather than being reported or turning into 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, naming the versions where each form applies, 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 that capacity is
what the server honours from 8.0.30 on — and from 9.3.0 the per-file variables
are gone entirely. Schema analysis still requires mysqldump.

Note for QA

This satisfies the ticket's Service Summary criterion differently than written.
The AC asked for mysqldump to be available in the execution PATH of the service
generating the report; this PR makes mysqldump optional for the default summary
instead, so no pmm-client packaging change is needed.

Test plan

  • Added coverage for the redo log variable layouts that actually differ, seven
    cases in total (plan 51 → 54): the 8.0.30 shape (all three variables
    present, capacity wins), the 9.3+ shape (capacity only), the MariaDB 10.6
    shape (innodb_log_file_size only), the MariaDB 10.5 shape (file count of
    one, which keeps the legacy rendering), the Unknown branch, and the two
    degradation paths where innodb_redo_log_capacity is present but zero or
    non-numeric.
  • The last two matter because the guard is
    [ "${redo_capacity}" -gt 0 ] 2>/dev/null, which relies on [ returning a
    non-zero status for a non-numeric operand with the error text suppressed.
    That is correct in bash, but it is the kind of idiom whose behaviour drifts
    between shells, so it is pinned by tests rather than by a comment.
  • Verified by driving section_innodb directly against the temp001 sample:
    all seven shapes produce the asserted output.
  • The changed expected outputs in
    t/pt-mysql-summary/samples/expected_output_temp_enc008.txt and
    ..._enc009.txt are a fix, not a test adjustment. Both samples carry all three
    variables (innodb_log_file_size 5242880, innodb_log_files_in_group 2,
    innodb_redo_log_capacity 104857600). On 8.0.30+ the legacy pair is deprecated
    and ignored, so the old 2 * 5.0M = 10.0M reported a size the server does not
    honour; 100.0M is the capacity actually in effect.
  • 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.
  • bash -n clean on bin/pt-mysql-summary, lib/bash/report_mysql_info.sh and
    config/scripts/pt_builder.sh.

Changelog

Not updated here: the convention in this repo is release-time only — neither
Changelog nor docs/release_notes.rst has an unreleased section, and every
commit touching them is release preparation. Two user-visible items to pick up
at release prep:

  • Log File Size output format change on MySQL 8.0.30+.
  • mysqldump is no longer required for the default pt-mysql-summary run.

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 thread lib/bash/report_mysql_info.sh
Comment thread t/lib/bash/report_mysql_info.sh Outdated
@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
@JiriCtvrtka

Copy link
Copy Markdown
Contributor Author

Hi @svetasmirnova could you check #1152 (comment)? If we can decide about next steps.

@JiriCtvrtka JiriCtvrtka changed the title PMM-15195 Fixes and MySQL 9.7 changes. PMM-15195 Report the InnoDB redo log size on MySQL 8.0.30+ and 9.7 in pt-mysql-summary. Aug 20, 2026

@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.

Reviewed as the third leg of PMM-15195, alongside percona/mysqld_exporter#387 and percona/pmm#5648. Rather than reading the branch, I drove the new section_innodb code directly against lib/bash/report_mysql_info.sh and checked every claim against real servers.

This is the cleanest of the three legs. The logic is correct on every shape I could produce, the test data reflects real servers, and the Go bump is legitimate. One real defect — the man page and two code comments name the wrong MariaDB version, and they contradict this PR's own description. Details inline.

What I verified

Drove the new branch through eight shapes — your four plus four of my own:

Shape Output
8.0.30 (all three vars) 100.0M
9.7 (capacity only) 100.0M
MariaDB 10.6 (log_file_size only) 96.0M
MariaDB 10.5 (file count = 1) 1 * 96.0M = 96.0M
nothing present Unknown
capacity = 0, no legacy Unknown
capacity non-numeric, legacy present falls back to legacy
capacity = 0, legacy present falls back to legacy

All eight correct — the [ "${redo_capacity}" -gt 0 ] 2>/dev/null guard degrades the way it needs to.

  • The changed expected outputs are a real fix, not a test fudge. t/pt-mysql-summary/samples/temp_enc008/mysql-variables and t/pt-mysql-summary/samples/temp_enc009/mysql-variables carry all three variables (innodb_log_file_size 5242880, innodb_log_files_in_group 2, innodb_redo_log_capacity 104857600). On 8.0.30+ the legacy pair is deprecated and ignored, so the old 2 * 5.0M = 10.0M was actively wrong and 100.0M is the capacity the server actually honours. Worth stating that explicitly in the description — as written, a reviewer could read those two sample changes as adjusting tests to match new behaviour.
  • The check_mysql gating is safe. OPT_ALL_DATABASES is a real option and the new guard matches the existing idiom at bin/pt-mysql-summary:1177 and bin/pt-mysql-summary:2564. CMD_MYSQLDUMP is referenced only at bin/pt-mysql-summary:1081 and bin/pt-mysql-summary:1091, both inside the schema-dump path gated on those same options, so no default-path use survives and the check can safely be conditional.
  • The bin/ vs lib/ comment divergence is expected, not hand-editing — util/update-modules:92 pipes module content through grep -v '^ *#'. I checked because the two blocks differ; they differ correctly.
  • go build ./... clean under Go 1.26.6, and bash -n clean on bin/pt-mysql-summary, lib/bash/report_mysql_info.sh and config/scripts/pt_builder.sh.
  • CVE-2026-39822 checks out: os.Root improperly follows symlinks outside the root on Unix when the final path component is a symlink and the path ends in / (CWE-61, CVSS 7.8), fixed in Go 1.25.12 / 1.26.5 / 1.27.0-rc.2. Both the bump and the citation are accurate.

Note for QA

This leg satisfies the ticket's Service Summary criterion differently than written. The AC asked for mysqldump to be available in the execution PATH of the service generating the report; this PR makes it optional instead, which is the better fix. Worth flagging on the ticket so QA doesn't go looking for a pmm-client packaging change that no longer needs to happen.

Comment thread bin/pt-mysql-summary Outdated
Comment thread lib/bash/report_mysql_info.sh Outdated
Comment thread t/lib/bash/report_mysql_info.sh Outdated
@JiriCtvrtka

Copy link
Copy Markdown
Contributor Author

Reviewed as the third leg of PMM-15195, alongside percona/mysqld_exporter#387 and percona/pmm#5648. Rather than reading the branch, I drove the new section_innodb code directly against lib/bash/report_mysql_info.sh and checked every claim against real servers.

This is the cleanest of the three legs. The logic is correct on every shape I could produce, the test data reflects real servers, and the Go bump is legitimate. One real defect — the man page and two code comments name the wrong MariaDB version, and they contradict this PR's own description. Details inline.

What I verified

Drove the new branch through eight shapes — your four plus four of my own:

Shape Output
8.0.30 (all three vars) 100.0M
9.7 (capacity only) 100.0M
MariaDB 10.6 (log_file_size only) 96.0M
MariaDB 10.5 (file count = 1) 1 * 96.0M = 96.0M
nothing present Unknown
capacity = 0, no legacy Unknown
capacity non-numeric, legacy present falls back to legacy
capacity = 0, legacy present falls back to legacy
All eight correct — the [ "${redo_capacity}" -gt 0 ] 2>/dev/null guard degrades the way it needs to.

  • The changed expected outputs are a real fix, not a test fudge. t/pt-mysql-summary/samples/temp_enc008/mysql-variables and t/pt-mysql-summary/samples/temp_enc009/mysql-variables carry all three variables (innodb_log_file_size 5242880, innodb_log_files_in_group 2, innodb_redo_log_capacity 104857600). On 8.0.30+ the legacy pair is deprecated and ignored, so the old 2 * 5.0M = 10.0M was actively wrong and 100.0M is the capacity the server actually honours. Worth stating that explicitly in the description — as written, a reviewer could read those two sample changes as adjusting tests to match new behaviour.
  • The check_mysql gating is safe. OPT_ALL_DATABASES is a real option and the new guard matches the existing idiom at bin/pt-mysql-summary:1177 and bin/pt-mysql-summary:2564. CMD_MYSQLDUMP is referenced only at bin/pt-mysql-summary:1081 and bin/pt-mysql-summary:1091, both inside the schema-dump path gated on those same options, so no default-path use survives and the check can safely be conditional.
  • The bin/ vs lib/ comment divergence is expected, not hand-editing — util/update-modules:92 pipes module content through grep -v '^ *#'. I checked because the two blocks differ; they differ correctly.
  • go build ./... clean under Go 1.26.6, and bash -n clean on bin/pt-mysql-summary, lib/bash/report_mysql_info.sh and config/scripts/pt_builder.sh.
  • CVE-2026-39822 checks out: os.Root improperly follows symlinks outside the root on Unix when the final path component is a symlink and the path ends in / (CWE-61, CVSS 7.8), fixed in Go 1.25.12 / 1.26.5 / 1.27.0-rc.2. Both the bump and the citation are accurate.

Note for QA

This leg satisfies the ticket's Service Summary criterion differently than written. The AC asked for mysqldump to be available in the execution PATH of the service generating the report; this PR makes it optional instead, which is the better fix. Worth flagging on the ticket so QA doesn't go looking for a pmm-client packaging change that no longer needs to happen.

Thanks — all three inline items are fixed, and one of them turned out to be two bugs rather than one: the MySQL removal version was wrong as well as the MariaDB one. It's 9.3.0, measured across 9.0.1 / 9.1.0 / 9.2.0 (all three variables present) versus 9.3.0 / 9.4.0 / 9.7.0 (capacity only). Details in the threads.

On the Go bump being unrelated scope — I'd push back on that one, because it turns out to be what the build gate requires rather than optional hardening. That job ends in a Trivy scan with severity: CRITICAL,HIGH, ignore-unfixed: true, exit-code: 1. I reproduced it locally against the same image (oraclelinux:9-slim + microdnf -y update + COPY bin/*) and got exit 1 with 10 HIGH findings, all Go and no OS:

stdlib v1.26.5 — 8 HIGH, fixed in 1.26.6: encoding/asn1, x/net/idna, x/net/dns/dnsmessage, net/http, html/template, encoding/xml, net/url, crypto/tls
golang.org/x/net v0.55.0 — CVE-2026-46600, fixed in 0.56.0
golang.org/x/text v0.38.0 — CVE-2026-56852, fixed in 0.39.0
So the 1.26.5 pin was correct when written — it fixed CVE-2026-39822 — but 1.26.6 added those eight and the pin went stale against a database that moves independently of the branch. That also explains why it built clean for you: you used 1.26.6. Bumping to 1.26.7 plus x/net 0.56.0 and x/text 0.39.0 and re-running the identical scan gives exit 0, no findings. Description updated accordingly.

On the Changelog: confirmed, the convention here is release-time only — neither Changelog nor docs/release_notes.rst has an unreleased section, and every commit touching them is release prep. The two items to pick up at release prep are the Log File Size output change on 8.0.30+ and mysqldump becoming optional for the default summary. Both are now called out in the description.

On the QA note: agreed and added to the description, and I'll put it on the ticket so nobody chases a pmm-client packaging change.

Still outstanding and not mine to settle: #1155 touches the same section_innodb hunk with incompatible behaviour, and I haven't had a reply from @svetasmirnova since 30 Jul or 20 Aug. That's the real blocker on this leg.

Conflicts in go.mod and go.sum: 3.x picked up dependabot bumps for
golang.org/x/crypto (0.54.0), golang.org/x/sys (0.47.0) and golang.org/x/text
(0.40.0) while this branch raised the go directive to 1.26.7. Resolved by taking
the newer of each: go 1.26.7 with x/crypto 0.54.0, x/net 0.56.0, x/sys 0.47.0
and x/text 0.40.0.

3.x had already fixed x/net and x/text independently, so the go directive is the
only piece this branch still contributes to the build job's Trivy gate.

go mod verify and go build ./... clean; go mod tidy is a no-op. Reproducing the
build job's image and scan locally reports no findings and exits 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JiriCtvrtka
JiriCtvrtka requested a review from ademidoff August 24, 2026 12:01
@svetasmirnova

Copy link
Copy Markdown
Collaborator

@JiriCtvrtka #1155 is not only about pt-mysql-sumary, it is about if the toolkit can work with 9.7. It is merged now, and I am reviewing this PR. pt-mysql-summary requires more changes, see https://perconadev.atlassian.net/browse/PT-2505 So this will be the first step in improving pt-mysql-summary work.

@svetasmirnova
svetasmirnova merged commit d3bafb1 into 3.x Sep 2, 2026
4 checks passed
@svetasmirnova
svetasmirnova deleted the PMM-15195-mysql-97 branch September 2, 2026 12:06
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.

5 participants