2127 Commits

Author SHA1 Message Date
Sveta Smirnova
b98b998a2b PT-2295 - Fix tests on distributions
- t/pt-archiver/pt-2064.t does not clean up innodb_lock_wait_timeout
  properly and breaks t/pt-config-diff/basics.t as a result
- Added cleanup to t/pt-stalk/pt-stalk.t
2024-01-31 20:14:35 +03:00
Sveta Smirnova
cf255e01e4 Merge pull request #140 from akopytov/2.2
Add CPU cache configuration info to pt-summary.
2024-01-30 23:03:57 +03:00
Sveta Smirnova
cbc00ad761 PT-1751 - adds --where param to pt-online-schema-change
- Option --where added
- Added test case
2024-01-30 17:55:15 +03:00
Sveta Smirnova
67ed03dbf4 Merge pull request #754 from percona/port_improved_pt-pmp
Port improved pt-pmp
2024-01-29 13:12:37 +03:00
Sveta Smirnova
6330cf0f53 PR-160 - added support for operf if present, and if CMD_OPCONTROL is not set
- Added test case
2024-01-26 18:14:29 +03:00
Sveta Smirnova
1036b5768a PR-140 - Add CPU cache configuration info to pt-summary
- Merge branch '3.x' into HEAD
- Move code to the proper place: library files
- Fix tests
2024-01-25 01:41:20 +03:00
Sveta Smirnova
08946bcbba Port improved pt-pmp
- Added test cases for proper reading of eu-stack dumps (when option
  --dumper not default)
2024-01-18 20:27:03 +03:00
Sveta Smirnova
9564d52a44 Port improved pt-pmp
- Added tests for alternative dumpers
2024-01-18 20:17:58 +03:00
Sveta Smirnova
fc6e5b3673 Port improved pt-pmp
- Added test case for option --tids
2024-01-18 15:56:33 +03:00
Sveta Smirnova
55171b2a4a Merge pull request #729 from percona/PT-2268-pt-online-schema-change_3.5.5_breaks_on_mysql5.7_with_server_id_0
PT-2268 - pt-online-schema-change 3.5.5 breaks on mysql5.7 with serve…
2023-12-22 23:11:31 +03:00
Sveta Smirnova
643113540f PT-2268 - pt-online-schema-change 3.5.5 breaks on mysql5.7 with server_id 0
- Better check if server_id is defined
- Added test case
2023-12-22 23:11:31 +03:00
Sveta Smirnova
9b347dd466 Revert "PT-2083 - Pt-archiver --charset option is not working for MySQL8.0"
This reverts commit 284a1f945e.
2023-12-22 23:11:31 +03:00
Sveta Smirnova
cadf35abc4 PT-2083 - Pt-archiver --charset option is not working for MySQL8.0
- Changed logic, introduced by commit 1d1c13f
- Added test case
2023-12-22 23:11:31 +03:00
Sveta Smirnova
1682aa202c PT-2083 - Pt-archiver --charset option is not working for MySQL8.0
- Changed logic, introduced by commit 1d1c13fbcb
- Added test case
2023-12-22 23:11:31 +03:00
Sveta Smirnova
57886d5665 Merge pull request #721 from oblitorum/PT-2277_impossible_on_condition
PT-2277 - fix pt-visual-explain for 'Impossible ON condition' case
2023-12-22 23:11:31 +03:00
Sveta Smirnova
a4cf465087 Merge pull request #706 from percona/Follow_PR-429_unstop_option_with_testcase
Follow PR-429 unstop option with testcase
2023-12-22 23:11:31 +03:00
Jason
b2b6311723 PT-2277 - fix pt-visual-explain for 'Impossible ON condition' case 2023-11-29 02:30:44 +08:00
Sveta Smirnova
9f5fc7e50a Merge pull request #388 from cswingler/check_undefined_skip_check_slave_lag_schema_change
Check undefined skip check slave lag schema change

