Commit Graph

309 Commits

Author SHA1 Message Date
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
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
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
Sveta Smirnova
01de987154 PT-2141 fix tests for pt-archiver (#581)
* PT-2141 Fix tests for pt-archiver

Fixed tests t/pt-archiver/bulk_insert.t, t/pt-archiver/issue_1225.t, t/pt-archiver/issue_1229.t
Their failures were due to change of utf8 alias from utf8mb3 in MySQL 5.7 to utf8mb4 in MySQL 8.0.
And also due to character set match check between connection ad source table.

* PT-2141 Fix tests for pt-archiver

Removed test for PT-1898, because it was broken from the beginning:
- it called pt-online-schema-change instead of pt-archiver
- it announced it will run 6 tests while was running only 2
- the test case itself did not test the issue, described in PT-1898
2023-02-02 17:09:34 +03:00
yoku0825
cceb48619f Use full_output to avoid to die (PT-1967) (#494) 2022-09-28 02:55:30 +03:00
yoku0825
dcf237ef8c Fix test PT-1966 (#493)
* Detect raising error for PT-1966

* Fix non-duplicated column name for PT-1966

* More good way to catch an error. (PT-1966)

- https://github.com/percona/percona-toolkit/pull/493#pullrequestreview-678426876

* Add Changelog (PT-1966)

- https://github.com/percona/percona-toolkit/pull/493
2021-06-17 10:28:54 -03:00
Carlos Salguero
0b97e1f471 PT-1747 pt-online-schema-change was bringing the database into a broken state (#491)
* PT-1717 Updated behavior for FKs

* Fixed rename_columns.t

* Fixed pt-244.t

* fixed drop swap test

* Fixed test for MySQL 8.0

* Updated test for MySQL 8

* Updated test for MySQL 8
2021-06-03 12:00:43 -03:00
Carlos Salguero
e570cecbab PT-1914 Column data lost when 'Generated' is in the column comment (#482)
* PMM-1914 Fixed column parsing having generated

Fixed table parser code that errouneously considered a column as
generated when the default was empty DEFAULT '' and the COMMENT had
the word 'Generated'.

* PMM-1914 Updated TableParser in all programs

* PT-1914 Updated changelog

* PT-1914 Added test
2021-03-09 11:46:05 -03:00
Carlos Salguero
4f78d5450c PT-1919 drop-swap can drop triggers (#483)
* PT-1919 drop-swap can drop triggers

* PT-1919 Update changelog
2021-03-05 11:32:03 -03:00
Carlos Salguero
9ef2b56f4d PT-1905 Reverse triggers (#477)
* PT-1905 Reverse triggers

* WIP

* PT-1905 Updated reverse triggers creation

* PT-1905 Fixed trigger creation
2021-01-12 13:58:34 -03:00
Carlos Salguero
71c9902532 PT-1898 pt archiver keeps transaction open (#479)
* PT-1898 WIP

* PT-1898 Added commit for open txns

* PT-1898 Added commit for open txns

* PT-1898 removed dev leftover
2021-01-12 13:40:51 -03:00
Carlos Salguero
2233224ff6 PT-1528 pt-online-schema-change "Invalid utf8mb4 character string (#473)
* PT-1528 [WIP] Proposed solution

* PT-1528 Ingore UTF8 warning
2020-12-24 16:22:46 -03:00
Carlos Salguero
d7a7a1c7a5 PT-169 Handle drop-swap errors in pt-online-schema-change (#467)
* PT-169 Fixed drop-swap error handling

* PT-169 Fixed drop_swap error handling
2020-10-12 15:36:45 -03:00
Mateus Dubiela Oliveira
d6ada6a7bf PT-1869: Enable slave list reloading (#456)
* PT-1869: Enable slave list reloading

* PT-1869: Fix pt-osc/slave_lag sample sizes for more consistent testing results

* PT-1869: Move slaves_to_skip to get_slaves_cb
2020-08-12 11:30:56 -03:00
Carlos
8ff3451362 PT-1853 Changed wording 2020-06-30 20:54:08 -03:00
Carlos
9f2b72e0df PT-1853 Added disable fk checks in MySQL 2020-06-30 20:09:39 -03:00
Carlos Salguero
c6b4bd747e PT-1852 Added --no-check-foreing-keys to pt-osc 2020-06-21 18:53:47 -03:00
Carlos Salguero
6dbf807dfa Fixed Fk tests 2020-04-16 16:12:40 -03:00
Carlos Salguero
208fb86586 Revert "Merge pull request #427 from percona/PT-1747"
This reverts commit 25b637d4bd, reversing
changes made to 38c169031e.
2020-04-03 14:40:35 -03:00
Carlos Salguero
54f90e4bdf PT-1802 WIP 2020-04-02 09:57:45 -03:00
Carlos Salguero
45522dea28 Renamed dubious tests 2020-04-01 15:39:16 -03:00
Carlos Salguero
fc631efb32 Fixed long_fk_constraints.t 2020-03-31 11:27:04 -03:00
Carlos Salguero
f0ee14d479 WIP 2020-03-30 08:21:05 -03:00
Carlos Salguero
e97d80cde0 PT-1747 Updated MySQL version check 2019-11-26 10:04:56 -03:00
Carlos Salguero
0c50d8f708 Merge pull request #420 from percona/PT-1760
PT-1760 regression on slave with replication channels
2019-10-15 19:02:36 -03:00
Carlos Salguero
13f7afc49d PT-1757 Fixed NibbleIterator undef 2019-10-14 14:44:57 -03:00
Carlos Salguero
6a302e2b07 PT-1757 Implemented fallback in NibbleIterator
Since now NibbleIterator can fallback to nibble (from one chunk) pt-osc
can nibble tables even if due to unacurate stats, it choses one nible as
the initial nibbling method.
2019-10-13 21:58:56 -03:00
Carlos Salguero
522f8c5821 PT-1760 Updated DSNParser module 2019-10-01 08:26:42 -03:00
Carlos Salguero
9ed892692a PT-297 removed debug code 2019-09-20 13:50:44 -03:00
Carlos Salguero
10fe056242 WIP 2019-09-19 14:29:55 -03:00
Carlos Salguero
ed6ebcedbd Updated changelog and tests 2019-09-06 06:25:52 -03:00
Carlos Salguero
30896506db PT-1705 Added exit codes to pt-osc 2019-08-13 22:01:49 -03:00
Carlos Salguero
c6e07e6b63 PT-1705 Added exit codes to osc 2019-08-13 20:27:35 -03:00
Carlos Salguero
dc9edf7cda PT-1574 Fixed undefs handling 2018-08-07 14:21:44 -03:00
Carlos Salguero
b5a1775bad PT-1574 PT-1590 Fixed test 2018-08-07 09:40:05 -03:00
Carlos Salguero
7260bab2dc PT-1574 Added a test case 2018-08-07 01:03:58 -03:00
Carlos Salguero
2b45f192b0 PT-1574 Improved detection of nullable keys 2018-07-27 13:34:19 -03:00
Carlos Salguero
6d30d18834 PT-1554 Fixed tests for rebuild_constraints in MySQL 8 2018-06-20 12:12:28 -03:00
Carlos Salguero
a90e5a78a0 PT-1554 Improved MySQL 8 support on pt-osc 2018-06-15 00:00:04 -03:00
Carlos Salguero
f5fd795fda PT-1559 pt-osc --alter-foreign-keys-method=drop_swap doesn't work with MySQL 8.0+ 2018-06-13 16:46:40 -03:00
Carlos Salguero
0004bb7bbc PT-1554 (WIP) Tests for MySQL 8
There are tests failing but the sandbox doesn't crash
2018-05-30 21:25:28 -03:00
Carlos Salguero
b801dfa156 PT-1554 Fixed 2 tests for MySQL 5.7 2018-05-30 09:09:42 -03:00
Carlos Salguero
1a4c471a46 PT-1554 Fixed unstable test alter_active_table.t 2018-05-30 02:01:27 -03:00
Carlos Salguero
af62172435 PT-1554 Fixed test for pt-244 (change data dir) 2018-05-29 19:57:08 -03:00
Carlos Salguero
08b00e7fab PT-1554 Fix to run tests in a tmpfs 2018-05-29 18:07:05 -03:00