From ba96aa79a82363e0f958255e09aa91d2f2a6bfd9 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Thu, 14 Dec 2017 13:31:45 -0300 Subject: [PATCH] PT-214 Added RocksDB section to pt-mysql-summary --- Changelog | 2 ++ bin/pt-mysql-summary | 48 +++++++++++++++++++++++-------------------- sandbox/start-sandbox | 8 ++++---- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Changelog b/Changelog index 537a14be..1a6cc113 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,8 @@ v3.0.6 * 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 + * Improvement PT-218: pt-stalk checks RocksDB status + * Improvement PT-214: Added RocksDB section to pt-mysql-summary * Improvement PT-204: Make pt-table-checksum to skip RocksDB tables v3.0.5 released 2017-11-20 diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index ee05fab1..a020e63e 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1979,31 +1979,32 @@ section_innodb () { } section_rocksdb () { - local variables_file="$1" - local status_file="$2" + local variables_file="$1" + local status_file="$2" - local NAME_VAL_LEN=25 + local NAME_VAL_LEN=32 - [ -e "$variables_file" -a -e "$status_file" ] || return - - name_val "Block Cache Size" "$(shorten $(get_var rocksdb_block_cache_size "$variables_file") 0)" - name_val "Max Total Wal Size" "$(shorten $(get_var rocksdb_max_total_wal_size "$variables_file") 0)" - name_val "Block Size" "$(shorten $(get_var rocksdb_block_size "$variables_file") 0)" - name_val "Max Open Files" "$(shorten $(get_var rocksdb_max_open_files "$variables_file") 0)" - name_val "Max Background Jobs" "$(shorten $(get_var rocksdb_max_background_jobs "$variables_file") 0)" - name_val "Table Cache NumHardBits" "$(shorten $(get_var rocksdb_table_cache_numshardbits "$variables_file") 0)" - - - name_val "Bytes Per Sync" "$(shorten $(get_var rocksdb_bytes_per_sync "$variables_file") 0)" - name_val "Wal Bytes per Sync" "$(shorten $(get_var rocksdb_wal_bytes_per_sync "$variables_file") 0)" - name_val "Rate Limiter Bytes Per Second" "$(shorten $(get_var rocksdb_rate_limiter_bytes_per_sec "$variables_file") 0)" - name_val "Compaction Seq Deletes Count SD" "$(shorten $(get_var rocksdb_compaction_sequential_deletes_count_sd "$variables_file") 0)" - name_val "Compaction Seq Deletes" "$(shorten $(get_var rocksdb_compaction_sequential_deletes "$variables_file") 0)" - name_val "Compaction Seq Deletes Window" "$(shorten $(get_var rocksdb_compaction_sequential_deletes_window "$variables_file") 0)" + [ -e "$variables_file" -a -e "$status_file" ] || return + name_val "Block Cache Size" "$(shorten $(get_var rocksdb_block_cache_size "$variables_file") 0)" + name_val "Block Size" "$(shorten $(get_var rocksdb_block_size "$variables_file") 0)" + name_val "Bytes Per Sync" "$(shorten $(get_var rocksdb_bytes_per_sync "$variables_file") 0)" + name_val "Compaction Seq Deletes " "$(shorten $(get_var rocksdb_compaction_sequential_deletes "$variables_file") 0)" + name_val "Compaction Seq Deletes Count SD" "$(get_var rocksdb_compaction_sequential_deletes_count_sd "$variables_file")" + name_val "Compaction Seq Deletes Window" "$(shorten $(get_var rocksdb_compaction_sequential_deletes_window "$variables_file") 0)" + name_val "Default CF Options" "$(get_var rocksdb_default_cf_options "$variables_file")" + name_val "Max Background Jobs" "$(shorten $(get_var rocksdb_max_background_jobs "$variables_file") 0)" + name_val "Max Block Cache Size" "$(shorten $(get_var rocksdb_max_block_cache_size "$variables_file") 0)" + name_val "Max Block Size" "$(shorten $(get_var rocksdb_max_block_size "$variables_file") 0)" + name_val "Max Open Files" "$(shorten $(get_var rocksdb_max_open_files "$variables_file") 0)" + name_val "Max Total Wal Size" "$(shorten $(get_var rocksdb_max_total_wal_size "$variables_file") 0)" + name_val "Rate Limiter Bytes Per Second" "$(shorten $(get_var rocksdb_rate_limiter_bytes_per_sec "$variables_file") 0)" + name_val "Rate Limiter Bytes Per Sync" "$(shorten $(get_var rocksdb_bytes_per_sync "$variables_file") 0)" + name_val "Rate Limiter Wal Bytes Per Sync" "$(shorten $(get_var rocksdb_wal_bytes_per_sync "$variables_file") 0)" + name_val "Table Cache NumHardBits" "$(shorten $(get_var rocksdb_table_cache_numshardbits "$variables_file") 0)" + name_val "Wal Bytes per Sync" "$(shorten $(get_var rocksdb_wal_bytes_per_sync "$variables_file") 0)" } - section_noteworthy_variables () { local file="$1" @@ -2424,8 +2425,11 @@ report_mysql_summary () { fi fi - section "RocksDB" - section_rocksdb "$dir/mysql-variables" "$dir/mysql-status" + local has_rocksdb=$($CMD_MYSQL $EXT_ARGV -ss -e 'SHOW ENGINES' 2>/dev/null | grep -i 'rocksdb') + if [ ! -z "$has_rocksdb" ]; then + section "RocksDB" + section_rocksdb "$dir/mysql-variables" "$dir/mysql-status" + fi section "MyISAM" section_myisam "$dir/mysql-variables" "$dir/mysql-status" diff --git a/sandbox/start-sandbox b/sandbox/start-sandbox index 408ddf52..d772e773 100755 --- a/sandbox/start-sandbox +++ b/sandbox/start-sandbox @@ -176,11 +176,11 @@ make_sandbox() { if [ -x "$PERCONA_TOOLKIT_SANDBOX/bin/ps-admin" ]; then # try to enable RocksDB. Only available on Percona Server 5.7.19+ - if [ "$version" > "5.6" ]; then + if [ "$version" > "5.6" -a -n "$ENABLE_ROCKSDB" ]; then $PERCONA_TOOLKIT_SANDBOX/bin/ps-admin --enable-rocksdb -u root -pmsandbox -h 127.1 -P $port - if [ -n "$ENABLE_TOKUDB" ]; then - sudo $PERCONA_TOOLKIT_SANDBOX/bin/ps-admin --enable-tokudb -u root -pmsandbox -h 127.1 -P $port - fi + fi + if [ "$version" > "5.6" -a -n "$ENABLE_TOKUDB" ]; then + sudo $PERCONA_TOOLKIT_SANDBOX/bin/ps-admin --enable-tokudb -u root -pmsandbox -h 127.1 -P $port fi fi