[MDEV-26929] Make the main testsuite runnable with optimizer trace enabled Created: 2021-10-28  Updated: 2021-11-09  Resolved: 2021-11-09

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 10.4.23

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-23766 Optimizer tracing code is prone to pr... Closed

 Description   

This is a part of MDEV-23766.

One can run the entire main testuite with optimizer trace enabled like so:

 ./mysql-test-run --suite=main --mysqld=--optimizer_trace=enabled=on

On a 10.5-based tree, it fails just one test for me:

CURRENT_TEST: main.opt_trace
--- /optane/dev-git2/10.5-opt-trace-fix/mysql-test/main/opt_trace.result        2021-10-22 17:44:19.947288399 +0300
+++ /optane/dev-git2/10.5-opt-trace-fix/mysql-test/main/opt_trace.reject        2021-10-22 18:05:12.727056238 +0300
@@ -6,7 +6,7 @@
 OPTIMIZER_TRACE        INSUFFICIENT_PRIVILEGES
 show variables like 'optimizer_trace';
 Variable_name  Value
-optimizer_trace        enabled=off
+optimizer_trace        enabled=on
 set optimizer_trace="enabled=on";
 show variables like 'optimizer_trace';
 Variable_name  Value
 
mysqltest: Result length mismatch

If we can get that test to pass, we can get the buildbot to run this.

We can run non-main testsuites as well, but this is considered to have less benefit.



 Comments   
Comment by Sergei Petrunia [ 2021-10-28 ]

idea #1:

move the failing check (the check for the default @@optimizer_trace value) into a separate test, e.g. main/opt_trace_default.test
and then run

./mysql-test-run   --mysqld=--optimizer_trace=enabled=on  --skip-test=main.opt_trace_default

idea #2:
put the following code in main/opt_trace.test

if ( SOME_VARIABLE_THAT_HAS_MYSQLD_ARGS  includes '--mysqld=--optimizer_trace) {
  skip "This test cannot be run when one specifies optimizer_trace setting from command line
}

I'm not sure how to express this condition

Comment by Sergei Krivonos (Inactive) [ 2021-10-28 ]

psergei,
10.2 has no this test, so fixed for 10.5 https://buildbot.mariadb.org/#/grid?branch=bb-10.5-MDEV-26929

Comment by Sergei Krivonos (Inactive) [ 2021-10-28 ]

The test exists starting from 10.4 https://buildbot.mariadb.org/#/grid?branch=bb-10.4-MDEV-26929

Comment by Sergei Petrunia [ 2021-10-29 ]

Yes, indeed, optimizer trace was added in 10.4. My mistake.

Comment by Sergei Petrunia [ 2021-10-29 ]

The patch that was pushed removes test coverage for compile-time optimizer_trace default.

Comment by Sergei Petrunia [ 2021-10-29 ]

https://github.com/MariaDB/server/commit/d352bc5b6772f735a7e4bc540f578e0efc280e71

Comment by Sergei Krivonos (Inactive) [ 2021-10-29 ]

psergei,
The part2 looks ok. Works starting from 10.4.
So we shouldn't push it to 10.2 as well because it shows warning treated as error (the option not yet supported).

Comment by Sergei Krivonos (Inactive) [ 2021-10-29 ]

Hi elenst,
Feel free to add

--mysqld=--optimizer_trace=enabled=on

to buildbot

Comment by Sergei Krivonos (Inactive) [ 2021-10-29 ]

psergei, the part2 looks ready for 10.4 to me.

Comment by Sergei Petrunia [ 2021-10-30 ]

Pushed this into 10.4:

commit d352bc5b6772f735a7e4bc540f578e0efc280e71 (HEAD -> 10.4, origin/bb-10.4-mdev26929-part2, origin/10.4, bb-10.4-mdev26929-part2)
Author: Sergei Petrunia <psergey@askmonty.org>
Date:   Fri Oct 29 11:44:09 2021 +0300
 
    MDEV-26929: Make the main testsuite runnable with optimizer trace enabled
    
    Part#2: check that compile-time default @@optimizer_trace is correct.

Comment by Sergei Petrunia [ 2021-11-01 ]

Keeping this open until it is merged into all versions. Then, we can ask Elena to enable the optimizer-trace-enabled run in the buildbot.

Comment by Sergei Petrunia [ 2021-11-09 ]

I see that now the commit d352bc5b6772f735a7e4bc540f578e0efc280e71 has been merged to all versions.

Generated at Thu Feb 08 09:49:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.