Skip to content

Commit

Permalink
Adding pquery3 test scripts for PXC QA
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshvs02 committed Oct 15, 2019
1 parent da34f87 commit f90427e
Show file tree
Hide file tree
Showing 5 changed files with 1,910 additions and 0 deletions.
59 changes: 59 additions & 0 deletions pquery/pquery3-cluster-pxc.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[node1.ci.percona.com]
socket = /tmp/node1/node1_socket.sock
threads = 5
run = true
user = root
logdir = /tmp
log-all-queries = Yes
log-failed-queries = Yes
log-query-duration = Yes
tables = 30
records = 200
seed = 200
recreate-table = 50
optimize = 10
rename-column = 100
add-index = 100
drop-index = 100
add-column = 100
primary-key-probablity = 100

[node2.ci.percona.com]
socket = /tmp/node2/node2_socket.sock
threads = 5
run = true
user = root
logdir = /tmp
log-all-queries = Yes
log-failed-queries = Yes
log-query-duration = Yes
tables = 30
records = 200
seed = 200
recreate-table = 50
optimize = 10
rename-column = 100
add-index = 100
drop-index = 100
add-column = 100
primary-key-probablity = 100

[node3.ci.percona.com]
socket = /tmp/node3/node3_socket.sock
threads = 5
run = true
user = root
logdir = /tmp
log-all-queries = Yes
log-failed-queries = Yes
log-query-duration = Yes
tables = 30
records = 200
seed = 200
recreate-table = 50
optimize = 10
rename-column = 100
add-index = 100
drop-index = 100
add-column = 100
primary-key-probablity = 100
19 changes: 19 additions & 0 deletions pquery/pquery3-single-pxc.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[node1.ci.percona.com]
socket = /tmp/node1/node1_socket.sock
threads = 5
run = true
user = root
logdir = /tmp
log-all-queries = Yes
log-failed-queries = Yes
log-query-duration = Yes
tables = 30
records = 200
seed = 200
recreate-table = 50
optimize = 10
rename-column = 100
add-index = 100
drop-index = 100
add-column = 100
primary-key-probablity = 100
110 changes: 110 additions & 0 deletions pquery3-run-pxc-cluster.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/bash
# Created by Roel Van de Paar, Percona LLC
# Updated by Ramesh Sivaraman, Percona LLC

# Welcome to the pquery-run.sh configuration file (pquery-run.conf). Feel free to copy this file, edit the copy & change the CONFIGURATION_FILE variable in pquery-run.sh to match!
# Please do not change this file unless your name is listed above. As a template/default, it is the only configuration file which is maintained whenever pquery-run.sh is updated.

# ========================================= User configurable variables: generics 1 ===============================================
PQUERY_BIN=${SCRIPT_PWD}/pquery/pquery2-ps # pquery2-ps: Percona Server, pquery2-ms: MySQL, pquery2-ws: WS/FB: WSS/fb-mysql, pquery-md: MariaDB, pquery2-ps-deb: Binary compiled on Ubuntu
PQUERY_CONFIG=${SCRIPT_PWD}/pquery/pquery3-cluster-pxc.cfg # Default pquery cluster configuration file.
USE_GENERATOR_INSTEAD_OF_INFILE=0 # If enabled, high quality generated SQL is used (the generator is located in percona-qa/generator)
ADD_INFILE_TO_GENERATED_SQL=0 # If enabled, and if USE_GENERATOR_INSTEAD_OF_INFILE=1, then the INFILE is added to the generator output
# Should be used with caution when a lage INFILE is used. It is ideal for small input files (feature testing)
INFILE=${SCRIPT_PWD}/pquery/main-ms-ps-md.sql.tar.xz # Default: main-ms-ps-md.sql (mtr_to_sql.sh of all major distro's + engine mix). Use main-ws.sql for mysql-fb
OPTIONS_INFILE=${SCRIPT_PWD}/pquery/mysqld_options_ps_57.txt # Set to the right distribution + version to match mysqld options (as generated by generate_mysqld_options.sh)
# mysqld_options_ps_56.txt, mysqld_options_ms_56.txt, mysqld_options_ms_57.txt, mysqld_options_ps_55.txt etc.
TOKUDB_OPTIONS_INFILE=${SCRIPT_PWD}/pquery/mysqld_options_tokudb.txt # TokuDB options list
BASEDIR=/sda/Percona-Server-5.7.17-11-Linux.x86_64 # MySQL Basedir. Required for all runs, including PXC
WORKDIR=/sda/$RANDOMD # Working directory. Here we keep the log files, option list, failed items. Please leave $RANDOMD!
RUNDIR=/dev/shm/$RANDOMD # Run directory. Keeps a copy of the data dir template & stores mysqld runs (--datadir=x). Pls leave $RANDOMD!
SYSBENCH_DATALOAD=0 # Sysbench data load. Normally set to 0 (off)