Contirbutor signed corporate SLA as stated in https://github.com/percona/percona-toolkit/pull/230#issuecomment-308564024
2023-11-12 23:31:30 +03:00
Sveta Smirnova
be2310f2b3 Merge pull request #471 from perfectayush/support-query-explain-in-json-output
Support adding explain output for slow query in JSON report as well
2023-11-12 23:28:49 +03:00
Sveta Smirnova
00149ab10a Merge pull request #516 from ikruglov/PT-1860-pt-osc-case-insensitive
PT-1860 make pt-osc respect case insesitive lookup on Windows and osx
2023-11-12 23:28:35 +03:00
Sveta Smirnova
2b440638c4 Merge pull request #604 from mikrobi/patch-1
Only rollback destination if it's defined
2023-11-12 23:28:13 +03:00
Sveta Smirnova
cfb1065278 Merge pull request #628 from baotiao/PT-2211_ptpmp_return_error_line
PT-2211 This pstack return error code line number
2023-11-12 23:27:58 +03:00
Sveta Smirnova
3e1e9b8425 PT-1860 make pt-osc respect case insesitive lookup on Windows and osx #516
- Run update-modules
- Adjusted fix, so it does not create extra variable to hold $EVAL_ERROR
- Adjusted test case, so it runs on Linux
2023-11-09 17:16:43 +03:00
Sveta Smirnova
e4583b0542 Merge branch '3.x' into HEAD 2023-11-09 13:43:17 +03:00
Ivan Kruglov
8d38d0900a PT-1860 make pt-osc respect case insesitive lookup on Windows and osx 2023-11-08 20:16:31 +01:00
Sveta Smirnova
3d4751f428 PR-388 - Check undefined skip check slave lag schema change
- Merge branch '3.x' into HEAD
- Improve the fix, so it does not fail when $slave_to_skip->{P} is not
  defined while $slave->{dsn}->{P} is defined
- Improve the fix for pt-table-checksum (PR-230)
- Added test cases for this fix for pt-table-checksum and pt-osc
- Adjusted replica info repository options in test for pt-1760.t, so it
  does not break regression tests for pt-osc on 5.7
