[MDEV-10326] Server crash under query Created: 2016-07-03  Updated: 2016-07-12  Resolved: 2016-07-08

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1.15
Fix Version/s: 10.1.16

Type: Bug Priority: Major
Reporter: Marco Banfi Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Environment:

vps with debian 8 64bit - fully updated, there are only mariadb and ssh server


Attachments: Zip Archive crash10.1.15.log.zip    
Issue Links:
Duplicate
is duplicated by MDEV-10324 Server crash in get_sel_arg_for_keypa... Closed

 Description   

updated to 10.1.15.
There is a wiki (software: mediawiki 1.26.2) db on it. The webserver is on another server.
Up to version 10.1.14, all is working fine.
After, there is a crash as soon you try to access any wiki page.
See the attached log-extract.



 Comments   
Comment by Elena Stepanova [ 2016-07-03 ]

Thanks for the report, we already have this bug filed as MDEV-10324.

Your query is more generic though, so it would be good to have your test case as well. Could you please paste the output of

SHOW CREATE TABLE `job`;
SHOW INDEX IN `job`;

Meanwhile, you might want to stick with 10.1.14. Sorry for the inconvenience.

Comment by Davis Mosenkovs [ 2016-07-03 ]

Hi, I have a similar issue - non-working MediaWiki due to MDEV-10324 (I have done mysqldump, removed the datafiles, reinstalled MariaDB server and imported the mysqldump, and this didn't help; MariaDB 10.1.14 is working properly).

Here is the output of these commands on my MediaWiki database:

CREATE TABLE `job` (
  `job_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `job_cmd` varbinary(60) NOT NULL DEFAULT '',
  `job_namespace` int(11) NOT NULL,
  `job_title` varbinary(255) NOT NULL,
  `job_params` blob NOT NULL,
  `job_timestamp` varbinary(14) DEFAULT NULL,
  `job_random` int(10) unsigned NOT NULL DEFAULT '0',
  `job_token` varbinary(32) NOT NULL DEFAULT '',
  `job_token_timestamp` varbinary(14) DEFAULT NULL,
  `job_sha1` varbinary(32) NOT NULL DEFAULT '',
  `job_attempts` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`job_id`),
  KEY `job_cmd` (`job_cmd`,`job_namespace`,`job_title`,`job_params`(128)),
  KEY `job_timestamp` (`job_timestamp`),
  KEY `job_sha1` (`job_sha1`),
  KEY `job_cmd_token` (`job_cmd`,`job_token`,`job_random`),
  KEY `job_cmd_token_id` (`job_cmd`,`job_token`,`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary

+-------+------------+------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name         | Seq_in_index | Column_name   | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| job   |          0 | PRIMARY          |            1 | job_id        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd          |            1 | job_cmd       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd          |            2 | job_namespace | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd          |            3 | job_title     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd          |            4 | job_params    | A         |           0 |      128 | NULL   |      | BTREE      |         |               |
| job   |          1 | job_timestamp    |            1 | job_timestamp | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
| job   |          1 | job_sha1         |            1 | job_sha1      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token    |            1 | job_cmd       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token    |            2 | job_token     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token    |            3 | job_random    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token_id |            1 | job_cmd       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token_id |            2 | job_token     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| job   |          1 | job_cmd_token_id |            3 | job_id        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------+------------+------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
13 rows in set (0.00 sec)

Comment by Elena Stepanova [ 2016-07-03 ]

DavisNT, thanks, I've added the test case to MDEV-10324.

Comment by Marco Banfi [ 2016-07-04 ]

Hi, Elena. the SHOW CREATE TABLE `job` seem the same as Davis, but here both the results, thanks:
CREATE TABLE `job` (
`job_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`job_cmd` varbinary(60) NOT NULL DEFAULT '',
`job_namespace` int(11) NOT NULL,
`job_title` varbinary(255) NOT NULL,
`job_params` blob NOT NULL,
`job_timestamp` varbinary(14) DEFAULT NULL,
`job_random` int(10) unsigned NOT NULL DEFAULT '0',
`job_token` varbinary(32) NOT NULL DEFAULT '',
`job_token_timestamp` varbinary(14) DEFAULT NULL,
`job_sha1` varbinary(32) NOT NULL DEFAULT '',
`job_attempts` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`job_id`),
KEY `job_cmd` (`job_cmd`,`job_namespace`,`job_title`,`job_params`(128)),
KEY `job_timestamp` (`job_timestamp`),
KEY `job_sha1` (`job_sha1`),
KEY `job_cmd_token` (`job_cmd`,`job_token`,`job_random`),
KEY `job_cmd_token_id` (`job_cmd`,`job_token`,`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary

Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
job 0 PRIMARY 1 job_id A 0       BTREE    
job 1 job_cmd 1 job_cmd A 0       BTREE    
job 1 job_cmd 2 job_namespace A 0       BTREE    
job 1 job_cmd 3 job_title A 0       BTREE    
job 1 job_cmd 4 job_params A 0 128     BTREE    
job 1 job_timestamp 1 job_timestamp A 0     YES BTREE    
job 1 job_sha1 1 job_sha1 A 0       BTREE    
job 1 job_cmd_token 1 job_cmd A 0       BTREE    
job 1 job_cmd_token 2 job_token A 0       BTREE    
job 1 job_cmd_token 3 job_random A 0       BTREE    
job 1 job_cmd_token_id 1 job_cmd A 0       BTREE    
job 1 job_cmd_token_id 2 job_token A 0       BTREE    
job 1 job_cmd_token_id 3 job_id A 0       BTREE    
Comment by Elena Stepanova [ 2016-07-08 ]

Fixed in scope of MDEV-10324.

Comment by jack cowlick [ 2016-07-11 ]

Same issue. I just upgraded to 10.1.15. Every page load of MediaWiki crashes MariaDB.

Where can I get the fixed version 10.1.16?????

Comment by Marco Banfi [ 2016-07-11 ]

It isn't published yet, how did you upgrade? :-? 10.1.15 isn't available anymore since last monday (circa).
BTW: I'd suggest either to downgrade to 10.1.14 or to set the $wgReadOnly to something different from "''" in LocalSettings.php, until the 10.1.16 is released (if it's viable for you, no one can update the wiki while the flag ).

Comment by jack cowlick [ 2016-07-11 ]

Would love to downgrade, but have been searching for hours for a HOWTO and cant find a good one.

Trying to get yum to point to an old version has been very problematic. Tried changing what the repo points to but it ignores it because its old than whats installed already.

Can I just do an RPM remove, and then install the 10.1.14 RPM? I usually use yum for everything, but it seems like a poor choice for downgrading for multiple reasons.

I need a sure fire way to downgrade without trashing my prod server.


To answer your question:
I upgraded by shutting everything down. yum installing the new version. Firing it back up and running mysql_upgrade.

Comment by Marco Banfi [ 2016-07-11 ]

Uhm, under debian is quite silly (if there are no changes to some system tables).

Forgive me, I supposed the 10.1.14 was pulled away from the repos for every distribution.

I see that yum has a downgrade command from a Red Hat FAQ),
There is also a "--showduplicates" switch in the yum list command, to recover the available versions).