# ========================================= User configurable variables: generics 2 ===============================================
TRIALS=100000 # Number of individual trials to execute (one can always interrupt with ctrl+c also)
ADD_RANDOM_OPTIONS=1 # Add random mysqld --options to MYEXTRA using an input file. 1=On, 0=off. (Auto-disabled if PXC=1)
ADD_RANDOM_TOKUDB_OPTIONS=0 # Add random tokudb --options to MYEXTRA using an input file. 1=On, 0=off. (Auto-disabled if PXC=1)
MAX_NR_OF_RND_OPTS_TO_ADD=5 # Max nr of random options to add (minimum is always 1). Recommended: 4. Counts per ADD_RANDOM_... option above (x2)
SAVE_TRIALS_WITH_CORE_OR_VALGRIND_ONLY=1 # Save only trials that generate a core file (good for initial few runs where there are lot of crashes/asserts)
SAVE_SQL=0 # Saves per-trial SQL even if SAVE_TRIALS_WITH_CORE_OR_VALGRIND_ONLY=1. Main usecase: full server lockups/hangs
STORE_COPY_OF_INFILE=0 # Store a copy of the INFILE SQL input file in the work directory (not related to per-trial SQL)
PQUERY_RUN_TIMEOUT=15 # x sec max trial runtime within which pquery tries to process QUERIES_PER_THREAD x THREADS queries against 1 mysqld
QUERIES_PER_THREAD=100000 # Maximum number of queries executed per thread (THREADS) per trial (small = faster reduction, large = more crashes)
QUERIES_PER_GENERATOR_RUN=25000 # Used when USE_GENERATOR_INSTEAD_OF_INFILE=1. Default: 20000. Generating 10K queries takes about 15 seconds on SSD
GENERATE_NEW_QUERIES_EVERY_X_TRIALS=10 # Run the SQL Generator every x trials. Default is 10. This aids runs as less time is spent generating queries
MYINIT="" # Extra options to pass to mysqld AND at data directory init time, for example MYINIT="--early-plugin-load=keyring_file.so --keyring_file_data=keyring --innodb_sys_tablespace_encrypt=ON"
MYEXTRA="" # Extra options to pass to mysqld. Examples below
MYSAFE="--no-defaults --max_allowed_packet=33554432 --maximum-bulk_insert_buffer_size=1M --maximum-join_buffer_size=1M --maximum-max_heap_table_size=1M --maximum-max_join_size=1M --maximum-myisam_max_sort_file_size=1M --maximum-myisam_mmap_size=1M --maximum-myisam_sort_buffer_size=1M --maximum-optimizer_trace_max_mem_size=1M --maximum-preload_buffer_size=1M --maximum-query_alloc_block_size=1M --maximum-query_prealloc_size=1M --maximum-range_alloc_block_size=1M --maximum-read_buffer_size=1M --maximum-read_rnd_buffer_size=1M --maximum-sort_buffer_size=1M --maximum-tmp_table_size=1M --maximum-transaction_alloc_block_size=1M --maximum-transaction_prealloc_size=1M --log-output=none --sql_mode=ONLY_FULL_GROUP_BY" #5.6/5.7
# MYSAFE: See http://bugs.mysql.com/?id=73916 re: testing env setup. MYSAFE ensures cleaner/better QA runs
THREADS=1 # Number of threads to use. Default: 1. Set to >1 to enable multi-threaded runs. Also see MULTI_THREADED_TESTC_LINES
MULTI_THREADED_TESTC_LINES=25000 # Only takes effect if THREADS>1. pquery-run will take this amount of lines to form individual testcases for multi-threaded runs. IOW, if THREADS=1, pquery-run will just run one client, continously getting random queries out of INFILE, untill QUERIES_PER_THREAD queries is reached (if mysqld does not crash earlier). On the other hand, if THREADS>1, pquery-run will take a random chunk out of INFILE (to the amount of MULTI_THREADED_TESTC_LINES lines) _before_ starting each trial run. It will then run pquery, with THREADS threads, only using that smaller chunk extracted from INFILE. These individual SQL input files are saved in the trial's dirtory. You may want to keep this number small to ensure that true-multi-threaded testcase reduction using reducer.sh is still sufficiently fast (25K lines takes a few days to reduce), while keeping it large enough to ensure crashes/asserts to start with.

