Compare commits

..

53 Commits

Author SHA1 Message Date
Jiří Čtvrtka
06d5966106 PMM-12548 Add json tags for PMM purposes. (#951)
* PMM-12548 Add json tags for PMM purposes.

* PMM-12548 Response length json tag.
2025-06-23 13:13:08 +03:00
Sveta Smirnova
d5d39a83fa Merge pull request #890 from dbnski/long-variable-values
pt-config-diff: MySQL truncates run-time variable values longer than 1024 characters
2025-06-22 15:53:09 +03:00
Sveta Smirnova
6fc8f66792 Delete t/pt-config-diff/samples/long_vars_80_2.cnf 2025-06-22 15:49:08 +03:00
Sveta Smirnova
71c8d866a5 Delete t/pt-config-diff/samples/long_vars_80_1.cnf 2025-06-22 15:48:35 +03:00
Sveta Smirnova
6cff1dfe77 Delete t/pt-config-diff/samples/long_vars_57_2.cnf 2025-06-22 15:48:19 +03:00
Sveta Smirnova
9b83a7dc74 Delete t/pt-config-diff/samples/long_vars_57_1.cnf 2025-06-22 15:47:56 +03:00
Sveta Smirnova
64157c1fad Merge pull request #962 from percona/dependabot/go_modules/github.com/alecthomas/kong-1.11.0
build(deps): bump github.com/alecthomas/kong from 1.9.0 to 1.11.0
2025-06-17 18:46:35 +03:00
Sveta Smirnova
0c7e5d749c PR-890 - pt-config-diff: MySQL truncates run-time variable values longer than 1024 characters
- Modified test case, so it works with versions 5.7, 8.0, and 8.4
  without changes
2025-06-13 02:31:43 +03:00
Sveta Smirnova
b3bf684f39 Merge pull request #947 from percona/PT-2129_pt-online-schem-change_fails_on_non-readable_version_check_file
PT-2129 - pt-online-schem-change and other tools fail on non-readable…
2025-06-13 02:09:35 +03:00
Sveta Smirnova
6043df2ce4 Merge pull request #970 from percona/snyk-fix-01e585478eebb12025e705b763a12679
[Snyk] Security upgrade requests from 2.31.0 to 2.32.4
2025-06-12 17:39:57 +03:00
Sveta Smirnova
9726e2bfc6 Merge branch '3.x' into snyk-fix-01e585478eebb12025e705b763a12679 2025-06-12 17:39:12 +03:00
Sveta Smirnova
3d9d7acccb Merge pull request #969 from percona/dependabot/github_actions/aquasecurity/trivy-action-0.31.0
build(deps): bump aquasecurity/trivy-action from 0.30.0 to 0.31.0
2025-06-12 17:38:29 +03:00
Sveta Smirnova
37779c4364 Merge pull request #968 from percona/dependabot/go_modules/go.mongodb.org/mongo-driver-1.17.4
build(deps): bump go.mongodb.org/mongo-driver from 1.17.3 to 1.17.4
2025-06-12 17:38:06 +03:00
Sveta Smirnova
6e28207e89 Merge branch '3.x' into dependabot/go_modules/go.mongodb.org/mongo-driver-1.17.4 2025-06-12 17:37:58 +03:00
Sveta Smirnova
528007e2b0 Merge pull request #953 from pakud/patch-2
Update documentation of pt-query-digest - better description for --output secure-slowlog
2025-06-12 17:37:25 +03:00
Sveta Smirnova
d5f091cb9c Merge pull request #967 from percona/dependabot/go_modules/golang.org/x/crypto-0.39.0
build(deps): bump golang.org/x/crypto from 0.36.0 to 0.39.0
2025-06-12 17:37:02 +03:00
dependabot[bot]
8b4065c4d3 build(deps): bump golang.org/x/crypto from 0.36.0 to 0.39.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.39.0.
- [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.39.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-12 14:34:00 +00:00
Sveta Smirnova
42f74af5ba Merge pull request #963 from percona/dependabot/go_modules/k8s.io/api-0.33.1
build(deps): bump k8s.io/api from 0.32.3 to 0.33.1
2025-06-12 17:32:53 +03:00
Sveta Smirnova
14eff5f1df Merge pull request #952 from percona/dependabot/go_modules/golang.org/x/net-0.38.0
build(deps): bump golang.org/x/net from 0.36.0 to 0.38.0
2025-06-12 17:32:37 +03:00
Sveta Smirnova
46f5a2d220 Merge pull request #945 from percona/PT-2424_Typo_in_pt-table-checksum_error_message_--resume_and_--no-empty-replicate-table_are_mutually_exclusive
PT-2424 - Typo in pt-table-checksum error message "--resume and --no-…
2025-06-12 17:29:25 +03:00
Sveta Smirnova
edef468f8e Merge pull request #955 from percona/snyk-fix-4b2b455989372a42aad03eacd81cd35b
[Snyk] Security upgrade setuptools from 40.5.0 to 78.1.1
2025-06-12 17:14:54 +03:00
Sveta Smirnova
fa709c9064 Merge pull request #971 from percona/Release_notes_for_3_7_0_2
Release notes for 3 7 0 2
2025-06-12 17:01:19 +03:00
Sveta Smirnova
11e4588a73 Updated 3.7.0-2 notes with actual bug fixes 2025-06-12 16:50:21 +03:00
Sveta Smirnova
a63e3212f0 Updated 3.7.0-2 notes with actual bug fixes 2025-06-12 16:41:53 +03:00
Sveta Smirnova
2b2289f9f5 Merge pull request #966 from impimp/PT-2453
PT-2453: Add -skip-pod-summary for pt-k8s-debug-collector
2025-06-11 01:05:04 +03:00
snyk-bot
dc4aee8dfd fix: requirements-docbuild.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-10305723
2025-06-10 10:28:04 +00:00
Sveta Smirnova
b1279680fd PT-2453 - Add -skip-pod-summary for pt-k8s-debug-collector
- Added reserved word into .typos.toml
2025-06-09 17:14:00 +03:00
Sveta Smirnova
21b7edea4f PT-2453 - Add -skip-pod-summary for pt-k8s-debug-collector
- Added reserved word into .typos.toml
2025-06-09 16:55:24 +03:00
Sveta Smirnova
f31ea35421 PT-2453 - Add -skip-pod-summary for pt-k8s-debug-collector
- Added reserved word into .typos.toml
2025-06-09 16:51:45 +03:00
Sveta Smirnova
554d8294e1 PT-2453 - Add -skip-pod-summary for pt-k8s-debug-collector
- Added test case
2025-06-09 16:46:40 +03:00
dependabot[bot]
7ad2e73e5d build(deps): bump aquasecurity/trivy-action from 0.30.0 to 0.31.0
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.30.0 to 0.31.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.30.0...0.31.0)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 10:14:11 +00:00
dependabot[bot]
a0a1e1decf build(deps): bump go.mongodb.org/mongo-driver from 1.17.3 to 1.17.4
Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.17.3 to 1.17.4.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](https://github.com/mongodb/mongo-go-driver/compare/v1.17.3...v1.17.4)

---
updated-dependencies:
- dependency-name: go.mongodb.org/mongo-driver
  dependency-version: 1.17.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 09:40:20 +00:00
Maciej Dobrzanski
55f2167ed0 - Updated MySQLConfig.pm to correctly support very long variable values
- Added test cases for pt-config-diff
2025-06-06 20:39:24 +02:00
IMP
6e7a867fed PT-2453: Add -skip-pod-summary for pt-k8s-debug-collector
In some cases, collecting additional data from pods is not needed and, due to the current tool design, can cause significant delays.
This commit introduces a workaround to skip such collection when it's not required.
2025-05-30 14:29:07 +02:00
EvgeniyPatlan
fd2f0f94b1 Merge pull request #964 from alina-derkach-oaza/fix-release-version
Fix the release version number
2025-05-20 15:22:48 +03:00
Alina Derkach
2201e7f97d Fix the release version number
modified:   Changelog
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst
2025-05-20 13:45:45 +02:00
dependabot[bot]
2383a399a6 build(deps): bump k8s.io/api from 0.32.3 to 0.33.1
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.32.3 to 0.33.1.
- [Commits](https://github.com/kubernetes/api/compare/v0.32.3...v0.33.1)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-version: 0.33.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 09:45:27 +00:00
dependabot[bot]
a66fe3ebf6 build(deps): bump github.com/alecthomas/kong from 1.9.0 to 1.11.0
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.9.0 to 1.11.0.
- [Commits](https://github.com/alecthomas/kong/compare/v1.9.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kong
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 09:45:16 +00:00
EvgeniyPatlan
d81adddfa4 Merge pull request #961 from percona/release-3.7.0-1
Release 3.7.0 1
2025-05-14 16:10:31 +03:00
EvgeniyPatlan
84095fd7d7 Merge branch '3.x' into release-3.7.0-1 2025-05-14 16:09:28 +03:00
Alina Derkach
47b8c5b067 Merge pull request #960 from alina-derkach-oaza/PT-2447-3.7.0-1
PT-2447 Release notes for Percona Toolkit 3.7.0-1
2025-05-14 10:59:16 +02:00
Alina Derkach
7717cfe4f1 PT-2447 Release notes for Percona Toolkit 3.7.0-1
modified:   Changelog
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst
2025-05-13 16:42:18 +02:00
snyk-bot
b98ec7baa7 fix: requirements-docbuild.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-9964606
2025-05-03 07:33:35 +00:00
Jiří Čtvrtka
f9d9a993e9 PMM-13897 Remove {} from all values in Plan Summary. (#950) 2025-04-28 14:25:07 +03:00
EvgeniyPatlan
7f322f7cbd Merge pull request #954 from EvgeniyPatlan/release-3.7.0-1
Release 3.7.0 1
2025-04-22 12:18:26 +03:00
Evgeniy Patlan
3ff98c20bc Update version 2025-04-22 11:37:43 +03:00
Sveta Smirnova
f816053065 Merge pull request #917 from surbhat1595/PKG374
PKG-374 Make Percona Toolkit rpm spec file architecture independent

(cherry picked from commit d82723f272)
2025-04-22 08:32:53 +03:00
Evgeniy Patlan
34a14ec77e Update crypto version 2025-04-22 08:00:54 +03:00
Paweł Kudzia
d2db8f5789 Update pt-query-digest
pt-query-digest - fixing documentation for --output secure-slowlog option
2025-04-17 14:11:01 +02:00
dependabot[bot]
e940d154c0 build(deps): bump golang.org/x/net from 0.36.0 to 0.38.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-16 23:19:56 +00:00
Sveta Smirnova
ef2dbd887f PT-2129 - pt-online-schem-change and other tools fail on non-readable version check file
- Implemented fix in lib/VersionCheck.pm
- Updated modules in all tools
- Added test case to t/pt-query-digest/version_check.t
2025-03-29 23:22:44 +03:00
Sveta Smirnova
905490bac5 PT-2424 - Typo in pt-table-checksum error message "--resume and --no-empty-replicate-table are mutually exclusive"
- Fixed typo
- Added test case
2025-03-27 21:11:31 +03:00
Maciej Dobrzanski
bcbb4e59ab Read @@global object variable when SHOW VARIABLES returns a potentially truncated value 2024-12-03 20:28:01 +01:00
39 changed files with 465 additions and 122 deletions

View File

@@ -27,7 +27,7 @@ jobs:
- name: Build the Docker image
run: echo "FROM oraclelinux:9-slim" > Dockerfile; echo "RUN microdnf -y update" >> Dockerfile; echo "COPY bin/* /usr/bin/" >> Dockerfile; docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.30.0
uses: aquasecurity/trivy-action@0.31.0
with:
image-ref: 'percona-toolkit:${{ github.sha }}'
format: 'table'

View File

@@ -39,6 +39,9 @@ extend-ignore-re = [
"END_ND_TOOLTIPS" = "END_ND_TOOLTIPS"
"EXPLAINed" = "EXPLAINed"
"FH_ND_FILE" = "FH_ND_FILE"
"GTI" = "GTI"
"GTID" = "GTID"
"GTIDs" = "GTIDs"
"INSERTs" = "INSERTs"
"IST" = "IST"
"istError" = "istError"

View File

@@ -1,5 +1,21 @@
Changelog for Percona Toolkit
v3.7.0-2 released 2025-05-14
This release addresses multiple security vulnerabilities reported in Percona Toolkit version 3.7.0, including issues related to the `libxml2` component (CVE-2024-56171, CVE-2025-24928), `openssl` (CVE-2024-12797), and `krb5` (CVE-2022-37967).
* Fixed bug PT-2442: percona-toolkit:latest Vulnerability [CVE-2024-56171 CVE-2024-12797 CVE-2022-37967 CVE-2025-24928]
* Fixed bug PT-2375: pt-table-sync does not work with generated columns (Thanks to Henning Pöttker for the contribution)
* Fixed bug PT-2400: pt-table-checksum reports the error for warning code 4164
* Fixed bug PT-2377: pt-table-sync does not handle utf8 strings in JSON columns correctly (Thanks to Henning Pöttker for the contribution)
* Fixed bug PT-2378: pt-table-sync does print floating point numbers in SQL statements with insufficient precision (Thanks to Henning Pöttker for the contribution)
* Fixed bug PT-2389: pt-online-schema-change resume functionality doesn't work with ADD/DROP column (Thanks to Perry Harrington for the contribution)
* Fixed bug PT-2410: pt-archiver brokes when using output-format=csv and has null values (Thanks to Roberto de Bem for the contribution)
* Fixed bug PT-2422: pt-online-schema-change race overwrites new_table_name (Thanks to Perry Harrington for the contribution)
* Fixed bug PT-2407: pt-online-schema-change exit status(return code) is 0 even if it does NOT succeed
* Fixed bug PT-2355: pt-online-schema-change should not resume a job with empty boundaries
* Fixed bug PT-1577: pt-secure-collect, replace pt-secure-data in Usage section
v3.7.0 released 2024-12-23
* Feature PT-2340: Support MySQL 8.4
@@ -18,8 +34,7 @@ v3.6.0 released 2024-06-12
* Improvement PR-160: added support for operf if present, and if CMD_OPCONTROL is not set (Thanks to Fernando Ipar for the contribution)
* Improvement PR-140: Add CPU cache configuration info to pt-summary (Thanks to Alexey Kopytov for the contribution)
* Improvement PR-765: pt-galera-log-explainer: improvements from feedbacks (Thanks Yoann La Cancellera for the contribution)
* Improvement PT-2233: pt-k8s-debug-collector needs psql in the host node
(Thanks to Jobin Augustine for the contribution)
* Improvement PT-2233: pt-k8s-debug-collector needs psql in the host node (Thanks to Jobin Augustine for the contribution)
* Improvement PR-772: pt-galera-log-explainer: add custom regexes parameter (Thanks Yoann La Cancellera for the contribution)
* Improvement PT-2301: pt-galera-log-explainer: whois redesign (Thanks Yoann La Cancellera for the contribution)
* Improvement PT-2190: pt-show-grants should use print_identified_with_as_hex

View File

@@ -11,7 +11,7 @@ MAKE_GOTOOLS
WriteMakefile(
NAME => 'Percona::Toolkit',
VERSION => '3.7.0',
VERSION => '3.7.0-2',
EXE_FILES => [
map {
(my $name = $_) =~ s/^bin.//;

View File

@@ -5761,7 +5761,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -3063,11 +3063,24 @@ sub _parse_config {
}
elsif ( my $dbh = $args{dbh} ) {
$config_data{format} = $args{format} || 'show_variables';
my $mysql_version = _get_version($dbh);
my $sql = "SHOW /*!40103 GLOBAL*/ VARIABLES";
PTDEBUG && _d($dbh, $sql);
my $rows = $dbh->selectall_arrayref($sql);
$config_data{vars} = { map { @$_ } @$rows };
$config_data{mysql_version} = _get_version($dbh);
$config_data{vars} = {
map {
my ($variable, $value) = @$_;
if ( length($value) == 1024 && $mysql_version ge '5.7.0' ) {
my $var_sql = "SELECT \@\@global.$variable";
PTDEBUG && _d($dbh, $var_sql);
my $var_sth = $dbh->prepare($var_sql);
$var_sth->execute();
($value) = $var_sth->fetchrow_array();
}
$variable => $value
} @$rows
};
$config_data{mysql_version} = $mysql_version;
}
else {
die "Unknown config source";
@@ -4934,7 +4947,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -3984,7 +3984,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -4431,7 +4431,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -4548,7 +4548,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -3310,7 +3310,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -3491,7 +3491,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -5352,7 +5352,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -5947,7 +5947,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -6575,7 +6575,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -7858,7 +7858,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -12792,7 +12792,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,
@@ -16258,12 +16258,12 @@ type: string; default: report
How to format and print the query analysis results. Accepted values are:
VALUE FORMAT
======= ===============================
======= ======================================
report Standard query analysis report
slowlog MySQL slow log
json JSON, one array per query class
json-anon JSON without example queries
secure-slowlog JSON without example queries
secure-slowlog MySQL slow log with anonymized queries
The entire C<report> output can be disabled by specifying C<--no-report>
(see L<"--[no]report">), and its sections can be disabled or rearranged

View File

@@ -4656,7 +4656,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -3790,7 +3790,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -899,7 +899,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,
@@ -9082,11 +9082,24 @@ sub _parse_config {
}
elsif ( my $dbh = $args{dbh} ) {
$config_data{format} = $args{format} || 'show_variables';
my $mysql_version = _get_version($dbh);
my $sql = "SHOW /*!40103 GLOBAL*/ VARIABLES";
PTDEBUG && _d($dbh, $sql);
my $rows = $dbh->selectall_arrayref($sql);
$config_data{vars} = { map { @$_ } @$rows };
$config_data{mysql_version} = _get_version($dbh);
$config_data{vars} = {
map {
my ($variable, $value) = @$_;
if ( length($value) == 1024 && $mysql_version ge '5.7.0' ) {
my $var_sql = "SELECT \@\@global.$variable";
PTDEBUG && _d($dbh, $var_sql);
my $var_sth = $dbh->prepare($var_sql);
$var_sth->execute();
($value) = $var_sth->fetchrow_array();
}
$variable => $value
} @$rows
};
$config_data{mysql_version} = $mysql_version;
}
else {
die "Unknown config source";
@@ -10272,11 +10285,11 @@ sub main {
if ( $o->get('truncate-replicate-table') && $o->get('resume') ) {
die "--resume and truncate-replicate-table are mutually exclusive";
die "--resume and truncate-replicate-table are mutually exclusive";
}
if ( $o->get('truncate-replicate-table') && !$o->get('empty-replicate-table') ) {
die "--resume and --no-empty-replicate-table are mutually exclusive";
die "--truncate-replicate-table and --no-empty-replicate-table are mutually exclusive";
}
# ########################################################################

View File

@@ -9604,7 +9604,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -4297,7 +4297,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -4729,7 +4729,7 @@ sub version_check {
PTDEBUG && _d('Version check failed:', $EVAL_ERROR);
}
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
update_check_times(
instances => $instances_to_check,

View File

@@ -582,8 +582,8 @@ OS_NAME=
ARCH=
OS=
INSTALL=0
RPM_RELEASE=1
DEB_RELEASE=1
RPM_RELEASE=2
DEB_RELEASE=2
REVISION=0
GIT_BRANCH=${GIT_BRANCH}
GIT_REPO=https://github.com/percona/percona-toolkit.git

View File

@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'Percona Toolkit'
copyright = u'2024, Percona LLC and/or its affiliates'
copyright = u'2025, Percona LLC and/or its affiliates'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -50,7 +50,7 @@ copyright = u'2024, Percona LLC and/or its affiliates'
# The short X.Y version.
version = '3.7'
# The full version, including alpha/beta/rc tags.
release = '3.7.0'
release = '3.7.0-2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -202,7 +202,7 @@ htmlhelp_basename = 'PerconaToolkitdoc'
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'PerconaToolkit.tex', u'Percona Toolkit Documentation',
u'2024, Percona LLC and/or its affiliates', 'manual'),
u'2025, Percona LLC and/or its affiliates', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -236,5 +236,5 @@ latex_toplevel_sectioning = 'part'
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'perconatoolkit', u'Percona Toolkit Documentation',
[u'2024, Percona LLC and/or its affiliates'], 1)
[u'2025, Percona LLC and/or its affiliates'], 1)
]

View File

@@ -1,6 +1,26 @@
Release Notes
***************
v3.7.0-2 released 2025-05-14
==============================
This release addresses multiple security vulnerabilities reported in Percona Toolkit version 3.7.0, including issues related to the `libxml2` component (CVE-2024-56171, CVE-2025-24928), `openssl` (CVE-2024-12797), and `krb5` (CVE-2022-37967).
Bug Fixed
------------
* :jirabug:`PT-2442`: percona-toolkit:latest Vulnerability [CVE-2024-56171 CVE-2024-12797 CVE-2022-37967 CVE-2025-24928]
* :jirabug:`PT-2375`: pt-table-sync does not work with generated columns (Thanks to Henning Pöttker for the contribution)
* :jirabug:`PT-2400`: pt-table-checksum reports the error for warning code 4164
* :jirabug:`PT-2377`: pt-table-sync does not handle utf8 strings in JSON columns correctly (Thanks to Henning Pöttker for the contribution)
* :jirabug:`PT-2378`: pt-table-sync does print floating point numbers in SQL statements with insufficient precision (Thanks to Henning Pöttker for the contribution)
* :jirabug:`PT-2389`: pt-online-schema-change resume functionality doesn't work with ADD/DROP column (Thanks to Perry Harrington for the contribution)
* :jirabug:`PT-2410`: pt-archiver brokes when using output-format=csv and has null values (Thanks to Roberto de Bem for the contribution)
* :jirabug:`PT-2422`: pt-online-schema-change race overwrites new_table_name (Thanks to Perry Harrington for the contribution)
* :jirabug:`PT-2407`: pt-online-schema-change exit status(return code) is 0 even if it does NOT succeed
* :jirabug:`PT-2355`: pt-online-schema-change should not resume a job with empty boundaries
* :jirabug:`PT-1577`: pt-secure-collect, replace pt-secure-data in Usage section
v3.7.0 released 2024-12-23
==============================

26
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/percona/percona-toolkit
go 1.23.4
go 1.24.0
toolchain go1.24.1
@@ -9,7 +9,7 @@ require (
github.com/Ladicle/tabwriter v1.0.0
github.com/Masterminds/semver v1.5.0
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/alecthomas/kong v1.9.0
github.com/alecthomas/kong v1.11.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/go-ini/ini v1.67.0
github.com/golang/mock v1.6.0
@@ -28,12 +28,12 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.10.0
github.com/xlab/treeprint v1.2.0
go.mongodb.org/mongo-driver v1.17.3
golang.org/x/crypto v0.36.0
go.mongodb.org/mongo-driver v1.17.4
golang.org/x/crypto v0.39.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.32.3
k8s.io/api v0.33.1
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
)
@@ -45,7 +45,6 @@ require (
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/kr/text v0.2.0 // indirect
@@ -62,16 +61,17 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.32.3 // indirect
k8s.io/apimachinery v0.33.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

53
go.sum
View File

@@ -8,8 +8,8 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8v
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/kingpin v2.2.6+incompatible h1:5svnBTFgJjZvGKyYBtMB0+m5wvrbUHiqye8wRJMlnYI=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/kong v1.9.0 h1:Wgg0ll5Ys7xDnpgYBuBn/wPeLGAuK0NvYmEcisJgrIs=
github.com/alecthomas/kong v1.9.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
github.com/alecthomas/kong v1.11.0 h1:y++1gI7jf8O7G7l4LZo5ASFhrhJvzc+WgF/arranEmM=
github.com/alecthomas/kong v1.11.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
@@ -41,8 +41,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
@@ -86,8 +84,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
@@ -125,14 +123,14 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -146,15 +144,15 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -170,18 +168,18 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -205,17 +203,20 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=
k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k=
k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/api v0.33.1 h1:tA6Cf3bHnLIrUK4IqEgb2v++/GYUtqiu9sRVk3iBXyw=
k8s.io/api v0.33.1/go.mod h1:87esjTn9DRSRTD4fWMXamiXxJhpOIREjWOSjsW1kEHw=
k8s.io/apimachinery v0.33.1 h1:mzqXWV8tW9Rw4VeW9rEkqvnxj59k1ezDUl20tFK/oM4=
k8s.io/apimachinery v0.33.1/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA=
sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4=
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc=
sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@@ -111,11 +111,30 @@ sub _parse_config {
}
elsif ( my $dbh = $args{dbh} ) {
$config_data{format} = $args{format} || 'show_variables';
my $mysql_version = _get_version($dbh);
my $sql = "SHOW /*!40103 GLOBAL*/ VARIABLES";
PTDEBUG && _d($dbh, $sql);
my $rows = $dbh->selectall_arrayref($sql);
$config_data{vars} = { map { @$_ } @$rows };
$config_data{mysql_version} = _get_version($dbh);
$config_data{vars} = {
map {
my ($variable, $value) = @$_;
# Starting from MySQL 5.7.6, SHOW VARIABLES retrieves records from
# the performance_schema table named GLOBAL_VARIABLES. This table
# stores variable values in a VARCHAR(1024) column, meaning longer
# values may be truncated. However, the full value can still be
# retrieved by accessing the variable with SELECT @@GLOBAL.
# https://dev.mysql.com/doc/refman/5.7/en/information-schema-variables-table.html
if ( length($value) == 1024 && $mysql_version ge '5.7.0' ) {
my $var_sql = "SELECT \@\@global.$variable";
PTDEBUG && _d($dbh, $var_sql);
my $var_sth = $dbh->prepare($var_sql);
$var_sth->execute();
($value) = $var_sth->fetchrow_array();
}
$variable => $value
} @$rows
};
$config_data{mysql_version} = $mysql_version;
}
else {
die "Unknown config source";

View File

@@ -181,7 +181,7 @@ sub version_check {
}
# Always update the vc file, even if the version check fails.
if ( @$instances_to_check ) {
if ( $instances_to_check and @$instances_to_check ) {
eval {
# Update the check time for things we checked. I.e. if we
# didn't check it, do _not_ update its time.

View File

@@ -16,6 +16,6 @@ sphinx-tabs
certifi>=2024.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
jinja2>=3.1.6 # not directly required, pinned by Snyk to avoid a vulnerability
pygments>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability
requests>=2.31.0 # not directly required, pinned by Snyk to avoid a vulnerability
setuptools>=70.0.0 # not directly required, pinned by Snyk to avoid a vulnerability
requests>=2.32.4 # not directly required, pinned by Snyk to avoid a vulnerability
setuptools>=78.1.1 # not directly required, pinned by Snyk to avoid a vulnerability
idna>=3.7 # not directly required, pinned by Snyk to avoid a vulnerability

View File

@@ -16,7 +16,6 @@ import (
const (
planSummaryCollScan = "COLLSCAN"
planSummaryIXScan = "IXSCAN"
)
type StatsError struct {
@@ -106,9 +105,8 @@ func (s *Stats) Add(doc proto.SystemProfile) error {
if qiac.PlanSummary == planSummaryCollScan {
qiac.CollScanCount++
}
if strings.HasPrefix(qiac.PlanSummary, planSummaryIXScan) {
qiac.PlanSummary = planSummaryIXScan
}
qiac.PlanSummary = strings.Split(qiac.PlanSummary, " ")[0]
qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned))
qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis))

View File

@@ -28,31 +28,33 @@ type sslSecret struct {
// Dumper struct is for dumping cluster
type Dumper struct {
cmd string
kubeconfig string
resources []string
filePaths []string
fileContainer string
namespace string
location string
errors string
mode int64
crType string
forwardport string
sslSecrets []sslSecret
cmd string
kubeconfig string
resources []string
filePaths []string
fileContainer string
namespace string
location string
errors string
mode int64
crType string
forwardport string
sslSecrets []sslSecret
skipPodSummary bool
}
var resourcesRe = regexp.MustCompile(`(\w+\.(\w+).percona\.com)`)
// New return new Dumper object
func New(location, namespace, resource string, kubeconfig string, forwardport string) Dumper {
func New(location, namespace, resource string, kubeconfig string, forwardport string, skipPodSummary bool) Dumper {
d := Dumper{
cmd: "kubectl",
kubeconfig: kubeconfig,
location: "cluster-dump",
mode: int64(0o777),
namespace: namespace,
forwardport: forwardport,
cmd: "kubectl",
kubeconfig: kubeconfig,
location: "cluster-dump",
mode: int64(0o777),
namespace: namespace,
forwardport: forwardport,
skipPodSummary: skipPodSummary,
}
resources := []string{
"pods",
@@ -352,18 +354,20 @@ func (d *Dumper) DumpCluster() error {
crName = pod.Labels["app.kubernetes.io/instance"]
}
// Get summary
output, err = d.getPodSummary(resourceType(d.crType), pod.Name, crName, ns.Name)
if err != nil {
d.logError(err.Error(), d.crType, pod.Name)
err = addToArchive(location, d.mode, []byte(err.Error()), tw)
if !d.skipPodSummary {
output, err = d.getPodSummary(resourceType(d.crType), pod.Name, crName, ns.Name)
if err != nil {
log.Printf("Error: create summary errors archive for pod %s in namespace %s: %v", pod.Name, ns.Name, err)
}
} else {
err = addToArchive(location, d.mode, output, tw)
if err != nil {
d.logError(err.Error(), "create summary archive for pod "+pod.Name)
log.Printf("Error: create summary archive for pod %s: %v", pod.Name, err)
d.logError(err.Error(), d.crType, pod.Name)
err = addToArchive(location, d.mode, []byte(err.Error()), tw)
if err != nil {
log.Printf("Error: create summary errors archive for pod %s in namespace %s: %v", pod.Name, ns.Name, err)
}
} else {
err = addToArchive(location, d.mode, output, tw)
if err != nil {
d.logError(err.Error(), "create summary archive for pod "+pod.Name)
log.Printf("Error: create summary archive for pod %s: %v", pod.Name, err)
}
}
}

View File

@@ -28,6 +28,7 @@ func main() {
kubeconfig := ""
forwardport := ""
version := false
skipPodSummary := false
flag.StringVar(&namespace, "namespace", "", "Namespace for collecting data. If empty data will be collected from all namespaces")
flag.StringVar(&resource, "resource", "auto", "Collect data, specific to the resource. Supported values: pxc, psmdb, pg, pgv2, ps, none, auto")
@@ -35,6 +36,7 @@ func main() {
flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to kubeconfig")
flag.StringVar(&forwardport, "forwardport", "", "Port to use for port forwarding")
flag.BoolVar(&version, "version", false, "Print version")
flag.BoolVar(&skipPodSummary, "skip-pod-summary", false, "Skip pod summary collection")
flag.Parse()
if version {
@@ -50,7 +52,7 @@ func main() {
resource += "/" + clusterName
}
d := dumper.New("", namespace, resource, kubeconfig, forwardport)
d := dumper.New("", namespace, resource, kubeconfig, forwardport, skipPodSummary)
log.Println("Start collecting cluster data")
err := d.DumpCluster()

View File

@@ -365,6 +365,106 @@ func TestSSLResourceOption(t *testing.T) {
}
}
/*
Tests for option --skip-pod-summary
*/
func TestPT_2453(t *testing.T) {
testcmd := []string{"sh", "-c", "tar -tf cluster-dump.tar.gz --wildcards '*/summary.txt' 2>/dev/null | wc -l"}
tests := []struct {
name string
resource string
want string
kubeconfig string
}{
{
name: "none",
resource: "none",
want: "0",
kubeconfig: "",
},
{
name: "pxc",
resource: "pxc",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PXC"),
},
{
name: "ps",
resource: "ps",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PS"),
},
{
name: "psmdb",
resource: "psmdb",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PSMDB"),
},
{
name: "pg",
resource: "pg",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PG"),
},
{
name: "pgv2",
resource: "pgv2",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PG2"),
},
{
name: "auto pxc",
resource: "auto",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PXC"),
},
{
name: "auto ps",
resource: "auto",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PS"),
},
{
name: "auto psmdb",
resource: "auto",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PSMDB"),
},
{
name: "auto pg",
resource: "auto",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PG"),
},
{
name: "auto pgv2",
resource: "auto",
want: "0",
kubeconfig: os.Getenv("KUBECONFIG_PG2"),
},
}
for _, test := range tests {
cmd := exec.Command("../../../bin/pt-k8s-debug-collector", "--kubeconfig", test.kubeconfig, "--forwardport", os.Getenv("FORWARDPORT"), "--resource", test.resource, "--skip-pod-summary")
if err := cmd.Run(); err != nil {
t.Errorf("error executing pt-k8s-debug-collector: %s\nCommand: %s", err.Error(), cmd.String())
}
defer func() {
cmd = exec.Command("rm", "-f", "cluster-dump.tar.gz")
if err := cmd.Run(); err != nil {
t.Errorf("error cleaning up test data: %s", err.Error())
}
}()
out, err := exec.Command(testcmd[0], testcmd[1:]...).Output()
if err != nil {
t.Errorf("test %s, error running command %s:\n%s\n\nCommand output:\n%s", test.name, testcmd, err.Error(), out)
}
if strings.TrimRight(bytes.NewBuffer(out).String(), "\n") != test.want {
t.Errorf("test %s, output is not as expected\nOutput: %s\nWanted: %s", test.name, out, test.want)
}
}
}
/*
Option --version
*/

View File

@@ -0,0 +1,117 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-config-diff";
require VersionParser;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
my ($ver, $reset, $set_short, $set_long);
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox source';
}
if ( $sandbox_version ge '5.7' ) {
$reset = q{SET GLOBAL session_track_system_variables = ''};
$set_short =
q{SET GLOBAL session_track_system_variables = '}.
q{activate_all_roles_on_login,admin_address,}.
q{admin_port,admin_ssl_ca,admin_ssl_capath,admin_ssl_cert,}.
q{admin_ssl_cipher,admin_ssl_crl,admin_ssl_crlpath,admin_ssl_key,}.
q{admin_tls_ciphersuites,admin_tls_version,authentication_policy,}.
q{auto_generate_certs,auto_increment_increment,}.
q{auto_increment_offset,autocommit,automatic_sp_privileges,}.
q{back_log,basedir,big_tables,bind_address,binlog_cache_size,}.
q{binlog_checksum,binlog_ddl_skip_rewrite,}.
q{binlog_direct_non_transactional_updates,binlog_encryption,}.
q{binlog_error_action,binlog_expire_logs_auto_purge,}.
q{binlog_expire_logs_seconds,binlog_format,binlog_group_commit_sync_delay,}.
q{binlog_group_commit_sync_no_delay_count,binlog_gtid_simple_recovery,}.
q{binlog_max_flush_queue_time,binlog_order_commits,}.
q{binlog_rotate_encryption_master_key_at_startup,binlog_row_event_max_size,}.
q{binlog_row_image,binlog_row_metadata,binlog_row_value_options,}.
q{binlog_rows_query_log_events,binlog_skip_flush_commands,}.
q{binlog_space_limit,binlog_stmt_cache_size'};
$set_long =
q{SET GLOBAL session_track_system_variables = '}.
q{activate_all_roles_on_login,admin_address,}.
q{admin_port,admin_ssl_ca,admin_ssl_capath,admin_ssl_cert,}.
q{admin_ssl_cipher,admin_ssl_crl,admin_ssl_crlpath,admin_ssl_key,}.
q{admin_tls_ciphersuites,admin_tls_version,authentication_policy,}.
q{auto_generate_certs,auto_increment_increment,}.
q{auto_increment_offset,autocommit,automatic_sp_privileges,}.
q{back_log,basedir,big_tables,bind_address,binlog_cache_size,}.
q{binlog_checksum,binlog_ddl_skip_rewrite,}.
q{binlog_direct_non_transactional_updates,binlog_encryption,}.
q{binlog_error_action,binlog_expire_logs_auto_purge,}.
q{binlog_expire_logs_seconds,binlog_format,binlog_group_commit_sync_delay,}.
q{binlog_group_commit_sync_no_delay_count,binlog_gtid_simple_recovery,}.
q{binlog_max_flush_queue_time,binlog_order_commits,}.
q{binlog_rotate_encryption_master_key_at_startup,binlog_row_event_max_size,}.
q{binlog_row_image,binlog_row_metadata,binlog_row_value_options,}.
q{binlog_rows_query_log_events,binlog_skip_flush_commands,}.
q{binlog_space_limit,binlog_stmt_cache_size,}.
q{binlog_transaction_compression,binlog_transaction_compression_level_zstd'};
}
else {
plan skip_all => "Requires MySQL 5.7 or newer";
}
my $output;
my $retval;
$sb->do_as_root('source', $set_short);
$output = output(
sub { $retval = pt_config_diff::main(
"${trunk}/t/pt-config-diff/samples/long_vars_1.cnf",
'h=127.1,P=12345,u=msandbox,p=msandbox')
},
stderr => 1,
);
is(
$retval,
0,
"No diff on variable value up to 1024 bytes long"
);
$sb->do_as_root('source', $set_long);
$output = output(
sub { $retval = pt_config_diff::main(
"${trunk}/t/pt-config-diff/samples/long_vars_2.cnf",
'h=127.1,P=12345,u=msandbox,p=msandbox')
},
stderr => 1,
);
is(
$retval,
0,
"No diff on variable value longer than 1024 bytes"
);
# #############################################################################
# Done.
# #############################################################################
$sb->do_as_root('source', $reset);
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;

View File

@@ -0,0 +1,2 @@
[mysqld]
session_track_system_variables = 'activate_all_roles_on_login,admin_address,admin_port,admin_ssl_ca,admin_ssl_capath,admin_ssl_cert,admin_ssl_cipher,admin_ssl_crl,admin_ssl_crlpath,admin_ssl_key,admin_tls_ciphersuites,admin_tls_version,authentication_policy,auto_generate_certs,auto_increment_increment,auto_increment_offset,autocommit,automatic_sp_privileges,back_log,basedir,big_tables,bind_address,binlog_cache_size,binlog_checksum,binlog_ddl_skip_rewrite,binlog_direct_non_transactional_updates,binlog_encryption,binlog_error_action,binlog_expire_logs_auto_purge,binlog_expire_logs_seconds,binlog_format,binlog_group_commit_sync_delay,binlog_group_commit_sync_no_delay_count,binlog_gtid_simple_recovery,binlog_max_flush_queue_time,binlog_order_commits,binlog_rotate_encryption_master_key_at_startup,binlog_row_event_max_size,binlog_row_image,binlog_row_metadata,binlog_row_value_options,binlog_rows_query_log_events,binlog_skip_flush_commands,binlog_space_limit,binlog_stmt_cache_size'

View File

@@ -0,0 +1,2 @@
[mysqld]
session_track_system_variables = 'activate_all_roles_on_login,admin_address,admin_port,admin_ssl_ca,admin_ssl_capath,admin_ssl_cert,admin_ssl_cipher,admin_ssl_crl,admin_ssl_crlpath,admin_ssl_key,admin_tls_ciphersuites,admin_tls_version,authentication_policy,auto_generate_certs,auto_increment_increment,auto_increment_offset,autocommit,automatic_sp_privileges,back_log,basedir,big_tables,bind_address,binlog_cache_size,binlog_checksum,binlog_ddl_skip_rewrite,binlog_direct_non_transactional_updates,binlog_encryption,binlog_error_action,binlog_expire_logs_auto_purge,binlog_expire_logs_seconds,binlog_format,binlog_group_commit_sync_delay,binlog_group_commit_sync_no_delay_count,binlog_gtid_simple_recovery,binlog_max_flush_queue_time,binlog_order_commits,binlog_rotate_encryption_master_key_at_startup,binlog_row_event_max_size,binlog_row_image,binlog_row_metadata,binlog_row_value_options,binlog_rows_query_log_events,binlog_skip_flush_commands,binlog_space_limit,binlog_stmt_cache_size,binlog_transaction_compression,binlog_transaction_compression_level_zstd'

View File

@@ -17,12 +17,6 @@ use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-query-digest";
ok (1,
"version checking site offline for now"
);
done_testing;
exit 0;
my $output;
my $cmd = "$trunk/bin/pt-query-digest --limit 1 $trunk/t/lib/samples/slowlogs/slow001.txt";
@@ -49,7 +43,7 @@ ok(
like(
$output,
qr/# Query 1: 0 QPS, 0x concurrency, ID 0x7F7D57ACDD8A346E at byte 0/,
qr/# Query 1: 0 QPS, 0x concurrency, ID 0xA853B50CDEB4866B3A99CC42AEDCCFCD at byte 359/,
"Tool ran after version-check"
) or diag(Dumper($output));
@@ -172,6 +166,23 @@ ok(
unlink "/tmp/pt-query-digest.$PID" if "/tmp/pt-query-digest.$PID";
# #############################################################################
# # PT-2129 - tools fail on non-readable version check file
# #############################################################################
system("touch $vc_file");
chmod 0000, $vc_file;
$output = `$cmd --version-check 2>&1`;
unlike(
$output,
qr/Can't use an undefined value as an ARRAY reference/,
'No undefined value error'
) or diag($output);
chmod 0664, $vc_file;
# #############################################################################
# Done.
# #############################################################################

View File

@@ -378,6 +378,29 @@ is(
diag(`/tmp/12346/stop >/dev/null`);
diag(`/tmp/12346/start >/dev/null`);
# #############################################################################
# typo in pt-table-checksum error message
# https://perconadev.atlassian.net/browse/PT-2424
# #############################################################################
$output = output(sub {
pt_table_checksum::main($source_dsn,
qw(--no-empty-replicate-table --truncate-replicate-table)
)},
stderr => 1,
);
unlike(
$output,
qr/--resume and --no-empty-replicate-table are mutually exclusive/,
"PT-2424: no typo in the error message"
);
like(
$output,
qr/--truncate-replicate-table and --no-empty-replicate-table are mutually exclusive/,
"PT-2424: correct error message"
);
#
# #############################################################################