If it doesn't work, I suppose you can do it by uninstalling & reinstalling:

Good luck, I'd stop here, as we are a lot Off Topic.

Comment by jack cowlick [ 2016-07-11 ]

Im on CentOS.

--showduplicates only shows 1 version. Cant downgrade with yum.
I think the MariaDB repository only keeps the latest stable version?

I will attempt an uninstall and then RPM install instead of using yum tonight.

Comment by Davis Mosenkovs [ 2016-07-11 ]

sg: I suppose you want to do something like:

service stop mysql

Back up datafiles (AFAIK /var/lib/mysql by default)

yum remove MariaDB-server
yum clean all
yum install MariaDB-server
service mysql start
chkconfig mysql on

P.S. I have NOT tested these commands (I am not responsible if anything goes wrong etc.), so take extra care!

Comment by Elena Stepanova [ 2016-07-12 ]

sg,

The question still remains though – could you please clarify where your yum repo points at?
10.1.15 is expected to have been pulled from the mirrors, and as much as I can see, it has been indeed; e.g. here, if you use CentOS:
http://yum.mariadb.org/10.1/centos7-amd64
it has 10.1.14 packages.

If 10.1.15 packages still get loaded from somewhere, we need to know.

Regarding your question, actually MariaDB repos keep several last versions, e.g. for CentOS 7 previous repos would be
http://yum.mariadb.org/10.1.14/centos7-amd64/
http://yum.mariadb.org/10.1.13/centos7-amd64/
...

But this time, it should not be needed, because the main repo 10.1 also contains 10.1.14.

Comment by jack cowlick [ 2016-07-12 ]

Here is my original repo entry when I installed:

vim MariaDB.repo

  1. MariaDB 10.1 CentOS repository list - created 2014-11-10 18:31 UTC
  2. http://mariadb.org/mariadb/repositories/
    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.1/centos6-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1

Here is what yum shows if I ask for all versions:

yum --showduplicates list mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.linode.com
  • epel: reflector.westga.edu
  • extras: mirrors.linode.com
  • rpmforge: mirror.teklinks.com
  • updates: mirrors.linode.com
    Installed Packages
    MariaDB-server.x86_64 10.1.15-1.el6 @mariadb
    Available Packages
    MariaDB-server.x86_64 10.1.15-1.el6 mariadb
Comment by jack cowlick [ 2016-07-12 ]

If im reading this right, with my current config, it will just install the .15 version again.

How do I fix that?

Comment by Elena Stepanova [ 2016-07-12 ]

That's really weird.
Did you do yum clean all?

If it does not help, please try the repo
http://yum.mariadb.org/10.1.14/centos6-amd64/

(everything is the same, you just add ".14" to the link).

Comment by jack cowlick [ 2016-07-12 ]

yum clean all - worked.

10.1.14-1.el6 is listed as the available package now. Thnx!

Comment by jack cowlick [ 2016-07-12 ]

QUICK UPDATE.

Upgrade went flawlessly.... errrr downgrade.
MediaWiki running perfectly with no crashes now on version 10.1.14

Did a mysqldump
shut down mariadb
Took a copy of the mysql directory
Did a YUM REMOVE
YUM INSTALL
mysql start

Worked first shot. Yay!

Comment by Elena Stepanova [ 2016-07-12 ]

sg,
Thanks for the update, good to know it works all right again. Very sorry for all the trouble.

Generated at Thu Feb 08 07:41:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.