Query hangs intermittently
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Expired
|
Undecided
|
Unassigned |
Bug Description
I run a query processing uploaded data in order to determine whether or not it will pass primary and foreign key constraints in order to provide better feedback to the uploader besides a database query failure message. On some occasions this query will run in just a few minutes but on other occasions it will hang on this query for hours before completing, and in still other cases it has hung indefinitely and not completed after days of waiting. It doesn't generate any entries in the error log.
Even when fed identical data via our DAIS01S05_
It's unclear if this is a bug or a tuning issue, can someone help me?
----
Here's the (partial) results from the processlist and the table structure.
mysql> show full processlist;
+------
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+------
| 1470 | cyeoman | 192.168.122.1:49370 | DAIS01S05__daisi | Query | 8976 | Sending data | INSERT INTO program_
(
fiscal_year
, program_id
, file_structure_
, constraint_index
, constraint_
, constraint_
)
SELECT data_import_
, data_import_
, 17 file_structure_
, 3 constraint_index
, data_import_
, CONCAT_WS('|',
) constraint_
FROM DAIS01S05_
WHERE data_import_
AND data_import_
AND NOT EXISTS (
SELECT *
FROM DAIS01S05_
WHERE reference_
AND reference_
AND reference_
) | 0 | 3889265525 |
+------
mysql> desc program_
+------
| Field | Type | Null | Key | Default | Extra |
+------
| fiscal_year | int(6) | NO | PRI | NULL | |
| program_id | int(11) | NO | PRI | NULL | |
| file_structure_
| constraint_index | int(11) | NO | PRI | NULL | |
| constraint_
| constraint_
+------
6 rows in set (5.25 sec)
mysql> desc DAIS01S05_
+------
| Field | Type | Null | Key | Default | Extra |
+------
| fiscal_year | int(6) | NO | PRI | NULL | |
| program_id | int(11) | NO | PRI | NULL | |
| college_id | int(11) | NO | | NULL | |
| student_id | int(11) | NO | | NULL | |
| course_id | int(11) | NO | | NULL | |
| class_id | int(11) | NO | | NULL | |
| midterm_score | varchar(20) | YES | | NULL | |
| final_score | varchar(20) | YES | | NULL | |
| funding_source_id | int(11) | NO | | NULL | |
| instructional_
| class_exit_id | int(11) | YES | | NULL | |
| uploaded_
| original_row_text | blob | NO | | NULL | |
| parsed_data_object | blob | NO | | NULL | |
+------
14 rows in set (0.08 sec)
mysql> desc DAIS01S05_
+------
| Field | Type | Null | Key | Default | Extra |
+------
| fiscal_year | int(6) | NO | PRI | NULL | |
| program_id | int(11) | NO | PRI | NULL | |
| student_id | int(11) | NO | | NULL | |
| address1 | varchar(255) | NO | | NULL | |
| address2 | varchar(255) | YES | | NULL | |
| birth_date | datetime | YES | | NULL | |
| cell_phone | varchar(50) | YES | | NULL | |
| city | varchar(50) | NO | | NULL | |
| state_id | int(11) | YES | | NULL | |
| country_of_origin | varchar(50) | YES | | NULL | |
| county_
| date_first_
| date_last_
| date_received | datetime | YES | | NULL | |
| dependent_
| dependent_
| diploma_date | datetime | YES | | NULL | |
| disability_id | int(11) | YES | | NULL | |
| distance_learning | tinyint(4) | YES | | NULL | |
| email_address | varchar(100) | YES | | NULL | |
| emergency_
| emergency_last_name | varchar(50) | YES | | NULL | |
| emergency_phone | varchar(50) | YES | | NULL | |
| encrypted_ssn | varchar(64) | NO | | NULL | |
| encrypted_ssn_l4 | varchar(64) | YES | | NULL | |
| english_
| ethnicity_id | int(11) | YES | | NULL | |
| external_student_id | varchar(50) | YES | | NULL | |
| first_name | varchar(50) | NO | | NULL | |
| gender_id | int(11) | YES | | NULL | |
| has_diploma | tinyint(4) | YES | | NULL | |
| has_ged | tinyint(4) | YES | | NULL | |
| history_notes | text | YES | | NULL | |
| home_phone | varchar(50) | YES | | NULL | |
| hours_worked_
| is_eg_american_
| is_eg_asian | tinyint(4) | YES | | NULL | |
| is_eg_black | tinyint(4) | YES | | NULL | |
| is_eg_native_
| is_eg_white | tinyint(4) | YES | | NULL | |
| is_spanish_origin | tinyint(4) | YES | | NULL | |
| last_access_date | datetime | YES | | NULL | |
| last_name | varchar(50) | NO | | NULL | |
| last_school_
| marital_id | int(11) | YES | | NULL | |
| middle_name | varchar(50) | YES | | NULL | |
| native_language | varchar(50) | YES | | NULL | |
| occupation_id | int(11) | YES | | NULL | |
| primary_
| primary_
| primary_
| primary_
| primary_
| primary_goal_id | int(11) | YES | | NULL | |
| public_aid_id | varchar(20) | YES | | NULL | |
| emergency_
| returning_
| school_type_id | int(11) | YES | | NULL | |
| school_
| secondary_
| secondary_
| secondary_
| secondary_
| secondary_goal_id | int(11) | YES | | NULL | |
| separation_date | datetime | YES | | NULL | |
| separation_
| status_id | int(11) | NO | | NULL | |
| student_
| student_
| student_
| name_suffix | varchar(20) | YES | | NULL | |
| work_phone | varchar(50) | YES | | NULL | |
| yearly_
| zip | varchar(10) | NO | | NULL | |
| country_
| month_year_
| school_
| uploaded_
| original_row_text | blob | NO | | NULL | |
| parsed_data_object | blob | NO | | NULL | |
+------
80 rows in set (0.11 sec)
And here's my.cnf:
# Percona Server template configuration
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_
datadir=
socket=
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=
[mysqld_safe]
log-error=
pid-file=
Changed in percona-server: | |
status: | Incomplete → New |
Changed in percona-server: | |
status: | Incomplete → New |
What's you've reported above sounds like a support request that somebody has to spend a lot of time one to say anything definite about the root cause of the problem you have. I am not sure it's a result (or indication) of any bug in Percona Server.
To begin with, please, check the output of:
explain SELECT data_import_ table.fiscal_ year fiscal_year
, data_import_ table.program_ id program_id
, 17 file_structure_ type_id
, 3 constraint_index
, data_import_ table.uploaded_ file_line_ number constraint_ violation_ line_number
, CONCAT_WS('|',
(that is, SELECT part of your INSERT ... SELECT) when the query hangs and when it was executed fast enough. Maybe we can come up with some useful conclusion based on this comparison.