Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11.16
-
None
-
None
-
ubuntu
Description
I noticed yesterday that a query was not returning and assumed I had done something wrong but noticed that the same query returned fine on the other database nodes. I restarted the bad node and thought no more about it. Today two nodes have that issue (I have 3) I restarted one of them and it returns the query fine. 0.7s, the one I didn't restart it still working on that query 1000 seconds later. This time, whilst I have it in that state I did an explain and the result is indeed different on the bad node but matches on the good node. I didn't notice the issue before v16.
Good nodes:
'{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "p.replen_id, p.consumer_id",
"temporary_table": {
"nested_loop": [
{
"table":
},
{
"table":
},
{
"table":
},
{
"table":
},
{
"table":
},
{
"table":
},
{
"table":
},
{
"table":
},
{
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key1"],
"key": "key1",
"key_length": "45",
"used_key_parts": ["product_code", "valid_from"],
"ref": [
"range_management.pm.product_code",
"range_management.p.valid_from"
],
"rows": 10,
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "pm.product_code, pm.valid_from, pm.valid_to",
"table":
}
}
},
{
"table":
},
{
"table":
}
]
}
}
}
}
]
}
}
}
}'
Bad node:
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "range_management.p.replen_id, range_management.p.consumer_id",
"temporary_table": {
"nested_loop": [
{
"table":
},
{
"block-nl-join": {
"table":
,
"buffer_type": "flat",
"buffer_size": "1113Kb",
"join_type": "BNL",
"attached_condition": "a.product_code = range_management.pm.product_code and a.valid_from = range_management.pm.valid_from",
"materialized": {
"query_block": {
"select_id": 2,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "range_management.pm.product_code, range_management.pm.valid_from, range_management.pm.valid_to",
"table":
}
}
},
{
"table":
},
{
"table":
}
]
}
}
}
},
{
"block-nl-join": {
"table":
,
"buffer_type": "incremental",
"buffer_size": "853",
"join_type": "BNL"
}
},
{
"block-nl-join": {
"table":
,
"buffer_type": "incremental",
"buffer_size": "2Kb",
"join_type": "BNL",
"attached_condition": "trigcond(range_management.l.`id` = range_management.pm.lifecycle_id)"
}
},
{
"table":
},
{
"block-nl-join": {
"table":
,
"buffer_type": "flat",
"buffer_size": "5Kb",
"join_type": "BNL",
"attached_condition": "convert(p.product_code using utf8mb4) = range_management.pm.product_code and convert(p.product_code using utf8mb4) = range_management.p.product_code"
}
},
{
"block-nl-join": {
"table":
,
"buffer_type": "incremental",
"buffer_size": "1Kb",
"join_type": "BNL",
"attached_condition": "trigcond(pg.`id` = p.product_group_id)"
}
},
{
"block-nl-join": {
"table":
,
"buffer_type": "incremental",
"buffer_size": "1Kb",
"join_type": "BNL",
"attached_condition": "trigcond(cg.`id` = pg.commodity_group_id)"
}
},
{
"block-nl-join": {
"table":
,
"buffer_type": "incremental",
"buffer_size": "866",
"join_type": "BNL",
"attached_condition": "trigcond(pt.`id` = cg.product_type_id)"
}
}
]
}
}
}
}
Query:
SELECT p.product_code,
p.description description,
p.product_type_long_name,
p.product_type,
p.consumer_id,
p.replen_id,
p.approved,
p.lifecycle AS status,
pm.lifecycle_id,
l.colour AS status_colour,
p.valid_from,
p.sell_item,
CONCAT(commodity_group_name,' - ',product_group_name) AS product_group,
a.attrs
FROM range_management.v_product_attrs a
JOIN range_management.product_master_view p
ON p.product_code = a.product_code
AND p.valid_from = a.valid_from
JOIN range_management.product_master pm
ON pm.product_code = a.product_code
AND pm.valid_from = a.valid_from
LEFT JOIN range_management.lifecycle l
ON l.id = pm.lifecycle_id
ORDER BY p.replen_id, p.consumer_id