2023-11-08 19:42:35 +03:00
Sveta Smirnova
c1b751927c Follow_PR-429_unstop_option_with_testcase
- Added information message about removing sentinel file
- Added cross-links for options --stop and --unstop in docs
- Added test case
2023-11-07 16:25:50 +03:00
Sveta Smirnova
f0af7114e7 PT-2279 - Option --charset is confusing when set to utf8mb4
- Added pattern check for utf8 character set instead of eq
- Added test cases
2023-11-06 23:26:54 +03:00
Sveta Smirnova
d268165df0 PT-2064 - pt-archiver: Can't call method "rollback" on an undefined value
- Added regression test
2023-11-06 19:34:28 +03:00
Ilaria Migliozzi
8e4824813f added new hook before_die (#509)
* added new hook before_die

before die, the script calls this hook in oder to execute extra user's 
operations

* PR-509 -  added new hook before_die

- Added test cases

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-11-06 18:22:14 +03:00
Sveta Smirnova
17820dbf23 PR-471 - Support adding explain output for slow query in JSON report as well
- Put fix into the proper place
- Added test cases
2023-11-06 17:21:28 +03:00
Sveta Smirnova
ed7481a35e PT-2211 - This pstack return error code line number
- Added test case sample for this case
- Adjusted sample results for t/pt-pmp/samples/stacktrace003.in that originally
  returned wrong data
2023-11-03 02:45:30 +03:00
Sveta Smirnova
1407b5380b PT-2109 - pt-mysql-summary throws an error when using sql_mode="ANSI_QUOTES" (#696)
* PT-2109 - pt-mysql-summary throws an error when using sql_mode="ANSI_QUOTES"

- Fixed issues still visible with SQL mode ANSI_QUOTES
- Added test cases for this mode

* PT-2109 - pt-mysql-summary throws an error when using sql_mode="ANSI_QUOTES"

- Removed keyring plugin check in the beginning of the test, because
  reported error would show up even on servers that do not have keyring
  plugin installed. Same applies to wsrep_on check and Percona Server
  features checks.
- Removed temporary dir setup, because not needed for this test.
2023-11-03 01:46:32 +03:00
Sveta Smirnova
817673755f PT-2207 - pt-archiver doesn't work when ANSI_QUOTES is set in sql_mode (#694)
- Implemented suggestion from the bug report
- Added test case
2023-11-02 15:06:46 +03:00
Sveta Smirnova
46fd033994 PT-2258 - Pass tbl as argument for on_copy_rows_after_nibble (#682)
- Implemented the feature
- Created test case
2023-09-22 13:35:29 +03:00
Sveta Smirnova
f8c43118bd PT-2168 pt-osc shouldnt fail while unable to monitor a replica node (#676)
* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Proof of concept
- Fixed regular expression in lib/TableParser.pm mistakenly chaged in the tool's code

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added basic test case for PT-2168
- Added more details for replica lag information
- Disconnecting replica if lag is not checked. This prevents "Too many
  connections" error

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Implemented option --wait-lost-replicas for pt-osc, added test case

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added more tests for situations where connection to the replica can
  fail

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Removed extra checks for wait_no_die variable
- Added test cases for SQL queries that pt-osc sends to replicas

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Allow to reload dsns table while waiting for missed replica if
  --recursion-method is dsn
- Fixed logic in replica rediscovery, so it works with replicas on the
  same host but with different ports
- Renamed option wait-lost-replicas to fail-on-stopped-replication, so
  it is in line with pt-table-checksum
- Adjusted tests
- Removed debug code for PT-1760
- Added test case for PT-1760
- Added exception for variable Open_tables_with_triggers in
  lib/bash/collect.sh due to failed test in Percona Server 8.0.34+
- Updated pt-stalk

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Updated modules
- Fixed typo in t/pt-table-sync/bidirectional.t
- Removed trailing whitespaces in lib/MasterSlave.pm

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Help for option --fail-on-stopped-replication

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added check for availability of the simple_rewrite_plugin in t/pt-online-schema-change/pt-2168.t

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added link to the simple_rewrite_plugin source code
- Removed tests for code that runs only in the beginning of pt-osc
  action, so should not be affected by the option fail-on-stopped-replication
2023-09-19 23:31:33 +03:00
Viktor Szépe
2bd40d8c39 Remove trailing spaces (#665)
* Remove trailing spaces

* PR-665 -  Remove trailing spaces

- Updated not stable test t/pt-online-schema-change/preserve_triggers.t
- Updated utilities in bin directory

* PR-665 -  Remove trailing spaces

- Fixed typos

* PR-665 -  Remove trailing spaces

- Fixed typos

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-09-06 01:15:12 +03:00
Viktor Szépe
3867d10ba5 Fix line ends (#664)
* Fix line ends of pt-mongodb-query-digest README

* Fix line ends of t/pt-diskstats/samples/small.txt
2023-08-23 16:27:18 +03:00
Viktor Szépe
c57441be8c War on typos Act 1 (#655)
* Fix typos in lib/ directory

* Update generated bin/ files

* PR 655 -  War on typos Act 1 #655

- Updated modules in tools that were not updated
- Fixed tests to reflect proposed changes

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-08-22 16:18:38 +03:00
Sveta Smirnova
9755074cd8 PT-2156 Fix tests for lib, part2 (#650)
* PT-2156 - Fix tests for lib

Fixed tests, broken by putting fix for PT-1554 into the library code, mostly by updating checksums.
Added AutoCommit option for test lib/QueryReview.t
Reset SQL mode to empty to allow TableChunker to work with invalid and zero dates

* PT-2156 - Fix tests for lib

Adjusted t/lib/SchemaIterator.t to work with version 8.0

* PT-2156 - Fix tests for lib

Adjusted b/t/lib/Processlist.t, so it reflects fix for PT-981

* PT-2156 - Fix tests for lib

Adjusted t/lib/HTTP/Micro.t, so it works with different order of parameters, returned at v.percona.com/
Adjusted test for empty files in t/lib/bash/collect.t
Disabled mysqladmin debug test in t/lib/bash/collect.t, because of PT-2242

* PT-2156 - Fix tests for lib

Added LC_NUMERRIC=POSIX into t/lib/bash/report_system_info.sh, so reports in tests are not environment-dependent
Updated expected results in t/lib/bash/report_system_info.sh, so they reflect new information, collected by pt-summary

* PT-2156 - Fix tests for lib

- Improved fix for PT-76, so it handles inline comments
- Added test case for PT-76
- Improved fix for PT-1720, so it ignores unrecognizable option only if it comes from the toolkit-wide files and still errors out if wrong option was passed via command line or the tool-specific option file.

* PT-2156 - Fix tests for lib

- Improved fix for PT-2102, so it finds running instance configuration file using PID and also does not break t/lib/bash/report_mysql_info.t test
- Removed unnecessary copy-paste from t/pt-mysql-summary/pt-2102.t test
- Adjusted number of collected files in t/lib/bash/collect_mysql_info.sh

* PT-2156 - Fix tests for lib

- Fix for PT-1543 and MyRocks collection were originally put only into lib/bash/report_mysql_info.shthat broke the logic of collecting data first, then formatting report from this data. This, in its turn, broke test t/lib/bash/report_mysql_info.sh/t/lib/bash/report_mysql_info.t, because CMD_MYSQL is not defined in this library. I rewrote these fixes, so they follow original logic of the tool (pt-mysql-summary)
- Added tests for keyring plugin, encrypted tables, and MyRocks for t/lib/bash/report_mysql_info.sh and t/pt-mysql-summary/pt-mysql-summary_encryption.t

* PT-2156 - Fix tests for lib

- Added FLUSH TABLES to t/lib/bash/collect.sh, so it does not fail opentables tests if run when more than 1000 tables open in the sandbox environment
- Changed number of expected sample files to reflect keyring colletion file

* PT-2156 - Fix tests for lib

- Added skip to some tests in lib that file when run with PXC, because not supported to work with PXC
- Adjusted configuration files for PXC, so they allow LOAD DATA/SELECT INTO OUTFILE commands
- Adjusted data samples, so they do not depend on auto increment values
- Fixed lib tests, failing with PXC

* PT-2156 - Fix tests for lib

Updated tests for pt-online-schema-change, so they work with PXC and skipped if designed for semi-synchronous replication setup

* PT-2156 - Fix tests for lib

- Added cluster-specific samples for t/lib/SchemaIterator.t
- Removed extra debugging print from t/pt-table-checksum/pt-1728.t

* PT-2156 - Fix tests for lib

Evgeniy's review on July 20

* Update t/lib/TableSyncer.t

Removed comment left after debugging

* Update t/pt-mysql-summary/pt-mysql-summary_encryption.t

Removed extra debug output

* PT-2156 - Fix tests for lib

Tabs to spaces
2023-08-02 14:50:21 +03:00
PinoCao
91f9e27255 PT-2241 - fix(pt-online-schema-change): using --skip-check-slave-lag multiple times does not work as expected (#622)
* fix(pt-online-schema-change): Fix the issue where using --skip-check-slave-lag multiple times does not work as expected.

* PT-2241: add test cases for pt-online-schema-change

* Update t/pt-online-schema-change/pt-2241.t

fix():reset the delay on replicas

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>

---------

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-07-31 16:59:09 +03:00
Marcelo HP Ferreira
8ece30ff2f Add after nibble hook to pt-online-schema-change (#645)
* Include hook after nibble on copy rows

* Update tests with new hook for pt-online-schema-change
2023-07-31 16:30:24 +03:00
Sveta Smirnova
25c969542b PT-2151 fix tests for pt-query-digest (#631)
* PT-2151 - Fix tests for pt-query-digest

Put fix for PT-1908 into the proper place

* PT-2151 - Fix tests for pt-query-digest

Put fix for PT-1554 into the proper place

* PT-2151 - Fix tests for pt-query-digest

Adjusted expected results for the default test t/pt-table-checksum/basics.t, so they do not depend on number of rows in the help tables

* PT-2151 - Fix tests for pt-query-digest

Added additional check for both replicas into t/pt-online-schema-change/preserve_triggers.t to avoid deadlock when ->ok() is doing CHECKSUM

* PT-2151 - Fix tests for pt-query-digest

Added delay to t/pt-table-sync/wait.t, so it waits for the child process to start lagging

* PT-2151 - Fix tests for pt-query-digest

Updated t/pt-query-digest/samples/issue_1196-output-8.0.txt, so it reflects changes in the latest 8.0

* PT-2151 - Fix tests for pt-query-digest

Updated queries against query history table, so they don't fail after e2cf183762

* PT-2151 - Fix tests for pt-query-digest

Fixed PT-813 by comparing query text. Since order itself does not matter, it is not essential to compare by the fingerprint or use any other function that changes the query.

* PT-2151 - Fix tests for pt-query-digest

Adjusted samples files which now should have consistent order after fix for PT-813

* PT-2151 - Fix tests for pt-query-digest

Fixed typo in the SELECT query in the QueryReview package

* PT-2151 - Fix tests for pt-query-digest

Fix for PT-981

* PT-2151 - Fix tests for pt-query-digest

Updated modules for pt-index-usage and fixed tests, because checksum is calculated differently after fix for PT-1554

* PT-2151 - Fix tests for pt-query-digest

Updated modules for pt-diskstats, pt-fk-error-logger, pt-heartbeat, pt-online-schema-change, pt-slave-delay, pt-slave-find, pt-table-checksum, pt-table-sync, pt-upgrade

* PT-2151 - Fix tests for pt-query-digest

Updated lib/IndexUsage.pm, so fix for pt-index-usage is in the correct place
2023-06-23 15:48:21 +03:00
Sveta Smirnova
249b5b61e9 PT-2048 - pt-osc spans excessive connections to the replica when executing in the source (#613)
* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

The bug itself is fixed by PT-2160: 'fix tests for pt online schema change'

* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

Suggestions by Saikumar

* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

Typos in the test file
2023-05-09 14:22:29 +03:00
Sveta Smirnova
642253ce52 PT-2156 Fix tests for lib (#606)
* PT-2156 - Fix tests for lib

- Fixed tests broken for lib/TableParser.pm after fix for PT-1059
- Updated tests for lib/TableParser.pm that are broken due to SHOW CREATE TABLE output format change in 8.0
- Updated modules for all tools that use lib/TableParser.pm

* Revert "Fixed pt-archiver tests"

This reverts commit a3ab87b12e.

This commit wa needed, because removed code in sandbox/slave_channels.sql broked the test. Proper fix would be to do not remove channel names rather than chaging the test. So revertig it.

* PT-2156 - Fix tests for lib

- Updated test t/lib/TableChecksum.t so it reflects changes, introduced in the fix for PT-2016
- Updated test t/lib/RowChecksum.t so it reflects changes added to in the fix for PT-2138: UTF8 support
- Uncommented SQL in sandbox/slave_channels.sql that made t/lib/MasterSlave.t to fail
- Added check for undef into t/pt-archiver/archive_using_channels.t
- Updated lib/Cxn.pm so it uses $dbh->{Active} after issue with the ping() call, reported at https://github.com/perl5-dbi/DBD-mysql/issues/306

* PT-2156 - Fix tests for lib

- Impoved the fix for PT-2016, so it does not files with keys with USING keyword
- Added brackets to expression in lib/TableNibbler.pm, so it does not crap query wit many indexes with OR keyword
- Adjusted test t/lib/TableNibbler.t, so it reflects above chages
- Modified lib/Cxn.pm, so it has workaround for https://github.com/perl5-dbi/DBD-mysql/issues/306 , introduced in DBD::mysql 4.0.50
- Updated tests: added debugging code and cleanups
- Updated modules for tools
2023-03-27 14:18:26 +03:00
Sveta Smirnova
bfc00b93a8 PT-2160 fix tests for pt online schema change (#602)
* PT-2160 - Fix tests for pt-online-schema-change

Re-enabled tests after MySQL bug #89441 fix in 8.0.14 and later
Updated t/pt-online-schema-change/samples/basic_no_fks_innodb.sql, so its unique index is NOT NULL
Added synchonizations when tests are waiting for too long due to slave catch up
Added innodb_directories option for t/pt-online-schema-change/pt-244.t

* PT-2160 - Fix tests for pt-online-schema-change
PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

t/pt-online-schema-change/slave_lag.t was failing due to PT-2048. I added code that reuses already created connections when checks for slave in the wait loop. It fixes slave_lag.t too.
I also added that prints more detailed error when fails to connect to the replica.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/slave_lag.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/pt-1455.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Fixed search for HASH and BTREE keys broken by fix for PT-2123
Updated modules for pt-archiver
Fixed die message for sandbox/start-sandbox
Added global_grants table to list of exceptions for the ok function in lib/Sandbox.pm
Added wait_for_slaves to bugs.t, so changes on the source are copied to replica before pt-osc starts working
Updated PXC tests
Added wait_for_slaves to pt-1455.t
Fixed regular expression in pt-229.t, so it works with both 5.x and 8.0 versions
Added innodb_directories option for pt-244.t, so it does not fail on 8.0
Modified slave_lag.t, so it is more stable and slow enough, so pt-osc can print message about delayed replicas
2023-02-27 01:19:11 +03:00
Yoann La Cancellera
7ecdae6ef6 PT-2102_pt-mysql-summary should support include in config files (#601)
* PT-2102 pt-mysql-summary should support include* in config file

includedir directories are now printed in the order of which they appear in root my.cnf

* PT-2102 pt-mysql-summary should support include* in config file

!include was not supported. Changed 'for' to 'while' to properly
test for '!includedir' and '!include'. Supports extra spaces between
files and !include.

* PT-2102 pt-mysql-summary should support include* in config file

Updates modules, added test case for !include and !includedir
Changed find_my_cnf function to make it try every regexes and only
returned when it find one

* Update pt-mysql-summary

Identation fix as suggested by review

* Update collect_mysql_info.sh

Identation as suggested by review

* PT-2102 pt-mysql-summary should support include* in config file

Fix formatting after review

---------

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-02-23 16:00:44 +03:00
Sveta Smirnova
09d9d1a6e4 PT-2161 - Fix tests for pt-slave-restart (#599)
Added REPLICATION_THREADS=0 to tests which suppose that replication is single-threaded,
because new default in 8.0 is 4 replication threads.
Fixed clean up code in t/pt-slave-restart/pt-slave-restart.t
2023-02-22 19:02:13 +03:00
Sveta Smirnova
aa1ab5d172 PT-2149 - Fix tests for pt-mext (#596)
Changed LANG=C to LOCALE=C, because only LANG does not change sort order properly in tr_TR.UTF8 environment
2023-02-22 19:01:41 +03:00
Sveta Smirnova
beb2b666e8 PT-2159 - Fix tests for pt-duplicate-key-checker (#595)
Added transformation to test results, so they work with deprecations, introduced in 8.0
2023-02-22 18:59:43 +03:00