[MDEV-22119] main.innodb_ext_key fails sporadically Created: 2020-04-02  Updated: 2020-06-16  Resolved: 2020-06-12

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Tests
Affects Version/s: 10.5
Fix Version/s: 10.5.4

Type: Bug Priority: Major
Reporter: Otto Kekäläinen Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20169 main.partition_innodb fails in buildb... Closed

 Description   

In https://buildbot.mariadb.org/#/builders/27/builds/4241 (ubuntu-1604) I noted:

main.innodb_ext_key 'innodb'             w4 [ fail ]
        Test ended at 2020-04-01 20:19:02
 
CURRENT_TEST: main.innodb_ext_key
--- /buildbot/ubuntu-1604/build/mysql-test/main/innodb_ext_key.result	2020-04-01 19:39:45.000000000 +0000
+++ /buildbot/ubuntu-1604/build/mysql-test/main/innodb_ext_key.reject	2020-04-01 20:19:02.155337769 +0000
@@ -1014,7 +1014,7 @@
 ORDER BY rev_timestamp ASC LIMIT 10;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	const	PRIMARY,name_title	name_title	261	const,const	1	
-1	SIMPLE	t2	ref	page_timestamp	page_timestamp	4	const	10	Using where
+1	SIMPLE	t2	ALL	page_timestamp	NULL	NULL	NULL	45	Using where; Using filesort
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.rev_text_id	1	
 set optimizer_switch='extended_keys=on';
 EXPLAIN 
@@ -1023,7 +1023,7 @@
 ORDER BY rev_timestamp ASC LIMIT 10;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	const	PRIMARY,name_title	name_title	261	const,const	1	
-1	SIMPLE	t2	ref	page_timestamp	page_timestamp	4	const	10	Using where
+1	SIMPLE	t2	ALL	page_timestamp	NULL	NULL	NULL	45	Using where; Using filesort
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.rev_text_id	1	
 DROP TABLE t1,t2,t3;
 #

I have not seen this before, I suspect it is a recent regression on the 10.5 branch.



 Comments   
Comment by Marko Mäkelä [ 2020-04-02 ]

otto, I noted a failure elsewhere in main.innodb_ext_key in MDEV-20169 (which is about main.partition_innodb failures, while this test does not use partitioning). The MDEV-20169 problem does not look like a new regression in 10.5, but its probability has significantly increased on 10.5.

In the buildbot.askmonty.org cross-reference, I was unable to find anything similar to exactly that type of failure. I only saw a couple 10.5 failures that look similar to the one I linked in MDEV-20169.

That said, this failure could still share a root cause with MDEV-20169.

Comment by Otto Kekäläinen [ 2020-04-23 ]

Temporarily disabled in https://github.com/MariaDB/server/commit/6f0b621caf76cf636771cab2e78b6e1846b31c78 - we can't have this keeping the CI red permanently, that halts all other quality assurance / testing work. Please fix and re-enable when you have a chance.

Comment by Varun Gupta (Inactive) [ 2020-05-29 ]

On my first phase of investigation I could not reproduce this failure on the current 10.5 and also on the commit which disabled this test.

Comment by Otto Kekäläinen [ 2020-05-30 ]

vladbogo Can you help and provide instructions on how to reproduce the build https://buildbot.mariadb.org/#/builders/27/builds/4241 ? Since the CI systems is consistently (or at least was) producing this error, and the CI environment is a fully standardized and codified environment, reproducing this error should be trivial.

Comment by Vlad Bogolin [ 2020-06-04 ]

otto The dockerfile that sets up the environment can be found here https://github.com/MariaDB/mariadb.org-tools/blob/master/buildbot.mariadb.org/dockerfiles/ubuntu-1604.dockerfile. The steps to reproduce would be: 1) build the image associated with the docker file (e.g. docker build -t ubuntu-1604 --file ubuntu-1604.dockerfile .); 2) then start a container (e.g. docker run --user root -it ubuntu-1604 bash). 3) Finally, just fetch the tarball that the builder fetches (see the "fetch_tarball" step). Unfortunately, only one month of history is kept due to space limitations so anything older than that I assume can only be reproduced by reverting git.

Comment by Varun Gupta (Inactive) [ 2020-06-11 ]

Well i checked today on buildbot
https://buildbot.mariadb.org/#/builders/27/builds/5587/steps/8/logs/stdio
and the test main.innodb_ext_key passes there, so looks like it does not fail reliably.

So i saw the cost of the plan in the optimizer_trace for table t2

              {
                "table": "t2",
                "range_analysis": {
                  "table_scan": {
                    "rows": 48,
                    "cost": 12.6
                  },

"analyzing_range_alternatives": {
                    "range_scan_alternatives": [
                      {
                        "index": "page_timestamp",
                        "ranges": ["(38928081) <= (rev_page) <= (38928081)"],
                        "rowid_ordered": false,
                        "using_mrr": false,
                        "index_only": false,
                        "rows": 10,
                        "cost": 12.14841776,
                        "chosen": true
                      }
                    ],

So the cost are 12.145 and 12.6 which is very close and due to the statistics from INNODB we may be getting different plans, so increasing the rows would be the best option here.

After increasing the rows in table t2 (the ones that would not satify the range), I get

 "table": "t2",
                "range_analysis": {
                  "table_scan": {
                    "rows": 56,
                    "cost": 14.2
                  },

and

                  "analyzing_range_alternatives": {
                    "range_scan_alternatives": [
                      {
                        "index": "page_timestamp",
                        "ranges": ["(38928081) <= (rev_page) <= (38928081)"],
                        "rowid_ordered": false,
                        "using_mrr": false,
                        "index_only": false,
                        "rows": 10,
                        "cost": 12.14841776,
                        "chosen": true
                      }
                    ],

Comment by Varun Gupta (Inactive) [ 2020-06-11 ]

Patch
https://github.com/MariaDB/server/commit/1f43c18735c809e9108bb48d61841c4419510134

Comment by Sergei Petrunia [ 2020-06-11 ]

Btw, the test is currently not listed in mysql-test/unstable-tests. Not sure what has removed Otto's commit (a merge?)

Comment by Sergei Petrunia [ 2020-06-11 ]

Ok to push.

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