From fc3312c52c11d37b21346f5075232c6a64d64efb Mon Sep 17 00:00:00 2001 From: GOKUL S <94166506+MASTERGOKUL@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:23:51 +0530 Subject: [PATCH 1/6] Update pt-mysql-summary Changed the deprecated variable name tx_isolation to transaction_isolation --- bin/pt-mysql-summary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 74149426f..8acd86d43 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -2129,7 +2129,7 @@ section_innodb () { name_val "Commit Concurrency" \ "$(get_var innodb_commit_concurrency "$variables_file")" name_val "Txn Isolation Level" \ - "$(get_var tx_isolation "$variables_file")" + "$(get_var transaction_isolation "$variables_file")" name_val "Adaptive Flushing" \ "$(get_var innodb_adaptive_flushing "$variables_file")" name_val "Adaptive Checkpoint" \ From d2649ae884a2df0d4d6a35971ca36a98e66d406a Mon Sep 17 00:00:00 2001 From: GOKUL S <94166506+MASTERGOKUL@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:09:28 +0530 Subject: [PATCH 2/6] added version check for transaction_isolation and tx_isolation --- lib/bash/report_mysql_info.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index 05b0436ed..8ca601b75 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -1014,6 +1014,18 @@ section_innodb () { local bp_free="$(get_var Innodb_buffer_pool_pages_free "$status_file")" local bp_dirt="$(get_var Innodb_buffer_pool_pages_dirty "$status_file")" local bp_fill=$((${bp_pags} - ${bp_free})) + + # dynamically allocate variable name - transaction_isolation + local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') + local transaction_isolation_var="tx_isolation" + version_greater_equal() { # Function to compare versions + [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ] + } + if version_greater_equal "$mysql_version" "5.7.20"; then # true if version >= 5.7.20 + transaction_isolation_var="transaction_isolation" + fi + + name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})" @@ -1048,7 +1060,7 @@ section_innodb () { name_val "Commit Concurrency" \ "$(get_var innodb_commit_concurrency "$variables_file")" name_val "Txn Isolation Level" \ - "$(get_var tx_isolation "$variables_file")" + "$(get_var $transaction_isolation_var "$variables_file")" name_val "Adaptive Flushing" \ "$(get_var innodb_adaptive_flushing "$variables_file")" name_val "Adaptive Checkpoint" \ From 3d800e4a9c827d9a7af7774ca21120b254cd8e42 Mon Sep 17 00:00:00 2001 From: MASTERGOKUL Date: Thu, 11 Jul 2024 15:45:54 +0530 Subject: [PATCH 3/6] updated transaction_isolation check using ./util/update-modules --- bin/pt-mysql-summary | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 8acd86d43..a336f3bf3 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -2095,6 +2095,17 @@ section_innodb () { local bp_free="$(get_var Innodb_buffer_pool_pages_free "$status_file")" local bp_dirt="$(get_var Innodb_buffer_pool_pages_dirty "$status_file")" local bp_fill=$((${bp_pags} - ${bp_free})) + + local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') + local transaction_isolation_var="tx_isolation" + version_greater_equal() { # Function to compare versions + [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ] + } + if version_greater_equal "$mysql_version" "5.7.20"; then # true if version >= 5.7.20 + transaction_isolation_var="transaction_isolation" + fi + + name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})" @@ -2129,7 +2140,7 @@ section_innodb () { name_val "Commit Concurrency" \ "$(get_var innodb_commit_concurrency "$variables_file")" name_val "Txn Isolation Level" \ - "$(get_var transaction_isolation "$variables_file")" + "$(get_var $transaction_isolation_var "$variables_file")" name_val "Adaptive Flushing" \ "$(get_var innodb_adaptive_flushing "$variables_file")" name_val "Adaptive Checkpoint" \ From fbf144c8f6a1cbbb32762883f71d9667bf1c5713 Mon Sep 17 00:00:00 2001 From: MASTERGOKUL Date: Thu, 11 Jul 2024 18:15:18 +0530 Subject: [PATCH 4/6] changed if condition more readable --- bin/pt-mysql-summary | 6 +----- lib/bash/report_mysql_info.sh | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index a336f3bf3..815d25712 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -2098,14 +2098,10 @@ section_innodb () { local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') local transaction_isolation_var="tx_isolation" - version_greater_equal() { # Function to compare versions - [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ] - } - if version_greater_equal "$mysql_version" "5.7.20"; then # true if version >= 5.7.20 + if [ "$mysql_version" '>' "5.7.19" ]; then # true if version >= 5.7.20 transaction_isolation_var="transaction_isolation" fi - name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})" diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index 8ca601b75..d6a5df738 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -1018,14 +1018,10 @@ section_innodb () { # dynamically allocate variable name - transaction_isolation local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') local transaction_isolation_var="tx_isolation" - version_greater_equal() { # Function to compare versions - [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ] - } - if version_greater_equal "$mysql_version" "5.7.20"; then # true if version >= 5.7.20 + if [ "$mysql_version" '>' "5.7.19" ]; then # true if version >= 5.7.20 transaction_isolation_var="transaction_isolation" fi - name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})" From 2e643e59481e69ad7e2ac9ab075671d99b6d6be4 Mon Sep 17 00:00:00 2001 From: GOKUL S <94166506+MASTERGOKUL@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:16:36 +0530 Subject: [PATCH 5/6] Update Changelog typo mistake --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 5f99c43d3..8b44d5f16 100644 --- a/Changelog +++ b/Changelog @@ -320,7 +320,7 @@ v3.0.7 released 2018-03-01 v3.0.6 released 2017-12-20 - * Fixed bug PT-234: Genaral log parser cannot handle timestamps with tz + * Fixed bug PT-234: General log parser cannot handle timestamps with tz * Fixed bug PT-229: pt-online-schema-change does not retry on deadlock error when using percona 5.7 * Fixed bug PT-225: pt-table-checksum ignores generated cols * Improvement PT-221: pt-table-sync pt-table-sync support for MyRocks From f47c1d76b60d2d3ea173eb099dec425a68cf1af5 Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Tue, 16 Jul 2024 19:02:40 +0300 Subject: [PATCH 6/6] PR-839 - Update pt-mysql-summary - Reversed condition, so default is transaction_isolation, not tx_isolation - Removed extra variable: we have variable $version, defined before - Fixed test cases --- bin/pt-mysql-summary | 7 +++---- lib/bash/report_mysql_info.sh | 7 +++---- t/pt-mysql-summary/samples/expected_output_temp_enc008.txt | 2 +- t/pt-mysql-summary/samples/expected_output_temp_enc009.txt | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 815d25712..94039a767 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -2096,10 +2096,9 @@ section_innodb () { local bp_dirt="$(get_var Innodb_buffer_pool_pages_dirty "$status_file")" local bp_fill=$((${bp_pags} - ${bp_free})) - local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') - local transaction_isolation_var="tx_isolation" - if [ "$mysql_version" '>' "5.7.19" ]; then # true if version >= 5.7.20 - transaction_isolation_var="transaction_isolation" + local transaction_isolation_var="transaction_isolation" + if [ "$version" '<' "5.7.20" ]; then # false if version >= 5.7.20 + transaction_isolation_var="tx_isolation" fi name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index d6a5df738..79315b2f2 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -1016,10 +1016,9 @@ section_innodb () { local bp_fill=$((${bp_pags} - ${bp_free})) # dynamically allocate variable name - transaction_isolation - local mysql_version=$(get_var version "$variables_file" | awk -F'-' '{print $1}') - local transaction_isolation_var="tx_isolation" - if [ "$mysql_version" '>' "5.7.19" ]; then # true if version >= 5.7.20 - transaction_isolation_var="transaction_isolation" + local transaction_isolation_var="transaction_isolation" + if [ "$version" '<' "5.7.20" ]; then # false if version >= 5.7.20 + transaction_isolation_var="tx_isolation" fi name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})" diff --git a/t/pt-mysql-summary/samples/expected_output_temp_enc008.txt b/t/pt-mysql-summary/samples/expected_output_temp_enc008.txt index d080fcc13..c8b560ee1 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp_enc008.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp_enc008.txt @@ -259,7 +259,7 @@ Specify --databases or --all-databases to dump and summarize schemas Thread Concurrency | 0 Concurrency Tickets | 5000 Commit Concurrency | 0 - Txn Isolation Level | + Txn Isolation Level | REPEATABLE-READ Adaptive Flushing | ON Adaptive Checkpoint | Checkpoint Age | 69k diff --git a/t/pt-mysql-summary/samples/expected_output_temp_enc009.txt b/t/pt-mysql-summary/samples/expected_output_temp_enc009.txt index ec502f212..ff0763f9d 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp_enc009.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp_enc009.txt @@ -264,7 +264,7 @@ Specify --databases or --all-databases to dump and summarize schemas Thread Concurrency | 0 Concurrency Tickets | 5000 Commit Concurrency | 0 - Txn Isolation Level | + Txn Isolation Level | REPEATABLE-READ Adaptive Flushing | ON Adaptive Checkpoint | Checkpoint Age | 0