Welcome to MySQL QA Episode #7 – Reducing Testcases for Beginners: single-threaded reducer.sh!
In this episode we’ll learn how to use reducer.sh. Topics discussed;
- reducer.sh introduction/concepts
- Basic configurable variables & their default reducer.sh settings
- INPUTFILE options
- MODE=x
- TEXT=”text”
- WORKDIR_LOCATION & WORKDIR_M3_DIRECTORY
- MYEXTRA
- MYBASE
- PQUERY_MOD & PQUERY_LOC
- MODE5_COUNTTEXT, MODE5_ADDITIONAL_TEXT & MODE5_ADDITIONAL_COUNTTEXT
- How to learn more about each of the settings
- Manual example
- Introduction to the script’s self-recursion concept – subreducer
- Quick setup re-cap, details of an already executed QA run
- Examples from pquery-prep-red.sh (including some issue reviews)
- Gotcha’s
- QUERYTIMEOUT & STAGE1_LINES Variables
Full-screen viewing @ 720p resolution recommended.
If the speed is too slow for you, consider setting YouTube to 1.25 playback speed.
For an earlier (long before the MySQL QA Series started) introduction of reducer.sh, you may also like to checkout https://www.percona.com/blog/2014/09/03/reducer-sh-a-powerful-mysql-test-case-simplificationreducer-tool/
The problems you may encounter using reducerXXX.sh after running pquery-prep_red.sh:
1. dependency issue:
[root@centos-base 362406]# ./reducer26.sh
./reducer26.sh: line 899: netstat: command not found
To solve run following:
yum install net-tools
2. ‘/dev/shm/’ free space issue:
[root@centos-base 362406]# ./reducer26.sh
Error: /dev/shm/ does not have enough free space (3.5Gb free space required)
You can increase size as following:
For eg, give 8G:
mount -o remount,size=8G /dev/shm
Also you should update ‘/etc/fstab’ for reflectiong after server reboots, so add following to ‘/etc/fstab’ file:
none /dev/shm tmpfs defaults,size=8G 0 0
@Shahriyar – Thanks! You’re writing a mini manual for reducer.sh 🙂 Btw,
[roel@localhost ~]$ cat /etc/fstab | grep tmpfs
tmpfs /dev/shm tmpfs size=16g,noatime,nodiratime 0 0
To avoid any dependency issues, you can copy/use the ‘sudo yum install’ command in percona-qa/setup_server.sh – though I would not recommend running this script straight-out/fully unless you have a Centos 6 or 7 box dedicated to QA!
I love finding BUGs, it is my life art 🙂 especially with MySQL.
I am doing all tedious things manually everyday. But you have created a tool for simplifying life of hunter. it is pleasure to play and find some interesting things with these tools. Thank you for a great job!
All, please note we have moved percona-qa to GitHub:
https://github.com/Percona-QA/percona-qa
To clone it, use:
$ sudo yum install git
$ cd ~
$ git clone https://github.com/Percona-QA/percona-qa.git
reducer.sh was also put directly into this repository (and it is maintained there), so *no* need anymore to separately fetch lp:randgen.