Comments on: The future of MySQL quality assurance: Introducing pquery https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/ Thu, 11 May 2023 15:31:02 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10967384 Mon, 21 Nov 2016 22:40:55 +0000 https://www.percona.com/blog/?p=26574#comment-10967384 And the pquery Github link (though it’s probably best to use the framework) is here; https://github.com/Percona-QA/pquery/

]]>
By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10967383 Mon, 21 Nov 2016 22:39:47 +0000 https://www.percona.com/blog/?p=26574#comment-10967383 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.

]]>
By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10736944 Wed, 15 Apr 2015 21:43:15 +0000 https://www.percona.com/blog/?p=26574#comment-10736944 Static binaries now available! See https://www.percona.com/blog/2015/04/09/pquery-binaries-with-statically-included-client-libs-now-available/

]]>
By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10654467 Thu, 19 Mar 2015 18:23:33 +0000 https://www.percona.com/blog/?p=26574#comment-10654467 Followup article: https://www.percona.com/blog/2015/03/17/free-mysql-qa-and-bash-linux-training-series/

]]>
By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10519370 Wed, 11 Feb 2015 20:18:51 +0000 https://www.percona.com/blog/?p=26574#comment-10519370 @Shivam – Great you got it working! The 80 coredumps per hour? These are many different issues. Offcourse there are duplicates, and it looks like you are hitting a particularly nasty one, but in general you should see a spread. As a good example, see the ~/percona-qa/pquery-results.sh run above, taken after about 2 hours of running; 20 different issues with a bunch of duplicates thereof. The duplicates are handy in a way, as they produce[d] different testcases for the same assertion/crash.

Back to the segfault you keep hitting again and again. Those are ones that we call “qa blockers” – and we tag them on our launchpad with “qablock”. There are several things that you can do with these; 1) ask developers to fix them (or hire Percona to do it for you), or 2) workaround the issue by disabling the particular sql needed to trigger this bug in the sql file you use. This is quite easy to do. Firstly, you need to find out what queries are triggering your issue. Two actions; a) check one of the produced error logs near the end for the “Query: …” statement and b) use gdb to extract all queries that where running at the time of the assertion/crash (we already have scripts for this… see extract_query.gdb and this (including last comment – the variable name changed). Finally, remove or remark these queries in the sql file (and log a bug for the issue seen so it will get fixed in time).

But, for many of these sort of things “we’ve been there, and done that” and all this is already highly automated in percona-qa (except manually disabling qablock sql in the sql files, this is easy/quick to do). Here’s how I suggest going about things; 1) use pquery-run.sh (it uses /dev/shm for nice fast processing), 2) go to the workdir produced by it (as set by you in the $WORKDIR variable in pquery-run.sh) and run ~/percona-qa/pquery-prep-red.sh – this will produce nice testcase reducer scripts ready-to-run … it will auto-extract the query from the error log *and* from the coredump and add these to the end of the pquery sql trace (in the numbered subdirectories) – btw, you could get the to-remark queries from here if that makes sense. 3) Step 3 is optional depending on what you are running: If you are using Percona Server or upstream MySQL, simply run ~/percona-qa/pquery-clean-known.sh. 4) Run ~/percona-qa/pquery-results.sh – see the example in the main text above – based on unique bug text strings, it will ‘classify’ each issue and give you a nice output as to the newly found issues. Don’t be suprised to see only a handful if you are using Percona Server or upstream MySQL and have run the cleaner script pquery-clean-known.sh, as we have logged literally hundreds of bugs over the last months already. Yet, you’re running dual-threaded so you may see new fireworks :). 5) Run the individual reducer scripts. These will reduce your testcase from 30k+ lines to a few hundred, to <5-25, often within the space of an hour/a few hours. Reducer is a powerfull tool. Yet, as you are running two threads, a bit more work may be needed. See how you go (and let us know!). Also, you may like to checkout ~/percona-qa/reproducing_and_simplification.txt which has lots of goodies on how to get testcases to "work" in the first place. Our reproducibility is very high, ~100%, with the occasional "looser" here or there, but in those cases we still have the coredump/stacks from the original trial run and so it's sometimes easy for devs to do a code analysis and find/fix the bug that way.

I hope this answers the questions you had. Looks like a blog post on pquery and it's framework's use would be a good idea too. In short; it is all there already, ready to use. If you have some cool updates, feel free to contribute too. Anyone is free to push to the tree, but please 1) test your changes, 2) be prepared to have changes revoked in case it breaks our integration etc. 🙂

