Compare commits

...

71 Commits

Author SHA1 Message Date
dependabot[bot]
0481ea044d build(deps): bump golang.org/x/crypto from 0.45.0 to 0.46.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.45.0 to 0.46.0.
- [Commits](https://github.com/golang/crypto/compare/v0.45.0...v0.46.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:01:43 +00:00
Jiří Čtvrtka
b4475a0d1e Merge pull request #1040 from percona/PMM-7-bump-versions
PMM-7 Bump versions.
2025-12-05 10:09:42 +01:00
Sveta Smirnova
4cc67ff679 Merge pull request #1041 from surbhat1595/PKG261
Add support for Amazon Linux 2023
2025-12-04 16:42:43 +03:00
Surabhi Bhat
4dc09d253f PKG-414 Add support for Amazon Linux 2023 2025-12-04 18:01:52 +05:30
Jiří Čtvrtka
ceac1d438d PMM-7 Update sort. 2025-12-04 09:30:21 +01:00
Jiří Čtvrtka
bff9437728 PMM-7 Bump go in yml. 2025-12-04 09:24:24 +01:00
Jiří Čtvrtka
ae9a8db6bc PMM-7 Bump versions. 2025-12-04 09:19:51 +01:00
Sveta Smirnova
8918850389 Merge pull request #1039 from percona/PT-2498_pt-sift_does_not_work_starting_from_version_3.7.0
PT-2498 - pt-sift does not work starting from version 3.7.0
2025-12-03 16:34:03 +03:00
Sveta Smirnova
b95730100b Merge pull request #1038 from percona/PT-2497_pt-2052.t_fails_in_December
PT-2497 - t/pt-table-checksum/pt-2052.t fails in December
2025-12-03 16:33:41 +03:00
Sveta Smirnova
0f0e1fb284 Merge pull request #1036 from percona/PT-2250_pt-table-checksum_reports_error_if_recursion_method_is_DSN
Pt 2250 pt table checksum reports error if recursion method is dsn
2025-12-03 16:33:25 +03:00
Sveta Smirnova
daac29c3a7 Merge pull request #1035 from percona/PT-2495_replication_filters.t_fails_on_Debian-based_distributions
PT-2495 - t/pt-table-checksum/replication_filters.t fails on Debian-b…
2025-12-03 16:33:05 +03:00
Sveta Smirnova
45dfae9a27 Merge pull request #1037 from percona/dependabot/go_modules/github.com/hashicorp/go-version-1.8.0
build(deps): bump github.com/hashicorp/go-version from 1.7.0 to 1.8.0
2025-12-01 16:35:41 +03:00
Sveta Smirnova
380a8085de PT-2498 - pt-sift does not work starting from version 3.7.0
- Added missed module into the tool
- Modified test case, so it tests if this interactive tool works, so we
  do not miss cases like this in the future
2025-12-01 16:21:11 +03:00
Sveta Smirnova
1476171e09 PT-2497 - t/pt-table-checksum/pt-2052.t fails in December
- Adjusted formula for timelocal in the test file
2025-12-01 14:59:51 +03:00
dependabot[bot]
a9b8eb402c build(deps): bump github.com/hashicorp/go-version from 1.7.0 to 1.8.0
Bumps [github.com/hashicorp/go-version](https://github.com/hashicorp/go-version) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/hashicorp/go-version/releases)
- [Changelog](https://github.com/hashicorp/go-version/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-version/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-version
  dependency-version: 1.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 10:02:29 +00:00
Sveta Smirnova
c6c352023a PT-2250 - pt-table-checksum reports error if recursion method is DSN
- Adjusted t/lib/MasterSlave.t, so it reflects new API in lib/MasterSlave.pm
2025-11-27 23:53:38 +03:00
Sveta Smirnova
d835d8c4f4 PT-2250 - pt-table-checksum reports error if recursion method is DSN
- Removed unrelated comments and spaces
2025-11-27 20:16:41 +03:00
Sveta Smirnova
70bd9164f8 Merge pull request #1034 from percona/PT-2494_pt-2052.t_fails_with_SSL_error
PT-2494 - t/pt-table-checksum/pt-2052.t fails with SSL error
2025-11-26 00:08:44 +03:00
Sveta Smirnova
2b350d908e PT-2250 - pt-table-checksum reports error if recursion method is DSN
- We are now setting parent to current source server in get_cxn_from_dsn_table
2025-11-25 17:00:12 +03:00
Sveta Smirnova
ba4f650fad PT-2495 - t/pt-table-checksum/replication_filters.t fails on Debian-based distributions
- Specified locale for the sort operation
2025-11-24 17:52:35 +03:00
Sveta Smirnova
b6df68eb35 Merge pull request #1030 from percona/PT-2492_t_pt-online-schema-change_pt-200.t_fails_after_fix_for_PT-1151
PT-2492 t/pt/online_schema_change/pt-200.t fails after fix for pt-1151
2025-11-24 16:59:20 +03:00
Sveta Smirnova
8121bf7468 Merge pull request #1026 from percona/dependabot/go_modules/github.com/alecthomas/kong-1.13.0
build(deps): bump github.com/alecthomas/kong from 1.12.1 to 1.13.0
2025-11-24 14:07:55 +03:00
Sveta Smirnova
242454184a Merge pull request #1027 from percona/dependabot/go_modules/k8s.io/api-0.34.2
build(deps): bump k8s.io/api from 0.34.1 to 0.34.2
2025-11-24 14:07:41 +03:00
Sveta Smirnova
48842df48b Merge pull request #1028 from percona/dependabot/go_modules/golang.org/x/crypto-0.45.0
build(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0
2025-11-24 14:07:21 +03:00
Sveta Smirnova
c864a9195b Merge pull request #1032 from percona/dependabot/github_actions/actions/checkout-6
build(deps): bump actions/checkout from 5 to 6
2025-11-24 14:06:25 +03:00
Sveta Smirnova
49b4293207 PT-2494 - t/pt-table-checksum/pt-2052.t fails with SSL error
- Added option s=1 to DSNs
2025-11-24 13:16:00 +03:00
Sveta Smirnova
1b1fc5ba35 Merge pull request #1031 from percona/PT-2493_pt-pmp.t_fails_on_Debian_distributions
PT-2493 - t/pt-pmp/pt-pmp.t fails on Debian distributions
2025-11-24 13:07:51 +03:00
Sveta Smirnova
1f2b9e4cb7 Merge pull request #1029 from percona/PT-2489_pt-mext.t_fails_on_Debian-based_platforms
Pt 2489 pt mext.t fails on debian based platforms
2025-11-24 13:07:23 +03:00
dependabot[bot]
c13714ebd8 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 09:06:18 +00:00
Sveta Smirnova
5dbef38fa1 PT-2493 - t/pt-pmp/pt-pmp.t fails on Debian distributions
- Specified locale in the test
2025-11-21 23:55:31 +03:00
Sveta Smirnova
95588dd76e PT-2492 - t/pt-online-schema-change/pt-200.t fails after fix for PT-1151
- Fixed typo in bin/pt-table-checksum
2025-11-21 23:30:50 +03:00
Sveta Smirnova
dcc1cff519 PT-2492 - t/pt-online-schema-change/pt-200.t fails after fix for PT-1151
- Added s=1 to tests for SSL support in 8.4
2025-11-21 23:12:36 +03:00
Sveta Smirnova
eed2c43dcc PT-2492 - t/pt-online-schema-change/pt-200.t fails after fix for PT-1151
- Updated regular expression
2025-11-21 17:06:59 +03:00
dependabot[bot]
6ab67f79bf build(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 13:22:31 +00:00
Sveta Smirnova
7987420976 Merge pull request #1024 from percona/dependabot/go_modules/go.mongodb.org/mongo-driver-1.17.6
build(deps): bump go.mongodb.org/mongo-driver from 1.17.4 to 1.17.6
2025-11-21 16:21:25 +03:00
Sveta Smirnova
836d097797 Merge pull request #1020 from percona/dependabot/github_actions/actions/upload-artifact-5.0.0
build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0
2025-11-21 16:21:02 +03:00
Sveta Smirnova
f3a2f9d2fe PT-2489 - t/pt-mext/pt-mext.t fails on Debian-based platforms
- Add sort to the RSA test too
2025-11-20 23:18:48 +03:00
Sveta Smirnova
032eac7dc0 PT-2489 - t/pt-mext/pt-mext.t fails on Debian-based platforms
- Changed locale C to en_US.utf8. Added LANG=en_US.utf8 to keep sort
  working on our AMIs and kept LOCALE=en_US.utf8 to keep fix for PT-2149
2025-11-20 23:14:05 +03:00
dependabot[bot]
e9475fccd5 build(deps): bump k8s.io/api from 0.34.1 to 0.34.2
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.34.1 to 0.34.2.
- [Commits](https://github.com/kubernetes/api/compare/v0.34.1...v0.34.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 09:02:01 +00:00
dependabot[bot]
c44a5c2aa7 build(deps): bump github.com/alecthomas/kong from 1.12.1 to 1.13.0
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.12.1 to 1.13.0.
- [Commits](https://github.com/alecthomas/kong/compare/v1.12.1...v1.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 09:01:55 +00:00
dependabot[bot]
f46112d74c build(deps): bump go.mongodb.org/mongo-driver from 1.17.4 to 1.17.6
Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.17.4 to 1.17.6.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](https://github.com/mongodb/mongo-go-driver/compare/v1.17.4...v1.17.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-13 13:31:19 +00:00
Sveta Smirnova
06b08ff9bb Merge pull request #1021 from surbhat1595/3.x
PKG-1138 Build percona-toolkit on deb13
2025-11-13 16:30:52 +03:00
Sveta Smirnova
d784831e68 Merge pull request #1017 from percona/dependabot/go_modules/golang.org/x/crypto-0.43.0
build(deps): bump golang.org/x/crypto from 0.42.0 to 0.43.0
2025-11-13 16:29:28 +03:00
Sveta Smirnova
247bc246fb Merge pull request #1013 from percona/PMM-11406-percona-toolkit-update
PMM-11406 Better check to prevent errors from missing fields.
2025-11-12 21:41:55 +03:00
Surabhi Bhat
602a87f438 PKG-1138 Build percona-toolkit on deb13 2025-10-31 14:42:29 +05:30
dependabot[bot]
8979200e8f build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.6.2...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 09:31:45 +00:00
dependabot[bot]
cccfbd9f47 build(deps): bump golang.org/x/crypto from 0.42.0 to 0.43.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.42.0 to 0.43.0.
- [Commits](https://github.com/golang/crypto/compare/v0.42.0...v0.43.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 09:21:58 +00:00
Jiří Čtvrtka
2301bf9956 PMM-11406 Test refactor. 2025-10-02 14:01:29 +02:00
Jiří Čtvrtka
7a26991fb3 PMM-11406 Another typo. 2025-10-02 13:44:30 +02:00
Jiří Čtvrtka
d016effd18 PMM-11406 Fix typos in repo. 2025-10-02 13:39:09 +02:00
Jiří Čtvrtka
de72fb9bbc PMM-11406 Change test to verify if we got some GetHostInfoResult. 2025-10-02 13:22:10 +02:00
Sveta Smirnova
0289a1a6b4 Merge pull request #1015 from percona/dependabot/go_modules/golang.org/x/crypto-0.42.0
build(deps): bump golang.org/x/crypto from 0.41.0 to 0.42.0
2025-09-19 17:36:00 +03:00
Sveta Smirnova
f9452ef406 Merge pull request #1016 from percona/dependabot/go_modules/k8s.io/api-0.34.1
build(deps): bump k8s.io/api from 0.34.0 to 0.34.1
2025-09-19 17:35:43 +03:00
Sveta Smirnova
e60f742f36 Merge pull request #1009 from percona/dependabot/github_actions/actions/setup-go-6
build(deps): bump actions/setup-go from 5 to 6
2025-09-16 13:49:12 +03:00
Sveta Smirnova
527ba7ef33 Merge pull request #999 from percona/PT-1564_Man_page_broken_for_pt-secure-collect
PT-1564 - Man page broken for pt-secure-collect
2025-09-16 13:41:11 +03:00
Sveta Smirnova
64ced79f7d Merge pull request #1005 from percona/PT-2289_Allow_pt-stalk_do_disable_ps-lock-transactions_data_collection_via_parameter
Pt 2289 allow pt stalk do disable ps lock transactions data collection via parameter
2025-09-16 13:40:22 +03:00
Jiří Čtvrtka
84889adbfb PMM-11406 Test to check current results. 2025-09-15 12:03:52 +02:00
dependabot[bot]
ea8fc17dbc build(deps): bump k8s.io/api from 0.34.0 to 0.34.1
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.34.0 to 0.34.1.
- [Commits](https://github.com/kubernetes/api/compare/v0.34.0...v0.34.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 09:50:34 +00:00
dependabot[bot]
11e73c8b60 build(deps): bump golang.org/x/crypto from 0.41.0 to 0.42.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.41.0 to 0.42.0.
- [Commits](https://github.com/golang/crypto/compare/v0.41.0...v0.42.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 09:21:40 +00:00
Sveta Smirnova
fb1f5be339 Update Makefile.PL
Co-authored-by: EvgeniyPatlan <evgeniy.patlan@percona.com>
2025-09-10 18:20:44 +03:00
Sveta Smirnova
bfeaa98379 PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter
- Fixed typo found during review
2025-09-10 18:19:03 +03:00
Jiří Čtvrtka
f72d9c9637 PMM-11406 Remove unused method. 2025-09-09 20:16:53 +02:00
Sveta Smirnova
b07dd2792d PR-1013 - PMM-11406 Better check to prevent errors from missing fields
- Fixed log.Infof call on line 211
2025-09-09 16:57:02 +03:00
Jiří Čtvrtka
b2e25133e0 PMM-11406 Better check to prevent errors from missing fields. 2025-09-09 11:58:29 +02:00
dependabot[bot]
de69a69076 build(deps): bump actions/setup-go from 5 to 6
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:18:06 +00:00
Sveta Smirnova
919970abe9 PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter
- Modified t/pt-stalk/pt-stalk.t, so it calls function purge_samples with the correct number of parameters
- Fixed purge_samples, so it can work if variable OPT_PREFIX is not defined
2025-09-07 01:34:05 +03:00
Sveta Smirnova
cdc24c10f0 PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter
- Implemented _should_skip function as was suggested
2025-09-05 16:08:43 +03:00
Sveta Smirnova
66d20ae6da PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter
- Adjusted the implementation
- Created test cases
2025-09-03 00:41:06 +03:00
Sveta Smirnova
68a4540a3d PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter
- Implemented feature
- Started working on the test
2025-09-01 18:17:04 +03:00
Sveta Smirnova
cd36511b52 Merge branch '3.x' into PT-1564_Man_page_broken_for_pt-secure-collect 2025-08-26 19:45:04 +03:00
Sveta Smirnova
1a3f42acb1 PT-1564 - Man page broken for pt-secure-collect
- Removed non-working condition from Makefile.PL
- Added working condition for creating MAN1PODS hash
2025-08-26 19:36:46 +03:00
44 changed files with 874 additions and 336 deletions

View File

@@ -11,6 +11,6 @@ jobs:
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: run util/check_bin_md5sum
run: ./util/check_bin_md5sum

View File

@@ -20,5 +20,5 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: crate-ci/typos@master

View File

@@ -15,12 +15,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '1.24'
go-version: '1.25'
- name: Build
run: cd src/go; make linux-amd64; cd ../../
@@ -36,7 +36,7 @@ jobs:
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v5.0.0
with:
name: binaries
path: bin/*

View File

@@ -12,21 +12,17 @@ MAKE_GOTOOLS
WriteMakefile(
NAME => 'Percona::Toolkit',
VERSION => '3.7.0-2',
EXE_FILES => [
map {
(my $name = $_) =~ s/^bin.//;
my $file_name = $_;
if ( ( $file_name !~ m/mongo/ ) || ( $file_name !~ m/pg/ ) || ( $file_name !~ m/pt-stalk/ ) || ( $file_name !~ m/pt-k8s/ ) ) {
$_;
}
} <bin/*>
],
EXE_FILES => [ <bin/*> ],
MAN1PODS => {
'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',
map {
(my $name = $_) =~ s/^bin.//;
my $file_name = $_;
if ( ( $file_name !~ m/mongo/ ) || ( $file_name !~ m/pg/ ) || ( $file_name !~ m/pt-stalk/ ) || ( $file_name !~ m/pt-k8s/ ) ) {
if ( $file_name =~ m/(mongo|pg|galera|k8s|secure)/ ) {
# We have to put empty line here to avoid the MAN1PODS hash corruption
'' => '',
}
else {
$_ => "blib/man1/$name.1p";
}
} <bin/*>
@@ -37,4 +33,4 @@ WriteMakefile(
DBI => 1.46,
DBD::mysql => 3.0000_0,
},
);
);

View File

@@ -3735,11 +3735,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -4506,11 +4512,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -4556,7 +4562,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -191,11 +191,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -962,11 +968,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -1012,7 +1018,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -4009,11 +4009,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -4780,11 +4786,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -4830,7 +4836,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}
@@ -8731,7 +8737,7 @@ type: string; default: Query
group: Actions
Comma sepatated list of commands that will be watched/killed if they ran for
Comma separated list of commands that will be watched/killed if they ran for
more than L<"--busy-time"> seconds. Default: C<Query>
By default, L<"--busy-time"> kills only C<Query> commands but in some cases, it

View File

@@ -4300,11 +4300,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -5071,11 +5077,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -5121,7 +5127,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}
@@ -11211,7 +11217,7 @@ sub get_unique_index_fields {
$clean .= $suffix;
my $fields = [];
my $fields_re = qr/\s(?:(?:(?:PRIMARY|UNIQUE)\s+(?:INDEX|KEY|))|UNIQUE)\s*(?:.*?)\s*\((.*?)\)/i;
my $fields_re = qr/\s(?:(?:(?:PRIMARY|UNIQUE)\s+(?:INDEX|KEY))|UNIQUE)\s*(?:[^\s]*?)\s*\((.*?)\)/i;
while($clean =~ /$fields_re/g) {
push @$fields, [ split /\s*,\s*/, $1 ];
@@ -11668,7 +11674,7 @@ sub check_orig_table {
Cxn => $cxn,
tbl => $orig_tbl,
chunk_size => $o->get('chunk-size'),
chunk_indx => $o->get('chunk-index'),
chunk_index => $o->get('chunk-index'),
OptionParser => $o,
TableParser => $tp,
);
@@ -13512,7 +13518,7 @@ New rows will use the user defined default value if specified for the column.
=item --only-same-schema-fks
Check foreigns keys only on tables on the same schema than the original table.
This option is dangerous since if you have FKs refenrencing tables in other
This option is dangerous since if you have FKs referencing tables in other
schemas, they won't be detected.

View File

@@ -6239,7 +6239,7 @@ sub _get_value {
unless $found_value;
}
else {
die "Event does not have attribute $attrib and there are no alterantes";
die "Event does not have attribute $attrib and there are no alternates";
}
return $value;
@@ -10606,11 +10606,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -11377,11 +11383,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -11427,7 +11433,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -2338,11 +2338,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -3109,11 +3115,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -3159,7 +3165,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -2752,11 +2752,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -3523,11 +3529,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -3573,7 +3579,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -93,6 +93,53 @@ rm_tmpdir() {
# End tmpdir package
# ###########################################################################
# ###########################################################################
# alt_cmds package
# This package is a copy without comments from the original. The original
# with comments and its test file can be found in the GitHub repository at,
# lib/bash/alt_cmds.sh
# t/lib/bash/alt_cmds.sh
# See https://github.com/percona/percona-toolkit for more information.
# ###########################################################################
set -u
_seq() {
local i="$1"
awk "BEGIN { for(i=1; i<=$i; i++) print i; }"
}
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
}
_lsof() {
local pid="$1"
if ! lsof -p $pid 2>/dev/null; then
/bin/ls -l /proc/$pid/fd 2>/dev/null
fi
}
_which() {
if [ -x /usr/bin/which ]; then
/usr/bin/which "$1" 2>/dev/null | awk '{print $1}'
elif which which 1>/dev/null 2>&1; then
which "$1" 2>/dev/null | awk '{print $1}'
else
echo "$1"
fi
}
# ###########################################################################
# End alt_cmds package
# ###########################################################################
# ###########################################################################
# parse_options package
# This package is a copy without comments from the original. The original

View File

@@ -971,8 +971,10 @@ collect_mysql_data_one() {
fi
fi
$CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
mysqladmin_pid=$!
if ! _should_skip "mysqladmin"; then
$CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
mysqladmin_pid=$!
fi
ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
@@ -1014,18 +1016,25 @@ collect_system_data() {
collect_mysql_data_loop() {
if ! _should_skip "processlist"; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \
>> "$d/$p-processlist" &
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \
>> "$d/$p-threads" &
if [ "$have_lock_waits_table" ]; then
(echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" &
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ]; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \
>> "$d/$p-threads" &
if [ "$have_lock_waits_table" ]; then
if ! _should_skip "lock-waits"; then
(echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" &
fi
if ! _should_skip "transactions"; then
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
fi
if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \
&& ! _should_skip "ps-locks-transactions"; then
ps_locks_transactions "$d/$p-ps-locks-transactions"
fi
@@ -1252,20 +1261,22 @@ innodb_status() {
local innostat=""
$CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \
>> "$d/$p-innodbstatus$n"
grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || {
if [ -d /proc -a -d /proc/$mysqld_pid ]; then
for fd in /proc/$mysqld_pid/fd/*; do
file $fd | grep deleted >/dev/null && {
grep 'INNODB' $fd >/dev/null && {
cat $fd > "$d/$p-innodbstatus$n"
break
if ! _should_skip "innodbstatus"; then
$CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \
>> "$d/$p-innodbstatus$n"
grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || {
if [ -d /proc -a -d /proc/$mysqld_pid ]; then
for fd in /proc/$mysqld_pid/fd/*; do
file $fd | grep deleted >/dev/null && {
grep 'INNODB' $fd >/dev/null && {
cat $fd > "$d/$p-innodbstatus$n"
break
}
}
}
done
fi
}
done
fi
}
fi
}
rocksdb_status() {
@@ -1274,7 +1285,7 @@ rocksdb_status() {
has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'`
exit_code=$?
if [ $exit_code -eq 0 ]; then
if [ $exit_code -eq 0 ] && ! _should_skip "rocksdbstatus"; then
$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \
>> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n"
fi
@@ -1356,20 +1367,34 @@ collect_mysql_variables() {
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
if ! _should_skip "thread-variables"; then
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
fi
}
_should_skip() {
local name=$1
for item in "${OPT_SKIP_COLLECTION[@]}"; do
if [ "$item" == "$name" ]; then
return 0
fi
done
return 1
}
# ###########################################################################
# End collect package
# ###########################################################################
@@ -1524,7 +1549,7 @@ purge_samples() {
local retention_size="$4"
# Delete collect files which more than --retention-time days old.
if [ -n "$OPT_PREFIX" ]; then
if [ -n "${OPT_PREFIX:-}" ]; then
find "$dir" -maxdepth 1 -type f -mtime +$retention_time -name "$OPT_PREFIX-*" -exec rm -f '{}' \;
else
find "$dir" -maxdepth 1 -type f -mtime +$retention_time -regextype posix-egrep -regex "$dir/[0-9]{4}(_[0-9]{2}){5}-.*" -exec rm -f '{}' \;
@@ -1723,10 +1748,6 @@ stalk() {
main() {
trap sigtrap SIGHUP SIGINT SIGTERM
if [ "$OPT_SYSTEM_ONLY" ] && [ "$OPT_MYSQL_ONLY" ]; then
log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics';
fi
# Note: $$ is the parent's PID, but we're a child proc.
# Bash 4 has $BASHPID but we can't rely on that. Consequently,
# we don't know our own PID. See the usage of $! below.
@@ -1770,6 +1791,10 @@ if [ "${0##*/}" = "$TOOL" ] \
mk_tmpdir
parse_options "$0" "${@:-""}"
if [ "$OPT_SYSTEM_ONLY" ] && [ "$OPT_MYSQL_ONLY" ]; then
log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics';
fi
# Verify and set TRIGGER_FUNCTION based on --function.
if ! set_trg_func "$OPT_FUNCTION"; then
option_error "Invalid --function value: $OPT_FUNCTION"
@@ -1784,6 +1809,19 @@ if [ "${0##*/}" = "$TOOL" ] \
fi
fi
if [ "$OPT_SKIP_COLLECTION" ]; then
supported_skips=( "ps-locks-transactions" "thread-variables" "innodbstatus" "lock-waits" "mysqladmin" "processlist" "rocksdbstatus" "transactions" )
IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION"
OPT_SKIP_COLLECTION=("${skips[@]}")
for skip in "${skips[@]}"; do
echo "$supported_skips" | grep -q "$skip"
if ! [[ " ${supported_skips[@]} " =~ " ${skip} " ]]; then
log "Invalid --skip-collection value: $skip, exiting."
exit 1
fi
done
fi
if [ -z "$OPT_STALK" -a "$OPT_COLLECT" ]; then
# Not stalking; do immediate collect once.
OPT_CYCLES=0
@@ -2391,6 +2429,12 @@ How long to sleep between collection loop cycles. This is useful with
C<--no-stalk> to do long collections. For example, to collect data every
minute for an hour, specify: C<--no-stalk --run-time 3600 --sleep-collect 60>.
=item --skip-collection
type: array
A comma-separated list of collection types to skip. Valid values are: C<"ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions">.
=item --socket
short form: -S; type: string

View File

@@ -5255,11 +5255,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -6026,11 +6032,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -6076,7 +6082,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}
@@ -11820,7 +11826,7 @@ sub main {
}
}
# Restore origin QRT pligin state
# Restore origin QRT plugin state
if ($o->get('disable-qrt-plugin')) {
eval {
if ($original_qrt_plugin_source_status) {
@@ -12591,7 +12597,7 @@ sub create_repl_table {
#
# Required Arguments:
# * tbl - Standard tbl hashref
# * sth - Sth with EXLAIN <statement>
# * sth - Sth with EXPLAIN <statement>
# * vals - Values for sth, if any
#
# Returns:

View File

@@ -6785,11 +6785,17 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -7556,11 +7562,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -7606,7 +7612,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -6082,7 +6082,7 @@ as tmp_table_size.
severity: warn
These are the recommended minimum version for each major release: 3.23, 4.1.20,
5.0.37, 5.1.30, 5.5.8, 5.6.10, 5.7.9, 8.0.11. This optiion does not complain
5.0.37, 5.1.30, 5.5.8, 5.6.10, 5.7.9, 8.0.11. This option does not complain
about Innovation releases.
=item end-of-life mysql version

View File

@@ -14,7 +14,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: perl(ExtUtils::MakeMaker) make
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5), perl(Term::ReadKey)
%if 0%{?rhel} > 9
%if 0%{?rhel} > 9 || 0%{?amzn} >= 2023
Requires: perl(English)
%endif
AutoReq: no

View File

@@ -151,6 +151,11 @@ get_system(){
ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g')
OS_NAME="el$RHEL"
OS="rpm"
elif [ -f /etc/amazon-linux-release ]; then
RHEL=$(rpm --eval %amzn)
ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g')
OS_NAME="amzn$RHEL"
OS="rpm"
else
ARCH=$(uname -m)
OS_NAME="$(lsb_release -sc)"
@@ -231,8 +236,8 @@ install_deps() {
# mv -f percona-dev.repo /etc/yum.repos.d/
yum clean all
yum -y install curl epel-release
RHEL=$(rpm --eval %rhel)
yum -y install wget tar findutils coreutils rpm-build perl-ExtUtils-MakeMaker make perl-DBD-MySQL
yum -y install coreutils
yum -y install wget tar findutils rpm-build perl-ExtUtils-MakeMaker make perl-DBD-MySQL
install_go
else
apt-get -y update
@@ -240,28 +245,11 @@ install_deps() {
export DEBIAN_VERSION=$(lsb_release -sc)
export ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g')
apt-get -y install gnupg2
apt-get update || true
ENV export DEBIAN_FRONTEND=noninteractive
apt-get update
if [ $DEBIAN_VERSION = buster ]; then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131
until DEBIAN_FRONTEND=noninteractive apt-get update --allow-releaseinfo-change; do
echo "waiting"
sleep 1
done
fi
if [ $DEBIAN_VERSION = bionic -o $DEBIAN_VERSION = focal -o $DEBIAN_VERSION = bullseye -o $DEBIAN_VERSION = buster -o $DEBIAN_VERSION = bookworm -o $DEBIAN_VERSION = jammy -o $DEBIAN_VERSION = xenial -o $DEBIAN_VERSION = noble ]; then
until apt-get update; do
echo "waiting"
sleep 1
done
DEBIAN_FRONTEND=noninteractive apt-get update
until DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential devscripts debconf debhelper perl; do
echo "waiting"
sleep 1
done
fi
DEBIAN_FRONTEND=noninteractive apt-get update
until DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential devscripts debconf debhelper perl; do
echo "waiting"
sleep 1
done
install_go
#update_pat
fi
@@ -389,11 +377,9 @@ build_rpm(){
mkdir -vp rpmbuild/{SOURCES,SPECS,BUILD,SRPMS,RPMS}
cp $SRC_RPM rpmbuild/SRPMS/
cd $WORKDIR
RHEL=$(rpm --eval %rhel)
ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g')
echo "RHEL=${RHEL}" >> percona-toolkit.properties
echo "ARCH=${ARCH}" >> percona-toolkit.properties
rpmbuild --define "version $VERSION" --define "VERSION $VERSION" --define "dist .el${RHEL}" --define "release $RPM_RELEASE.el${RHEL}" --define "_topdir ${WORKDIR}/rpmbuild" --rebuild rpmbuild/SRPMS/${SRC_RPM}
rpmbuild --define "version $VERSION" --define "VERSION $VERSION" --define "dist .${OS_NAME}" --define "release $RPM_RELEASE.${OS_NAME}" --define "_topdir ${WORKDIR}/rpmbuild" --rebuild rpmbuild/SRPMS/${SRC_RPM}
return_code=$?
if [ $return_code != 0 ]; then

60
go.mod
View File

@@ -1,77 +1,75 @@
module github.com/percona/percona-toolkit
go 1.24.0
toolchain go1.24.1
go 1.25.4
require (
github.com/AlekSi/pointer v1.2.0
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.12.1
github.com/alecthomas/kong v1.13.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
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/go-version v1.8.0
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
github.com/lib/pq v1.10.9
github.com/mattn/go-shellwords v1.0.12
github.com/montanaflynn/stats v0.7.1
github.com/pborman/getopt v1.1.0
github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c
github.com/percona/go-mysql v0.0.0-20251202083530-b3e1c16efc74
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.34.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.11.1
github.com/xlab/treeprint v1.2.0
go.mongodb.org/mongo-driver v1.17.4
golang.org/x/crypto v0.41.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
go.mongodb.org/mongo-driver v1.17.6
golang.org/x/crypto v0.46.0
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.34.0
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
k8s.io/api v0.34.2
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
)
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.16 // indirect
github.com/tklauser/numcpus v0.11.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/scram v1.2.0 // indirect
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
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.34.0 // indirect
k8s.io/apimachinery v0.34.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
)

124
go.sum
View File

@@ -8,14 +8,14 @@ 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.12.1 h1:iq6aMJDcFYP9uFrLdsiZQ2ZMmcshduyGv4Pek0MQPW0=
github.com/alecthomas/kong v1.12.1/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/kong v1.13.0 h1:5e/7XC3ugvhP1DQBmTS+WuHtCbcv44hsohMgcvVxSrA=
github.com/alecthomas/kong v1.13.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I=
github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs=
github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0=
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -26,24 +26,25 @@ github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sa
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
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/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=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.8.0 h1:KAkNb1HAiZd1ukkxDFGmokVZe1Xy9HG6NUp+bPle2i4=
github.com/hashicorp/go-version v1.8.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM=
@@ -52,19 +53,21 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -77,8 +80,8 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/pborman/getopt v1.1.0 h1:eJ3aFZroQqq0bWmraivjQNt6Dmm5M0h2JcDW38/Azb0=
github.com/pborman/getopt v1.1.0/go.mod h1:FxXoW1Re00sQG/+KIkuSqRL/LwQgSkv7uyac+STFsbk=
github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c h1:1SZ7nS+kSaO63IpaKspf/gf8602QcgP2eXNPMNOIc0M=
github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw=
github.com/percona/go-mysql v0.0.0-20251202083530-b3e1c16efc74 h1:uULelXfIrpmKtIfPjYHnC8TlnQvqza7BT+DGdxYcAZk=
github.com/percona/go-mysql v0.0.0-20251202083530-b3e1c16efc74/go.mod h1:8n6mF3Igr3YYdh19ZUvyVyEH+hQr9LVSjG9hrlp0YTU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -96,21 +99,27 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA=
github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI=
github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw=
github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
github.com/xdg-go/scram v1.2.0 h1:bYKF2AEwG5rqd1BumT4gAnvwU/M9nBp2pTSxeZw7Wvs=
github.com/xdg-go/scram v1.2.0/go.mod h1:3dlrS0iBaWKYVt2ZfA4cj48umJZ+cAEbR6/SjLA88I8=
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
@@ -121,20 +130,20 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
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.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=
go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
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.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
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/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39 h1:DHNhtq3sNNzrvduZZIiFyXWOL9IWaDPHqTnLJp+rCBY=
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -146,15 +155,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.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
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.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
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=
@@ -167,21 +176,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.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.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
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.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
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.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
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=
@@ -199,25 +208,24 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
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.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE=
k8s.io/api v0.34.0/go.mod h1:YzgkIzOOlhl9uwWCZNqpw6RJy9L2FK4dlJeayUoydug=
k8s.io/apimachinery v0.34.0 h1:eR1WO5fo0HyoQZt1wdISpFDffnWOvFLOOeJ7MgIv4z0=
k8s.io/apimachinery v0.34.0/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY=
k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw=
k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4=
k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
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-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
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/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E=
sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=

View File

@@ -20,7 +20,7 @@
{
# Package: Diskstats
# This package implements most of the logic in the old shell pt-diskstats;
# it parses data from /proc/diskstats, calculcates deltas, and prints those.
# it parses data from /proc/diskstats, calculates deltas, and prints those.
package Diskstats;

View File

@@ -1193,7 +1193,7 @@ sub _get_value {
unless $found_value;
}
else {
die "Event does not have attribute $attrib and there are no alterantes";
die "Event does not have attribute $attrib and there are no alternates";
}
return $value;

View File

@@ -108,11 +108,19 @@ sub get_replicas {
}
);
} elsif ( $methods->[0] =~ m/^dsn=/i ) {
my @required_args = qw(dsn);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn) = @args{@required_args};
(my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i;
$replicas = $self->get_cxn_from_dsn_table(
%args,
dsn_table_dsn => $dsn_table_dsn,
wait_no_die => $args{'wait_no_die'},
# We will set current source server as a parent
# until https://perconadev.atlassian.net/browse/PT-2496 is implemented
parent => $dsn,
);
}
elsif ( $methods->[0] =~ m/none/i ) {
@@ -1061,11 +1069,11 @@ sub reset_known_replication_threads {
sub get_cxn_from_dsn_table {
my ($self, %args) = @_;
my @required_args = qw(dsn_table_dsn make_cxn);
my @required_args = qw(dsn_table_dsn make_cxn parent);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
my ($dsn_table_dsn, $make_cxn) = @args{@required_args};
my ($dsn_table_dsn, $make_cxn, $parent) = @args{@required_args};
PTDEBUG && _d('DSN table DSN:', $dsn_table_dsn);
my $dp = $self->{DSNParser};
@@ -1111,7 +1119,7 @@ sub get_cxn_from_dsn_table {
}
push @cxn, $lcxn;
} else {
push @cxn, $make_cxn->(dsn_string => $dsn_string);
push @cxn, $make_cxn->(dsn_string => $dsn_string, parent => $parent);
}
}
}

View File

@@ -1254,7 +1254,7 @@ sub remove_functions {
# GROUP BY and ORDER BY specify a list of identifiers.
#
# Parameters:
# $idents - Arrayref of indentifiers
# $idents - Arrayref of identifiers
#
# Returns:
# Arrayref of hashes with each identifier's parts, depending on what kind

View File

@@ -79,8 +79,8 @@ sub new {
#
# TCP requests and responses form "sessions", which can be in one of these
# statuses:
# [Q]uerying - The remote host is sending the query to the server.
# [R]esponding - The server is replying back to the remote host.
# Querying - The remote host is sending the query to the server.
# Responding - The server is replying back to the remote host.
sub parse_event {
my ( $self, %args ) = @_;
my @required_args = qw(next_event tell);

View File

@@ -178,7 +178,7 @@ sub parse_event {
# Otherwise, we need to compute the running sums and keep looping.
else {
if ( $self->{in_prg} ) {
# $self->{current_ts} is intitially 0, which would seem likely to
# $self->{current_ts} is initially 0, which would seem likely to
# skew this computation. But $self->{in_prg} will be 0 also, and
# $self->{current_ts} will get set immediately after this, so
# anytime this if() block runs, it'll be OK.

View File

@@ -460,7 +460,7 @@ sub pingback {
# If the server has suggestions for items, it sends them back in
# the same format: ITEM:TYPE:SUGGESTION\n. ITEM:TYPE is mostly for
# debugging; the tool just repports the suggestions.
# debugging; the tool just reports the suggestions.
$items = parse_server_response(
response => $response->{content},
split_vars => 0,

View File

@@ -243,8 +243,10 @@ collect_mysql_data_one() {
# get and keep a connection to the database; in troubled times
# the database tends to exceed max_connections, so reconnecting
# in the loop tends not to work very well.
$CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
mysqladmin_pid=$!
if ! _should_skip "mysqladmin"; then
$CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
mysqladmin_pid=$!
fi
ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
@@ -289,18 +291,25 @@ collect_mysql_data_loop() {
# SHOW FULL PROCESSLIST duplicates information in performance_schema.threads we collecting now
# Keeping it for backward compatibility and may remove in the future
if ! _should_skip "processlist"; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \
>> "$d/$p-processlist" &
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \
>> "$d/$p-threads" &
if [ "$have_lock_waits_table" ]; then
(echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" &
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ]; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \
>> "$d/$p-threads" &
if [ "$have_lock_waits_table" ]; then
if ! _should_skip "lock-waits"; then
(echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" &
fi
if ! _should_skip "transactions"; then
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
fi
if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \
&& ! _should_skip "ps-locks-transactions"; then
ps_locks_transactions "$d/$p-ps-locks-transactions"
fi
@@ -538,20 +547,22 @@ innodb_status() {
local innostat=""
$CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \
>> "$d/$p-innodbstatus$n"
grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || {
if [ -d /proc -a -d /proc/$mysqld_pid ]; then
for fd in /proc/$mysqld_pid/fd/*; do
file $fd | grep deleted >/dev/null && {
grep 'INNODB' $fd >/dev/null && {
cat $fd > "$d/$p-innodbstatus$n"
break
if ! _should_skip "innodbstatus"; then
$CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \
>> "$d/$p-innodbstatus$n"
grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || {
if [ -d /proc -a -d /proc/$mysqld_pid ]; then
for fd in /proc/$mysqld_pid/fd/*; do
file $fd | grep deleted >/dev/null && {
grep 'INNODB' $fd >/dev/null && {
cat $fd > "$d/$p-innodbstatus$n"
break
}
}
}
done
fi
}
done
fi
}
fi
}
rocksdb_status() {
@@ -560,7 +571,7 @@ rocksdb_status() {
has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'`
exit_code=$?
if [ $exit_code -eq 0 ]; then
if [ $exit_code -eq 0 ] && ! _should_skip "rocksdbstatus"; then
$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \
>> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n"
fi
@@ -646,20 +657,34 @@ collect_mysql_variables() {
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
if ! _should_skip "thread-variables"; then
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
echo -e "\n$sql\n" >> $outfile
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
fi
}
_should_skip() {
local name=$1
for item in "${OPT_SKIP_COLLECTION[@]}"; do
if [ "$item" == "$name" ]; then
return 0
fi
done
return 1
}
# ###########################################################################
# End collect package
# ###########################################################################

View File

@@ -4,6 +4,8 @@ import (
"encoding/json"
"time"
"cmp"
"github.com/percona/percona-toolkit/src/go/pt-galera-log-explainer/utils"
"github.com/xlab/treeprint"
"golang.org/x/exp/slices"
@@ -98,17 +100,24 @@ func (n *WhoisNode) valuesSortedByTimestamps() []string {
}
// keep nil timestamps at the top
slices.SortFunc(values, func(a, b string) bool {
if n.Values[a].Timestamp == nil && n.Values[b].Timestamp == nil {
return a < b
slices.SortFunc(values, func(a, b string) int {
va, vb := n.Values[a].Timestamp, n.Values[b].Timestamp
switch {
case va == nil && vb == nil:
return cmp.Compare(a, b)
case va == nil:
return -1 // nil < non-nil
case vb == nil:
return 1 // non-nil > nil
default:
if va.Before(*vb) {
return -1
}
if va.After(*vb) {
return 1
}
return cmp.Compare(a, b)
}
if n.Values[a].Timestamp == nil { // implied b!=nil
return true // meaning, nil < nonnil, a < b
}
if n.Values[b].Timestamp == nil { // implied a!=nil
return false // meaning a is greater than b
}
return n.Values[a].Timestamp.Before(*n.Values[b].Timestamp)
})
return values
}

View File

@@ -208,7 +208,7 @@ func main() {
if err != nil {
log.Infof("cannot check version updates: %s", err.Error())
} else if advice != "" {
log.Infof(advice)
log.Infof("%s", advice)
}
}
@@ -373,24 +373,6 @@ func getHostInfo(ctx context.Context, client *mongo.Client) (*hostInfo, error) {
return nil, errors.Wrap(err, "GetHostInfo.hostInfo")
}
cmdOpts := proto.CommandLineOptions{}
query := primitive.D{{Key: "getCmdLineOpts", Value: 1}}
err := client.Database("admin").RunCommand(ctx, query).Decode(&cmdOpts)
if err != nil {
return nil, errors.Wrap(err, "cannot get command line options")
}
ss := proto.ServerStatus{}
query = primitive.D{{Key: "serverStatus", Value: 1}}
if err := client.Database("admin").RunCommand(ctx, query).Decode(&ss); err != nil {
return nil, errors.Wrap(err, "GetHostInfo.serverStatus")
}
pi := procInfo{}
if err := getProcInfo(int32(ss.Pid), &pi); err != nil {
pi.Error = err
}
nodeType, _ := getNodeType(ctx, client)
procCount, _ := countMongodProcesses()
@@ -398,24 +380,41 @@ func getHostInfo(ctx context.Context, client *mongo.Client) (*hostInfo, error) {
Hostname: hi.System.Hostname,
HostOsType: hi.Os.Type,
HostSystemCPUArch: hi.System.CpuArch,
DBPath: "", // Sets default. It will be overridden later if necessary
ProcessName: ss.Process,
ProcProcessCount: procCount,
Version: ss.Version,
NodeType: nodeType,
ProcPath: pi.Path,
ProcUserName: pi.UserName,
ProcCreateTime: pi.CreateTime,
CmdlineArgs: cmdOpts.Argv,
}
if ss.Repl != nil {
i.ReplicasetName = ss.Repl.SetName
ProcProcessCount: procCount,
NodeType: nodeType,
CmdlineArgs: nil,
}
if cmdOpts.Parsed.Storage.DbPath != "" {
i.DBPath = cmdOpts.Parsed.Storage.DbPath
var cmdOpts proto.CommandLineOptions
query := primitive.D{{Key: "getCmdLineOpts", Value: 1}}
err := client.Database("admin").RunCommand(ctx, query).Decode(&cmdOpts)
if err == nil {
if len(cmdOpts.Argv) > 0 {
i.CmdlineArgs = cmdOpts.Argv
}
if cmdOpts.Parsed.Storage.DbPath != "" {
i.DBPath = cmdOpts.Parsed.Storage.DbPath
}
}
var ss proto.ServerStatus
query = primitive.D{{Key: "serverStatus", Value: 1}}
err = client.Database("admin").RunCommand(ctx, query).Decode(&ss)
if err == nil {
i.ProcessName = ss.Process
i.Version = ss.Version
if ss.Repl != nil {
i.ReplicasetName = ss.Repl.SetName
}
pi := procInfo{}
if err := getProcInfo(int32(ss.Pid), &pi); err != nil {
pi.Error = err
} else {
i.ProcPath = pi.Path
i.ProcUserName = pi.UserName
i.ProcCreateTime = pi.CreateTime
}
}
return i, nil

View File

@@ -8,9 +8,9 @@ import (
"time"
"github.com/pborman/getopt"
"github.com/stretchr/testify/require"
tu "github.com/percona/percona-toolkit/src/go/internal/testutils"
"github.com/percona/percona-toolkit/src/go/mongolib/proto"
)
func TestGetHostInfo(t *testing.T) {
@@ -49,6 +49,18 @@ func TestGetHostInfo(t *testing.T) {
}
}
func TestGetHostInfoResult(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
client, err := tu.TestClient(ctx, tu.MongoDBShard1PrimaryPort)
require.NoError(t, err, "cannot get a new MongoDB client")
host, err := getHostInfo(ctx, client)
require.NoError(t, err, "getHostInfo error")
require.NotEmpty(t, host)
}
func TestClusterWideInfo(t *testing.T) {
testCases := []struct {
name string
@@ -85,16 +97,6 @@ func TestClusterWideInfo(t *testing.T) {
}
}
func addToCounters(ss proto.ServerStatus, increment int64) proto.ServerStatus {
ss.Opcounters.Command += increment
ss.Opcounters.Delete += increment
ss.Opcounters.GetMore += increment
ss.Opcounters.Insert += increment
ss.Opcounters.Query += increment
ss.Opcounters.Update += increment
return ss
}
func TestParseArgs(t *testing.T) {
tests := []struct {
args []string

View File

@@ -694,6 +694,7 @@ my $slaves = $ms->get_replicas(
$cxn->connect();
return $cxn;
},
dsn => 'F=/tmp/12345/my.sandbox.cnf',
);
is_deeply(

View File

@@ -26,7 +26,7 @@ ok(
no_diff(
"$cmd -- cat $sample/mext-001.txt",
"t/pt-mext/samples/mext-001-result.txt",
post_pipe => "LOCALE=C sort -k1,1",
post_pipe => "LOCALE=en_US.utf8 LANG=en_US.UTF-8 sort -k1,1",
),
"mext-001"
) or diag($test_diff);
@@ -35,7 +35,7 @@ ok(
no_diff(
"$cmd -r -- cat $sample/mext-002.txt",
"t/pt-mext/samples/mext-002-result.txt",
post_pipe => "LOCALE=C sort -k1,1",
post_pipe => "LOCALE=en_US.utf8 LANG=en_US.UTF-8 sort -k1,1",
),
"mext-002 -r"
) or diag($test_diff);
@@ -44,6 +44,7 @@ ok(
no_diff(
"$cmd -- cat $sample/pt-130-in.txt",
"t/pt-mext/samples/pt-130-out.txt",
post_pipe => "LOCALE=en_US.utf8 LANG=en_US.UTF-8 sort -k1,1",
),
"having rsa key",
) or diag($test_diff);

View File

@@ -26,7 +26,7 @@ require "$trunk/bin/pt-online-schema-change";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $source_dbh = $sb->get_dbh_for('source');
my $source_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
my $source_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox,s=1';
if ( !$source_dbh ) {
plan skip_all => 'Cannot connect to sandbox source';

View File

@@ -26,7 +26,7 @@ require "$trunk/bin/pt-online-schema-change";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $source_dbh = $sb->get_dbh_for('source');
my $source_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
my $source_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox,s=1';
if ( !$source_dbh ) {
plan skip_all => 'Cannot connect to sandbox source';

View File

@@ -8,6 +8,6 @@ CREATE TABLE `dsns` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `dsns` VALUES (1, NULL, "F=/home/sveta/src/percona/percona-toolkit/t/pt-archiver/samples/pt-191-replica1.cnf,P=12346,h=127.0.0.1,u=root,p=msandbox,s=1");
INSERT INTO `dsns` VALUES (2, NULL, "F=/home/sveta/src/percona/percona-toolkit/t/pt-archiver/samples/pt-191-replica2.cnf,P=12347,h=127.0.0.1,u=root,p=msandbox,s=1");
INSERT INTO `dsns` VALUES (1, NULL, "F=t/pt-archiver/samples/pt-191-replica1.cnf,P=12346,h=127.0.0.1,u=root,p=msandbox,s=1");
INSERT INTO `dsns` VALUES (2, NULL, "F=t/pt-archiver/samples/pt-191-replica2.cnf,P=12347,h=127.0.0.1,u=root,p=msandbox,s=1");

View File

@@ -21,7 +21,7 @@ while ( my $file = readdir $dh ) {
(my $outfile = $file) =~ s/\.in/.out/;
ok(
no_diff(
"$trunk/bin/pt-pmp $sample/$file",
"LOCALE=en_US.utf8 LANG=en_US.UTF-8 $trunk/bin/pt-pmp $sample/$file",
"t/pt-pmp/samples/$outfile",
),
"$file"
@@ -31,7 +31,7 @@ closedir $dh;
ok(
no_diff(
"$trunk/bin/pt-pmp -l 2 $sample/stacktrace003.in",
"LOCALE=en_US.utf8 LANG=en_US.UTF-8 $trunk/bin/pt-pmp -l 2 $sample/stacktrace003.in",
"t/pt-pmp/samples/stacktrace003-limit2.out",
),
"Limit 2 (stacktrace003-limit2.out)"
@@ -39,7 +39,7 @@ ok(
ok(
no_diff(
"$trunk/bin/pt-pmp -d eu $sample/stacktrace006-eu.in",
"LOCALE=en_US.utf8 LANG=en_US.UTF-8 $trunk/bin/pt-pmp -d eu $sample/stacktrace006-eu.in",
"t/pt-pmp/samples/stacktrace006-eu-deu.out",
),
"eu-stack dump read correctly if option -d eu specified"
@@ -47,7 +47,7 @@ ok(
ok(
no_diff(
"$trunk/bin/pt-pmp -d pteu $sample/stacktrace006-pteu.in",
"LOCALE=en_US.utf8 LANG=en_US.UTF-8 $trunk/bin/pt-pmp -d pteu $sample/stacktrace006-pteu.in",
"t/pt-pmp/samples/stacktrace006-pteu-dpteu.out",
),
"pt-eustack-resolver dump read correctly if option -d pteu specified"

View File

@@ -9,11 +9,29 @@ BEGIN {
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 1;
use Test::More tests => 2;
use PerconaTest;
pass();
my ($tool) = $PROGRAM_NAME =~ m/([\w-]+)\.t$/;
my $output = `$trunk/bin/$tool $trunk/bin 2>&1`;
# https://perconadev.atlassian.net/browse/PT-2498
# We do not test interactive tool here
# But we at least ensure it works and prints
# proper error message if called without correct path
isnt(
$?,
0,
"Error for the directory that does not contain pt-stalk files"
) or diag($output);
like(
$output,
qr/Error: There are no pt-stalk files in $trunk\/bin/,
"Correct error message"
) or diag($output);
# #############################################################################
# Done.

262
t/pt-stalk/pt-2289.t Normal file
View File

@@ -0,0 +1,262 @@
#!/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 threads;
use English qw(-no_match_vars);
use Test::More;
use Time::HiRes qw(sleep);
use PerconaTest;
use DSNParser;
use Sandbox;
require VersionParser;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox source';
}
my $cnf = "/tmp/12345/my.sandbox.cnf";
my $pid_file = "/tmp/pt-stalk.pid.$PID";
my $log_file = "/tmp/pt-stalk.log.$PID";
my $dest = "/tmp/pt-stalk.collect.$PID";
my $int_file = "/tmp/pt-stalk-after-interval-sleep";
my $pid;
my $output;
my $retval;
sub cleanup {
diag(`rm $pid_file $log_file $int_file 2>/dev/null`);
diag(`rm -rf $dest 2>/dev/null`);
}
# ###########################################################################
# Test that it collects all data when no --skip-collection is given.
# ###########################################################################
cleanup();
# We need these to collect lock-waits
sub start_thread_pt_1897_1 {
# this must run in a thread because we need to have an active session
# with open transaction
my ($dsn_opts) = @_;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
$sb->load_file('source', "t/pt-stalk/samples/PT-1897-1.sql");
}
my $thr1 = threads->create('start_thread_pt_1897_1', $dsn_opts);
$thr1->detach();
threads->yield();
sleep 1;
sub start_thread_pt_1897_2 {
# this must run in a thread because we need to have an active session
# with waiting transaction
my ($dsn_opts) = @_;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
$sb->load_file('source', "t/pt-stalk/samples/PT-1897-2.sql");
}
my $thr2 = threads->create('start_thread_pt_1897_2', $dsn_opts);
$thr2->detach();
threads->yield();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 -- --defaults-file=$cnf >$log_file 2>&1");
sleep 35;
PerconaTest::kill_program(pid_file => $pid_file);
is(
$retval >> 8,
0,
"Parent exit 0"
);
ok(
-d $dest,
"Creates --dest (collect) dir"
);
# ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions
ok(
glob("$dest/*-ps-locks-transactions"),
"Collects *-ps-locks-transactions"
) or diag(`ls $dest`);
ok(
glob("$dest/*-innodbstatus*"),
"Collects *-innodbstatus*"
) or diag(`ls $dest`);
ok(
glob("$dest/*-lock-waits"),
"Collects *-lock-waits"
) or diag(`ls $dest`);
ok(
glob("$dest/*-mysqladmin"),
"Collects *-mysqladmin"
) or diag(`ls $dest`);
ok(
glob("$dest/*-processlist"),
"Collects *-processlist"
) or diag(`ls $dest`);
ok(
glob("$dest/*-transactions"),
"Collects *-transactions"
) or diag(`ls $dest`);
# thread-variables
ok(
glob("$dest/*-variables"),
"Collects *-variables"
) or diag(`ls $dest`);
$output = `cat $dest/*-variables 2>/dev/null`;
like(
$output,
qr/select \* from performance_schema\.variables_by_thread/,
"Thread variables collected"
); # or diag($output);
SKIP: {
skip "These tests require MyRocks", 1 if ( !$sb->has_engine('source', 'ROCKSDB') ) ;
# rocksdbstatus
ok(
glob("$dest/*-rocksdbstatus*"),
"Collects *-rocksdbstatus"
) or diag(`ls $dest`);
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection rocksdbstatus -- --defaults-file=$cnf >$log_file 2>&1");
sleep 5;
PerconaTest::kill_program(pid_file => $pid_file);
ok(
! glob("$dest/*-rocksdbstatus*"),
"Does not collect *-rocksdbstatus"
) or diag(`ls $dest`);
}
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection processlist -- --defaults-file=$cnf >$log_file 2>&1");
sleep 5;
PerconaTest::kill_program(pid_file => $pid_file);
ok(
! glob("$dest/*-processlist"),
"Does not collect *-processlist"
) or diag(`ls $dest`);
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection ps-locks-transactions,thread-variables,innodbstatus,mysqladmin,processlist,transactions -- --defaults-file=$cnf >$log_file 2>&1");
sleep 5;
PerconaTest::kill_program(pid_file => $pid_file);
ok(
! glob("$dest/*-ps-locks-transactions"),
"Does not collect *-ps-locks-transactions"
) or diag(`ls $dest`);
ok(
glob("$dest/*-variables"),
"Collects *-variables"
) or diag(`ls $dest`);
$output = `cat $dest/*-variables 2>/dev/null`;
unlike(
$output,
qr/select \* from performance_schema\.variables_by_thread/,
"Thread variables not collected"
); # or diag($output);
ok(
! glob("$dest/*-innodbstatus"),
"Does not collect *-innodbstatus"
) or diag(`ls $dest`);
ok(
! glob("$dest/*-mysqladmin"),
"Does not collect *-mysqladmin"
) or diag(`ls $dest`);
ok(
! glob("$dest/*-processlist"),
"Does not collect *-processlist"
) or diag(`ls $dest`);
ok(
! glob("$dest/*-transactions"),
"Does not collect *-transactions"
) or diag(`ls $dest`);
#Unsupported skip-collection value
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection ps-locks-transactions,thread-variables,innodbstatus,mysqladmin,processlist,transaction -- --defaults-file=$cnf >$log_file 2>&1");
sleep 5;
PerconaTest::kill_program(pid_file => $pid_file);
is(
$retval >> 8,
1,
"Parent exit 1 on unsupported --skip-collection value"
);
like(
`cat $log_file`,
qr/Invalid --skip-collection value: transaction, exiting./,
"Rejects unsupported --skip-collection value"
);
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection 'mysqladmin and' -- --defaults-file=$cnf >$log_file 2>&1");
sleep 5;
PerconaTest::kill_program(pid_file => $pid_file);
is(
$retval >> 8,
1,
"Parent exit 1 on unsupported --skip-collection value"
);
like(
`cat $log_file`,
qr/Invalid --skip-collection value: mysqladmin and, exiting./,
"Rejects unsupported --skip-collection value"
);
# #############################################################################
# Done.
# #############################################################################
cleanup();
diag(`rm -rf $dest 2>/dev/null`);
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;

View File

@@ -393,18 +393,16 @@ my $tempdir = tempdir( CLEANUP => 1 );
my $script = <<"EOT";
. $trunk/bin/pt-stalk
purge_samples $tempdir 10000 2>&1
purge_samples $tempdir 10000 0 0 2>&1
EOT
$output = `$script`;
$output = `bash -c "$script"`;
unlike(
$output,
qr/\Qfind: warning: you have specified the -depth option/,
"Bug 942114: no bad find usage"
);
# ###########################################################################
# Test that it handles floating point values
# ###########################################################################

View File

@@ -20,7 +20,7 @@ my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
my $output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --buffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
my $output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox,s=1 --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --buffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
my @lines = split(/\n/, $output);
my @times = ( $lines[3] =~ m/\d\d-\d\dT\d\d:\d\d:\d\d/g );
@@ -32,16 +32,16 @@ is(
) or diag($output);
my ($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[0]);
my $time_ts = timelocal($sec, $min, $hour, $day, $month);
my $time_ts = timelocal($sec, $min, $hour, $day, $month - 1);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[1]);
my $time_tool = timelocal($sec, $min, $hour, $day, $month);
my $time_tool = timelocal($sec, $min, $hour, $day, $month - 1);
cmp_ok(
$time_ts - $time_tool, 'gt', 1,
"Print delay is expected for the buffered output"
) or diag($output);
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox,s=1 --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
@lines = split(/\n/, $output);
@times = ( $lines[3] =~ m/\d\d-\d\dT\d\d:\d\d:\d\d/g );
@@ -53,16 +53,16 @@ is(
) or diag($output);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[0]);
$time_ts = timelocal($sec, $min, $hour, $day, $month);
$time_ts = timelocal($sec, $min, $hour, $day, $month - 1);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[1]);
$time_tool = timelocal($sec, $min, $hour, $day, $month);
$time_tool = timelocal($sec, $min, $hour, $day, $month - 1);
cmp_ok(
$time_ts - $time_tool, 'gt', 1,
"STDOUT is buffered by default"
) or diag($output);
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --no-buffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox,s=1 --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --no-buffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
@lines = split(/\n/, $output);
@times = ( $lines[3] =~ m/\d\d-\d\dT\d\d:\d\d:\d\d/g );
@@ -74,16 +74,16 @@ is(
) or diag($output);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[0]);
$time_ts = timelocal($sec, $min, $hour, $day, $month);
$time_ts = timelocal($sec, $min, $hour, $day, $month - 1);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[1]);
$time_tool = timelocal($sec, $min, $hour, $day, $month);
$time_tool = timelocal($sec, $min, $hour, $day, $month - 1);
cmp_ok(
$time_ts - $time_tool, 'le', 1,
"Print delay is not expected when buffering is disabled"
) or diag($output);
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --nobuffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox,s=1 --set-vars innodb_lock_wait_timeout=3 --chunk-size=50 -d sakila --nobuffer-stdout 2>&1 | tee | ts '%m-%dT%H:%M:%S'`;
@lines = split(/\n/, $output);
@times = ( $lines[3] =~ m/\d\d-\d\dT\d\d:\d\d:\d\d/g );
@@ -95,9 +95,9 @@ is(
) or diag($output);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[0]);
$time_ts = timelocal($sec, $min, $hour, $day, $month);
$time_ts = timelocal($sec, $min, $hour, $day, $month - 1);
($month, $day, $hour, $min, $sec) = split(/[T:-]+/, $times[1]);
$time_tool = timelocal($sec, $min, $hour, $day, $month);
$time_tool = timelocal($sec, $min, $hour, $day, $month - 1);
cmp_ok(
$time_ts - $time_tool, 'le', 1,

View File

@@ -0,0 +1,69 @@
#!/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-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('source');
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox source';
}
else {
plan tests => 3;
}
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die.
# And --max-load "" prevents waiting for status variables.
my @args = (qw(--set-vars innodb_lock_wait_timeout=3), '--max-load', '');
my ($output, $exit_code);
$sb->create_dbs($dbh, [qw(test)]);
$sb->load_file('source', 't/lib/samples/tables/issue-388.sql', 'test');
$sb->load_file('source', "t/pt-table-checksum/samples/pt-2250_dsns.sql");
$dbh->do("insert into test.foo values (null, 'john, smith')");
($output, $exit_code) = full_output(
sub {
pt_table_checksum::main(
@args,
'h=127.1,P=12345,u=msandbox,p=msandbox',
qw(-d test),
"--recursion-method=dsn=F=t/pt-archiver/samples/pt-191.cnf,D=dsns,t=dsns,h=127.0.0.1,P=12345,u=msandbox,p=msandbox")
},
stderr => 1,
);
is(
$exit_code,
0,
"No error for recursion method dsn"
) or diag($output);
unlike(
$output,
qr/Can't connect to local MySQL server/,
'No error message for recursion method dsn'
) or diag($output);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
exit;

View File

@@ -294,7 +294,7 @@ if ( -x "$ENV{PERCONA_TOOLKIT_SANDBOX}/bin/mysqlbinlog" ) {
chomp $mysqlbinlog;
}
$output = `$mysqlbinlog /tmp/12345/data/$row->{file} --start-position=$row->{position} | grep 'use ' | grep -v '^# Warning' | grep -v 'pseudo_replica_mode' | sort -u | sed -e 's/\`//g'`;
$output = `$mysqlbinlog /tmp/12345/data/$row->{file} --start-position=$row->{position} | grep 'use ' | grep -v '^# Warning' | grep -v 'pseudo_replica_mode' | LOCALE=en_US.utf8 LANG=en_US.UTF-8 sort -u | sed -e 's/\`//g'`;
my $use_dbs = "use mysql/*!*/;
use percona/*!*/;
@@ -317,7 +317,7 @@ $row = $source_dbh->selectrow_hashref("show ${source_status} status");
pt_table_checksum::main(@args, qw(--quiet --replicate-database percona));
$output = `$mysqlbinlog /tmp/12345/data/$row->{file} --start-position=$row->{position} | grep 'use ' | grep -v '^# Warning' | grep -v 'pseudo_replica_mode' | sort -u | sed -e 's/\`//g'`;
$output = `$mysqlbinlog /tmp/12345/data/$row->{file} --start-position=$row->{position} | grep 'use ' | grep -v '^# Warning' | grep -v 'pseudo_replica_mode' | LOCALE=en_US.utf8 LANG=en_US.UTF-8 sort -u | sed -e 's/\`//g'`;
is(
$output,

View File

@@ -0,0 +1,13 @@
CREATE DATABASE IF NOT EXISTS dsns;
USE dsns;
DROP TABLE IF EXISTS `dsns`;
CREATE TABLE `dsns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) DEFAULT NULL,
`dsn` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `dsns` VALUES (1, NULL, "P=12346,h=127.0.0.1,u=msandbox,p=msandbox");
INSERT INTO `dsns` VALUES (2, NULL, "P=12347,h=127.0.0.1,u=msandbox,p=msandbox");