# ==== PS 5.7 example:
#MYEXTRA="--log-bin --server-id=0 --thread_handling=pool-of-threads --plugin-load-add=tokudb=ha_tokudb.so --tokudb-check-jemalloc=0 --init-file=${SCRIPT_PWD}/plugins_57.sql"

# ==== PS 5.6 example: all plugins, binlog, threadpool, TokuDB. Can be adapted for MS by removing threadpool and changing plugins to plugins_MS.sql
#MYEXTRA="--log-bin --thread_handling=pool-of-threads --plugin-load-add=tokudb=ha_tokudb.so --tokudb-check-jemalloc=0 --init-file=${SCRIPT_PWD}/plugins_56.sql"

# ==== PS 5.5 example: all plugins, binlog, threadpool. Remove # for all items here. Can be adapted for MS by removing threadpool and changing plugins to plugins_MS.sql
#ADD_RANDOM_TOKUDB_OPTIONS=0
#MYEXTRA="--log-bin --thread_handling=pool-of-threads --init-file=${SCRIPT_PWD}/plugins_55.sql"
#MYSAFE="--no-defaults --max_allowed_packet=33554432 --maximum-bulk_insert_buffer_size=1M --maximum-join_buffer_size=1M --maximum-max_heap_table_size=1M --maximum-max_join_size=1M --maximum-myisam_max_sort_file_size=1M --maximum-myisam_mmap_size=1M --maximum-myisam_sort_buffer_size=1M --maximum-preload_buffer_size=1M --maximum-query_alloc_block_size=1M --maximum-query_prealloc_size=1M --maximum-range_alloc_block_size=1M --maximum-read_buffer_size=1M --maximum-read_rnd_buffer_size=1M --maximum-sort_buffer_size=1M --maximum-tmp_table_size=1M --maximum-transaction_alloc_block_size=1M --maximum-transaction_prealloc_size=1M --log-output=none --sql_mode=ONLY_FULL_GROUP_BY" # Customized MYSAFE for 5.5

# ==== Other MYEXTRA examples
#MYEXTRA="--max-connections=2048 --performance-schema --performance-schema-instrument='%=on'" # Use for PMM testing
#MYEXTRA="--default-tmp-storage-engine=MyISAM --rocksdb --skip-innodb --default-storage-engine=RocksDB" # Use for generic RocksDB testing
#MYEXTRA="--innodb_file_per_table=1 --innodb_flush_method=O_DIRECT --log-bin --binlog_format=MIXED" # Example of some specific options
#MYEXTRA="--innodb_track_changed_pages" # Example of PS specific option

# ========================================= User configurable variables to enable query correctness testing ======================
# Note: if/when using RocksDB as a primary or secondary engine, it must be spelled correctly as: RocksDB. Variations like: rocksdb will cause failures in this script
QUERY_CORRECTNESS_TESTING=0 # Set to 1 to enable query correctness testing. Normally set to 0 (off)
QUERY_CORRECTNESS_MODE=2 # Sets the result comparison modes: 0: errors/warnings, 1: 'changed rows' comparision, 2: actual query results
QC_NR_OF_STATEMENTS_PER_TRIAL=2000 # Number of queries sampled/used per trial (executed against both engines below, then results are compared)
QC_PRI_ENGINE=RocksDB # Primary comparison engine for query correctness testing. Make sure to match this with MYEXTRA ('left engine')
QC_SEC_ENGINE=InnoDB # Secondary comparison engine for query correctness testing. Make sure to match this with MYEXTRA2 ('right engine')
MYEXTRA2="--default-tmp-storage-engine=MyISAM --default-storage-engine=InnoDB --collation-server=latin1_bin" # Used for secondary mysqld (RocksDB testing)

# ========================================= User configurable variables to enable query duration testing =========================
QUERY_DURATION_TESTING=0 # Partially implemented only. Needs further development.