Enjoy!

]]>
By: Shivam https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10512410 Tue, 10 Feb 2015 16:37:38 +0000 https://www.percona.com/blog/?p=26574#comment-10512410 Thanks for the help. It worked.

I am creating a wrapper script like pquery-run.sh. Can you elaborate on how to identify *different* bugs/segmentation faults by using pquery with same main.sql file?

So far I have been able to hit the same segmentation fault again and again with following command:
./pquery-ms –infile=./main.sql –database=test –threads=2 –queries_per_thread=10000 –log_all_queries –log_failed_queries –user=root –port=3306 –addr=127.0.0.1

I am unclear about your statement: “80+ coredumps per hour”. Aren’t they for the same issue?

]]>
By: Roel Van de Paar https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10509640 Tue, 10 Feb 2015 02:42:01 +0000 https://www.percona.com/blog/?p=26574#comment-10509640 @Mark Cool! Re: concurrency – no, not atm. Interesting idea/question. As an alternative, running pquery –threads=x (where x>1 and likely best >100) would likely exhaustively random-cover any concurrency-related triggers if the test runs long enough. Even an hour per trial in this case seems plenty (and you will have likely hit many assertions before the hour is over). Alternatively or additionally, you could further limit the SQL to just the “interesting parts” so that all areas that ought to be covered definitely are. Multi-threaded testcase reduction is possible, but not straightforward, –threads=1 cases (and there are plenty) are easier to reduce. See pquery-prep-red.sh, then pquery-clean-known.sh and finally pquery-results.sh, then execute reducer{trialnr}.sh, as generated by pquery-prep.sh (and assuming all the time that pquery-run.sh was used to do the original run with x trials). Also, past experience shows that many (maybe as high as 85-90%) of multi-threaded (i.e. –threads=x) testcases are (or in some limited cases “can be made to be”) single-thread (i.e. client side – mysqld always having it’s background threads) reproducible.

@Shivam – easy fix; $ export LD_LIBRARY_PATH=${BASEDIR}/lib where ${BASEDIR} is your mysqld’s basedir (or your specific location). Depending on whether your are testing upstream mysqld or Percona Server, you would want to swap between using the pquery (Percona) or pquery-ms (MySQL) binary. Alternatively, see compile information in pquery subdirectory to self-compile pquery, potentially with libs included! As a side note, I may recommend using export LD_PRELOAD=/usr/lib64/libjemalloc.so.1 to use jemalloc (depending on what flavor of mysqld you are testing). Also, you may want to use pquery-run.sh instead – this wrapper script around pquery allows automated pquery runs with all bells and whisles included ($ cd ~; bzr branch lp:percona-qa; vi ~/percona-qa/pquery-run.sh). See reply to Mark above on further steps after pquery-run.sh. In pquery-run.sh you need to set some settings like basedir, pquery or pquery-ms binary etc. See in-script for details.

]]>
By: Shivam https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10507501 Mon, 09 Feb 2015 11:20:17 +0000 https://www.percona.com/blog/?p=26574#comment-10507501 I am getting following error:
/usr/lib64/libperconaserverclient.so.18: version `libperconaserverclient_18′ not found (required by /home/ec2-user/percona-qa/pquery/pquery)

I am trying to run:

${PQUERY_BIN} –infile=${RUNDIR}/${TRIAL}/${TRIAL}.sql –database=test –threads=${THREADS} –queries_per_thread=${QUERIES_PER_THREAD} –logdir=${RUNDIR}/${TRIAL} –log_all_queries –log_failed_queries –user=root –addr=some_ip –port=3306 >${RUNDIR}/${TRIAL}/pquery.log 2>&1 &

(libperconaserverclient.so.18 and libmysqlclient.so are present in /usr/lib64)

]]>
By: Mark Callaghan https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10495500 Fri, 06 Feb 2015 10:46:08 +0000 https://www.percona.com/blog/?p=26574#comment-10495500 I look forward to using this for the RocksDB engine for MySQL. When extracting SQL from mtr is anything done to preserve concurrency specified in the mtr tests?

]]>
By: Phil Stracchino https://www.percona.com/blog/future-mysql-quality-assurance-introducing-pquery/#comment-10489440 Wed, 04 Feb 2015 12:57:00 +0000 https://www.percona.com/blog/?p=26574#comment-10489440 You know one fun MySQL crash I saw once? It was remarkably (if brain-damagedly) simple: A field definition declared NOT NULL DEFAULT NULL, in MySQL 5.6.

…Yes, I know, the originator of this definition was seriously unclear on the concept of NOT NULL. But it shouldn’t have crashed MySQL.

]]>