Deadlocks appeared after moving to MariaDB10.2 from MySQL5.5
After moving to mariadb-server-10.2 from mysql5.5 I am facing deadlock issues. Please see the output of 'show full processlist'. Can someone give some suggestion?
| 162506 | catalog | mymagentositexxxxxx.com:34163 | catalog | Query | 1016 | update | INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `is_qty_decimal`, `weight`, `qty`, `product_type`, `base_cost`) VALUES ('6252710', '2017-09-08 07:38:14', '2017-09-08 07:38:14', '26601', '1', '1', 'c08236dbaf', 'Informaatika 8.c 2017/2018', '0', NULL, '1', 'virtual', NULL) | 0.000 |
| 162679 | catalog | mymagentositexxxxxx.com:34380 | catalog | Query | 1018 | Waiting for table level lock | DELETE FROM `catalogsearch_fulltext` WHERE (store_id=1) AND (product_id IN ('26601')) | 0.000 |
| 162701 | catalog | mymagentositexxxxxx.com:34410 | catalog | Query | 1021 | Sending data | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162742 | catalog | mymagentositexxxxxx.com:34456 | catalog | Query | 1014 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162892 | catalog | mymagentositexxxxxx.com:34628 | catalog | Query | 976 | update | INSERT INTO `report_viewed_product_index` (`visitor_id`,`customer_id`,`product_id`,`store_id`,`added_at`) VALUES ('8391969', NULL, '26601', '1', '2017-09-08 07:38:54') ON DUPLICATE KEY UPDATE visitor_id = VALUES(`visitor_id`), customer_id = VALUES(`customer_id`), product_id = VALUES(`product_id`), store_id = VALUES(`store_id`), added_at = VALUES(`added_at`) | 0.000 |
| 163286 | catalog | mymagentositexxxxxx.com:35318 | catalog | Query | 895 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163303 | catalog | mymagentositexxxxxx.com:35337 | catalog | Query | 891 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163783 | catalog | mymagentositexxxxxx.com:35890 | catalog | Query | 811 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163825 | catalog | mymagentositexxxxxx.com:35952 | catalog | Query | 804 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 164314 | catalog | mymagentositexxxxxx.com:36583 | catalog | Query | 721 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 165111 | catalog | mymagentositexxxxxx.com:37633 | catalog | Sleep | 557 | | NULL | 0.000 |
The full output of 'show processlist' command is at here.
catalog_sarch_fulltext uses MyISAM engine and all other tables using InnoDB engine. The creation SQL of table's are as below.
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_fulltext;
+------------------------+------------------------------------------------------
| catalogsearch_fulltext | CREATE TABLE `catalogsearch_fulltext` (
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
`data_index` longtext DEFAULT NULL COMMENT 'Data index',
`fulltext_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
PRIMARY KEY (`fulltext_id`),
UNIQUE KEY `UNQ_CATALOGSEARCH_FULLTEXT_PRODUCT_ID_STORE_ID` (`product_id`,`store_id`),
FULLTEXT KEY `FTI_CATALOGSEARCH_FULLTEXT_DATA_INDEX` (`data_index`)
) ENGINE=MyISAM AUTO_INCREMENT=912741 DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
+------------------------+------------------------------------------------------
1 row in set (0.00 sec)
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_result;
| Table | Create Table |
| catalogsearch_result | CREATE TABLE `catalogsearch_result` (
`query_id` int(10) unsigned NOT NULL COMMENT 'Query ID',
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`relevance` decimal(20,4) NOT NULL DEFAULT 0.0000 COMMENT 'Relevance',
PRIMARY KEY (`query_id`,`product_id`),
KEY `IDX_CATALOGSEARCH_RESULT_QUERY_ID` (`query_id`),
KEY `IDX_CATALOGSEARCH_RESULT_PRODUCT_ID` (`product_id`),
CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY_ID_CATALOGSEARCH_QUERY_QUERY_ID` FOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATSRCH_RESULT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
1 row in set (0.00 sec)
Does setting some timeout values remove the deadlocks? Please suggest.
-Thanks
mariadb deadlock mariadb-10.1
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
After moving to mariadb-server-10.2 from mysql5.5 I am facing deadlock issues. Please see the output of 'show full processlist'. Can someone give some suggestion?
| 162506 | catalog | mymagentositexxxxxx.com:34163 | catalog | Query | 1016 | update | INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `is_qty_decimal`, `weight`, `qty`, `product_type`, `base_cost`) VALUES ('6252710', '2017-09-08 07:38:14', '2017-09-08 07:38:14', '26601', '1', '1', 'c08236dbaf', 'Informaatika 8.c 2017/2018', '0', NULL, '1', 'virtual', NULL) | 0.000 |
| 162679 | catalog | mymagentositexxxxxx.com:34380 | catalog | Query | 1018 | Waiting for table level lock | DELETE FROM `catalogsearch_fulltext` WHERE (store_id=1) AND (product_id IN ('26601')) | 0.000 |
| 162701 | catalog | mymagentositexxxxxx.com:34410 | catalog | Query | 1021 | Sending data | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162742 | catalog | mymagentositexxxxxx.com:34456 | catalog | Query | 1014 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162892 | catalog | mymagentositexxxxxx.com:34628 | catalog | Query | 976 | update | INSERT INTO `report_viewed_product_index` (`visitor_id`,`customer_id`,`product_id`,`store_id`,`added_at`) VALUES ('8391969', NULL, '26601', '1', '2017-09-08 07:38:54') ON DUPLICATE KEY UPDATE visitor_id = VALUES(`visitor_id`), customer_id = VALUES(`customer_id`), product_id = VALUES(`product_id`), store_id = VALUES(`store_id`), added_at = VALUES(`added_at`) | 0.000 |
| 163286 | catalog | mymagentositexxxxxx.com:35318 | catalog | Query | 895 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163303 | catalog | mymagentositexxxxxx.com:35337 | catalog | Query | 891 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163783 | catalog | mymagentositexxxxxx.com:35890 | catalog | Query | 811 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163825 | catalog | mymagentositexxxxxx.com:35952 | catalog | Query | 804 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 164314 | catalog | mymagentositexxxxxx.com:36583 | catalog | Query | 721 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 165111 | catalog | mymagentositexxxxxx.com:37633 | catalog | Sleep | 557 | | NULL | 0.000 |
The full output of 'show processlist' command is at here.
catalog_sarch_fulltext uses MyISAM engine and all other tables using InnoDB engine. The creation SQL of table's are as below.
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_fulltext;
+------------------------+------------------------------------------------------
| catalogsearch_fulltext | CREATE TABLE `catalogsearch_fulltext` (
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
`data_index` longtext DEFAULT NULL COMMENT 'Data index',
`fulltext_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
PRIMARY KEY (`fulltext_id`),
UNIQUE KEY `UNQ_CATALOGSEARCH_FULLTEXT_PRODUCT_ID_STORE_ID` (`product_id`,`store_id`),
FULLTEXT KEY `FTI_CATALOGSEARCH_FULLTEXT_DATA_INDEX` (`data_index`)
) ENGINE=MyISAM AUTO_INCREMENT=912741 DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
+------------------------+------------------------------------------------------
1 row in set (0.00 sec)
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_result;
| Table | Create Table |
| catalogsearch_result | CREATE TABLE `catalogsearch_result` (
`query_id` int(10) unsigned NOT NULL COMMENT 'Query ID',
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`relevance` decimal(20,4) NOT NULL DEFAULT 0.0000 COMMENT 'Relevance',
PRIMARY KEY (`query_id`,`product_id`),
KEY `IDX_CATALOGSEARCH_RESULT_QUERY_ID` (`query_id`),
KEY `IDX_CATALOGSEARCH_RESULT_PRODUCT_ID` (`product_id`),
CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY_ID_CATALOGSEARCH_QUERY_QUERY_ID` FOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATSRCH_RESULT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
1 row in set (0.00 sec)
Does setting some timeout values remove the deadlocks? Please suggest.
-Thanks
mariadb deadlock mariadb-10.1
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15
add a comment |
After moving to mariadb-server-10.2 from mysql5.5 I am facing deadlock issues. Please see the output of 'show full processlist'. Can someone give some suggestion?
| 162506 | catalog | mymagentositexxxxxx.com:34163 | catalog | Query | 1016 | update | INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `is_qty_decimal`, `weight`, `qty`, `product_type`, `base_cost`) VALUES ('6252710', '2017-09-08 07:38:14', '2017-09-08 07:38:14', '26601', '1', '1', 'c08236dbaf', 'Informaatika 8.c 2017/2018', '0', NULL, '1', 'virtual', NULL) | 0.000 |
| 162679 | catalog | mymagentositexxxxxx.com:34380 | catalog | Query | 1018 | Waiting for table level lock | DELETE FROM `catalogsearch_fulltext` WHERE (store_id=1) AND (product_id IN ('26601')) | 0.000 |
| 162701 | catalog | mymagentositexxxxxx.com:34410 | catalog | Query | 1021 | Sending data | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162742 | catalog | mymagentositexxxxxx.com:34456 | catalog | Query | 1014 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162892 | catalog | mymagentositexxxxxx.com:34628 | catalog | Query | 976 | update | INSERT INTO `report_viewed_product_index` (`visitor_id`,`customer_id`,`product_id`,`store_id`,`added_at`) VALUES ('8391969', NULL, '26601', '1', '2017-09-08 07:38:54') ON DUPLICATE KEY UPDATE visitor_id = VALUES(`visitor_id`), customer_id = VALUES(`customer_id`), product_id = VALUES(`product_id`), store_id = VALUES(`store_id`), added_at = VALUES(`added_at`) | 0.000 |
| 163286 | catalog | mymagentositexxxxxx.com:35318 | catalog | Query | 895 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163303 | catalog | mymagentositexxxxxx.com:35337 | catalog | Query | 891 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163783 | catalog | mymagentositexxxxxx.com:35890 | catalog | Query | 811 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163825 | catalog | mymagentositexxxxxx.com:35952 | catalog | Query | 804 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 164314 | catalog | mymagentositexxxxxx.com:36583 | catalog | Query | 721 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 165111 | catalog | mymagentositexxxxxx.com:37633 | catalog | Sleep | 557 | | NULL | 0.000 |
The full output of 'show processlist' command is at here.
catalog_sarch_fulltext uses MyISAM engine and all other tables using InnoDB engine. The creation SQL of table's are as below.
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_fulltext;
+------------------------+------------------------------------------------------
| catalogsearch_fulltext | CREATE TABLE `catalogsearch_fulltext` (
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
`data_index` longtext DEFAULT NULL COMMENT 'Data index',
`fulltext_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
PRIMARY KEY (`fulltext_id`),
UNIQUE KEY `UNQ_CATALOGSEARCH_FULLTEXT_PRODUCT_ID_STORE_ID` (`product_id`,`store_id`),
FULLTEXT KEY `FTI_CATALOGSEARCH_FULLTEXT_DATA_INDEX` (`data_index`)
) ENGINE=MyISAM AUTO_INCREMENT=912741 DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
+------------------------+------------------------------------------------------
1 row in set (0.00 sec)
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_result;
| Table | Create Table |
| catalogsearch_result | CREATE TABLE `catalogsearch_result` (
`query_id` int(10) unsigned NOT NULL COMMENT 'Query ID',
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`relevance` decimal(20,4) NOT NULL DEFAULT 0.0000 COMMENT 'Relevance',
PRIMARY KEY (`query_id`,`product_id`),
KEY `IDX_CATALOGSEARCH_RESULT_QUERY_ID` (`query_id`),
KEY `IDX_CATALOGSEARCH_RESULT_PRODUCT_ID` (`product_id`),
CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY_ID_CATALOGSEARCH_QUERY_QUERY_ID` FOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATSRCH_RESULT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
1 row in set (0.00 sec)
Does setting some timeout values remove the deadlocks? Please suggest.
-Thanks
mariadb deadlock mariadb-10.1
After moving to mariadb-server-10.2 from mysql5.5 I am facing deadlock issues. Please see the output of 'show full processlist'. Can someone give some suggestion?
| 162506 | catalog | mymagentositexxxxxx.com:34163 | catalog | Query | 1016 | update | INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `is_qty_decimal`, `weight`, `qty`, `product_type`, `base_cost`) VALUES ('6252710', '2017-09-08 07:38:14', '2017-09-08 07:38:14', '26601', '1', '1', 'c08236dbaf', 'Informaatika 8.c 2017/2018', '0', NULL, '1', 'virtual', NULL) | 0.000 |
| 162679 | catalog | mymagentositexxxxxx.com:34380 | catalog | Query | 1018 | Waiting for table level lock | DELETE FROM `catalogsearch_fulltext` WHERE (store_id=1) AND (product_id IN ('26601')) | 0.000 |
| 162701 | catalog | mymagentositexxxxxx.com:34410 | catalog | Query | 1021 | Sending data | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162742 | catalog | mymagentositexxxxxx.com:34456 | catalog | Query | 1014 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 162892 | catalog | mymagentositexxxxxx.com:34628 | catalog | Query | 976 | update | INSERT INTO `report_viewed_product_index` (`visitor_id`,`customer_id`,`product_id`,`store_id`,`added_at`) VALUES ('8391969', NULL, '26601', '1', '2017-09-08 07:38:54') ON DUPLICATE KEY UPDATE visitor_id = VALUES(`visitor_id`), customer_id = VALUES(`customer_id`), product_id = VALUES(`product_id`), store_id = VALUES(`store_id`), added_at = VALUES(`added_at`) | 0.000 |
| 163286 | catalog | mymagentositexxxxxx.com:35318 | catalog | Query | 895 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163303 | catalog | mymagentositexxxxxx.com:35337 | catalog | Query | 891 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163783 | catalog | mymagentositexxxxxx.com:35890 | catalog | Query | 811 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 6656 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 163825 | catalog | mymagentositexxxxxx.com:35952 | catalog | Query | 804 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 33241 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%informaatika%' OR `s`.`data_index` LIKE '%8.c%' OR `s`.`data_index` LIKE '%2017/2018%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 164314 | catalog | mymagentositexxxxxx.com:36583 | catalog | Query | 721 | Waiting for table level lock | INSERT INTO `catalogsearch_result` SELECT 11474 AS `query_id`, `s`.`product_id`, 0 AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%Informaatika%' OR `s`.`data_index` LIKE '%8.c%')) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`) | 0.000 |
| 165111 | catalog | mymagentositexxxxxx.com:37633 | catalog | Sleep | 557 | | NULL | 0.000 |
The full output of 'show processlist' command is at here.
catalog_sarch_fulltext uses MyISAM engine and all other tables using InnoDB engine. The creation SQL of table's are as below.
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_fulltext;
+------------------------+------------------------------------------------------
| catalogsearch_fulltext | CREATE TABLE `catalogsearch_fulltext` (
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
`data_index` longtext DEFAULT NULL COMMENT 'Data index',
`fulltext_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
PRIMARY KEY (`fulltext_id`),
UNIQUE KEY `UNQ_CATALOGSEARCH_FULLTEXT_PRODUCT_ID_STORE_ID` (`product_id`,`store_id`),
FULLTEXT KEY `FTI_CATALOGSEARCH_FULLTEXT_DATA_INDEX` (`data_index`)
) ENGINE=MyISAM AUTO_INCREMENT=912741 DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
+------------------------+------------------------------------------------------
1 row in set (0.00 sec)
MariaDB [catalog]> SHOW CREATE TABLE catalogsearch_result;
| Table | Create Table |
| catalogsearch_result | CREATE TABLE `catalogsearch_result` (
`query_id` int(10) unsigned NOT NULL COMMENT 'Query ID',
`product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
`relevance` decimal(20,4) NOT NULL DEFAULT 0.0000 COMMENT 'Relevance',
PRIMARY KEY (`query_id`,`product_id`),
KEY `IDX_CATALOGSEARCH_RESULT_QUERY_ID` (`query_id`),
KEY `IDX_CATALOGSEARCH_RESULT_PRODUCT_ID` (`product_id`),
CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY_ID_CATALOGSEARCH_QUERY_QUERY_ID` FOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATSRCH_RESULT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog search result table' |
1 row in set (0.00 sec)
Does setting some timeout values remove the deadlocks? Please suggest.
-Thanks
mariadb deadlock mariadb-10.1
mariadb deadlock mariadb-10.1
asked Sep 8 '17 at 12:41
RajeevRajeev
1
1
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15
add a comment |
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15
add a comment |
1 Answer
1
active
oldest
votes
If catalogsearch_fulltext
is designed to use a FULLTEXT
index, then you should be using MATCH
, not LIKE
.
If you do need LIKE
, then there are two strikes against efficiency: OR
and leading wildcard.
What is the idea behind doing a search in ...fulltext
, then INSERTing INTO ...result
. Shouldn't you simply return the results to the user? Or is this some dubious optimization of the 3rd party software that generated the query?
InnoDB has supported FULLTEXT
since MariaDB 10.0.6; you should get away from MyISAM. Note "Waiting for table level lock", which is what the queries is stuck on. That comes from MyISAM, not InnoDB.
(No, I can't explain why you were not seeing these problems in MariaDB 5.5; perhaps there are other things that accidentally changed when you upgraded to 10.2.)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f185411%2fdeadlocks-appeared-after-moving-to-mariadb10-2-from-mysql5-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If catalogsearch_fulltext
is designed to use a FULLTEXT
index, then you should be using MATCH
, not LIKE
.
If you do need LIKE
, then there are two strikes against efficiency: OR
and leading wildcard.
What is the idea behind doing a search in ...fulltext
, then INSERTing INTO ...result
. Shouldn't you simply return the results to the user? Or is this some dubious optimization of the 3rd party software that generated the query?
InnoDB has supported FULLTEXT
since MariaDB 10.0.6; you should get away from MyISAM. Note "Waiting for table level lock", which is what the queries is stuck on. That comes from MyISAM, not InnoDB.
(No, I can't explain why you were not seeing these problems in MariaDB 5.5; perhaps there are other things that accidentally changed when you upgraded to 10.2.)
add a comment |
If catalogsearch_fulltext
is designed to use a FULLTEXT
index, then you should be using MATCH
, not LIKE
.
If you do need LIKE
, then there are two strikes against efficiency: OR
and leading wildcard.
What is the idea behind doing a search in ...fulltext
, then INSERTing INTO ...result
. Shouldn't you simply return the results to the user? Or is this some dubious optimization of the 3rd party software that generated the query?
InnoDB has supported FULLTEXT
since MariaDB 10.0.6; you should get away from MyISAM. Note "Waiting for table level lock", which is what the queries is stuck on. That comes from MyISAM, not InnoDB.
(No, I can't explain why you were not seeing these problems in MariaDB 5.5; perhaps there are other things that accidentally changed when you upgraded to 10.2.)
add a comment |
If catalogsearch_fulltext
is designed to use a FULLTEXT
index, then you should be using MATCH
, not LIKE
.
If you do need LIKE
, then there are two strikes against efficiency: OR
and leading wildcard.
What is the idea behind doing a search in ...fulltext
, then INSERTing INTO ...result
. Shouldn't you simply return the results to the user? Or is this some dubious optimization of the 3rd party software that generated the query?
InnoDB has supported FULLTEXT
since MariaDB 10.0.6; you should get away from MyISAM. Note "Waiting for table level lock", which is what the queries is stuck on. That comes from MyISAM, not InnoDB.
(No, I can't explain why you were not seeing these problems in MariaDB 5.5; perhaps there are other things that accidentally changed when you upgraded to 10.2.)
If catalogsearch_fulltext
is designed to use a FULLTEXT
index, then you should be using MATCH
, not LIKE
.
If you do need LIKE
, then there are two strikes against efficiency: OR
and leading wildcard.
What is the idea behind doing a search in ...fulltext
, then INSERTing INTO ...result
. Shouldn't you simply return the results to the user? Or is this some dubious optimization of the 3rd party software that generated the query?
InnoDB has supported FULLTEXT
since MariaDB 10.0.6; you should get away from MyISAM. Note "Waiting for table level lock", which is what the queries is stuck on. That comes from MyISAM, not InnoDB.
(No, I can't explain why you were not seeing these problems in MariaDB 5.5; perhaps there are other things that accidentally changed when you upgraded to 10.2.)
answered Sep 20 '17 at 3:40
Rick JamesRick James
41.2k22258
41.2k22258
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f185411%2fdeadlocks-appeared-after-moving-to-mariadb10-2-from-mysql5-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Those processes don't appear to be deadlocked, just waiting for a lock to clear. Is your database killing processes as deadlock victims or is it just slow?
– indiri
Sep 8 '17 at 23:15