# ========================================= User configurable variables to enable Valgrind testing only ==========================
VALGRIND_RUN=0 # Set to 1 to make this a Valgrind run. Do not change VALGRIND_CMD unless you fully understand the change being made
VALGRIND_CMD="valgrind --suppressions=${BASEDIR}/mysql-test/valgrind.supp --num-callers=40 --show-reachable=yes --track-origins=yes"
VALGRIND_ERRORS_FOUND=0

# ========================================= User configurable variables to enable crash recovery testing only ====================
CRASH_RECOVERY_TESTING=0 # Set to 1 to make this a crash recovery test (terminates server after x seconds and then attempts crash recovery)
CRASH_RECOVERY_INFILE=${SCRIPT_PWD}/simple.sql # Currently using simple.sql for crash recovery testing. This can be changed/expanded upon
CRASH_RECOVERY_KILL_BEFORE_END_SEC=25 # Kill the server x seconds before the end of the trial. Ensure trial duration is somewhat larger then this

# ========================================= User configurable variables to configure PS testing only =============================
SKIP_JEMALLOC_FOR_PS=0 # Skip LD_PRELOAD'ing of JEMALLOC. Only indicated for testing PS without TokuDB against default memory manager

# ========================================= User configurable variables to enable/for PXC testing only ===========================
PXC=1 # Set to 1 to make this a PXC testing run
PXC_CLUSTER_RUN=1 # Set to 1 to make this a pxc pquery cluster run (enables multi-node SQL instead of using a single node only)
PXC_START_TIMEOUT=200 # Should not be necessary to change. Default: 200
PXC_ADD_RANDOM_OPTIONS=1 # Set to 1 to add random PXC mysqld options
PXC_MAX_NR_OF_RND_OPTS_TO_ADD=4 # Max nr of random PXC mysqld options to add (minimum is always 1). Recommended: 4
PXC_OPTIONS_INFILE=${SCRIPT_PWD}/pquery/mysqld_options_pxc_56.txt # PXC mysqld options list
PXC_WSREP_ADD_RANDOM_WSREP_MYSQLD_OPTIONS=1 # Set to 1 to add PXC wsrep mysqld options
PXC_WSREP_MAX_NR_OF_RND_OPTS_TO_ADD=3 # Maximum number of random PXC wsrep mysqld options to add
PXC_WSREP_OPTIONS_INFILE=${SCRIPT_PWD}/pquery/mysqld_options_pxc_wsrep_56.txt # PXC wsrep mysqld options list
PXC_WSREP_PROVIDER_ADD_RANDOM_WSREP_PROVIDER_CONFIG_OPTIONS=1 # Set to 1 to add PXC wsrep provider (Galera) configuration options
PXC_WSREP_PROVIDER_MAX_NR_OF_RND_OPTS_TO_ADD=2 # Maximum number of PXC wsrep provider (Galera) configuration options to add
PXC_WSREP_PROVIDER_OPTIONS_INFILE=${SCRIPT_PWD}/pquery/wsrep_provider_options_pxc_56.txt # PXC wsrep provider (Galera) configuration options list
PXC_IGNORE_ALL_OPTION_ISSUES=1 # Never end a run if wsrep mysqld or wsrep configuration option issues were detected. This is a powerful option,
# which does come with responsibility: you should check that your runs are running fine without them all ending
# immediately on mysqld startup, due to some faulty base MYEXTRA setting for example!

# ========================================= User configurable variables to enable/for Group Replication testing only =============
GRP_RPL=0 # Set to 1 to make this a Group Replication testing run
GRP_RPL_CLUSTER_RUN=0 # Set to 1 to make this a Group Replication pquery cluster run (enables multi-node SQL instead of using a single node only)
GRP_RPL_CLUSTER_CONFIG=${SCRIPT_PWD}/pquery/pquery-cluster.cfg # Default group replication pquery cluster configuration file.
GRP_RPL_START_TIMEOUT=200 # Should not be necessary to change. Default: 200

# ========================================= User configurable variables to enable pmm testing only ===============================
PMM=0 # Set to 1 to make this a PMM testing run
PMM_CLEAN_TRIAL=0 # Set to 1 to clean pmm-client service after every trial
PMM_VERSION_CHECK="1.0.5" # Set PMM admin version to use PMM testing
Loading

0 comments on commit f90427e

Please sign in to comment.