Last modified: 2014-05-12 21:53:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66140, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64140 - Killed Mysql queries still running
Killed Mysql queries still running
Status: RESOLVED INVALID
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Sean Pringle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-19 18:56 UTC by kolossos
Modified: 2014-05-12 21:53 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description kolossos 2014-04-19 18:56:31 UTC
Hello, I got a problem during import English templates into project templatetiger. It seem that 18GB was too much. 

So I kill the query after one week but it's still existing:

MariaDB [(none)]> show processlist;
+----------+--------+-------------------+-------------------------+---------+--------+-----------+------------------------------------------------------------------------------------------------------+----------+
| Id       | User   | Host              | db                      | Command | Time   | State     | Info                                                                                                 | Progress |
+----------+--------+-------------------+-------------------------+---------+--------+-----------+------------------------------------------------------------------------------------------------------+----------+
| 12142236 | s51071 | 10.68.17.64:38639 | s51071__templatetiger_p | Killed  | 983903 | query end | LOAD  DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/enwiki-2014-04-02-lPqO.t |   50.000 |

| 17047860 | s51071 | 10.68.16.32:56063 | s51071__templatetiger_p | Killed  | 155552 | query end | LOAD  DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/svwiki-2014-04-13.txt' I |   50.000 |

| 17294673 | s51071 | 10.68.16.37:51890 | s51071__templatetiger_p | Query   |  77689 | query end | LOAD  DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/fiwiki-2014-04-07.txt' I |   50.000 |

| 17365449 | s51071 | 10.68.16.7:47700  | NULL                    | Query   |      0 | NULL      | show processlist                                                                                     |    0.000 |
+----------+--------+-------------------+-------------------------+---------+--------+-----------+------------------------------------------------------------------------------------------------------+----------+


It seems that this slow down also my other imports, that runs fine in the past. 
So I try to kill import of sv-wiki without success and fiwiki is running to long. My next try would be to split enwiki into little pieces of 2 GB. 

Please kill the queries for me.
Comment 1 Andre Klapper 2014-04-20 07:38:23 UTC
What are steps to reproduce this, and where?
Comment 2 kolossos 2014-04-20 10:12:07 UTC
To reproduce:
CREATE TABLE `enwiki_neu` ( `name_id` bigint( 20 ) NOT NULL , `name` varchar( 180 ) NOT NULL , `tp_nr` bigint( 20 ) NOT NULL , `tp_name` varchar( 100 ) NOT NULL , `entry_nr` bigint( 20 ) NOT NULL , `entry_name` varchar( 200 ) NOT NULL , `Value` varchar( 900 ) NOT NULL ,
KEY `tp_name` (`tp_name`(30)), KEY `name` ( `name` (15)) , KEY `name_id` ( `name_id`) , KEY `entry_name` ( `entry_name`(15) ) , KEY `Value` ( `Value` (15) ) ) ENGINE = InnoDB DEFAULT CHARSET = utf8;

set autocommit = 0;LOAD /* SLOW_OK */ DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/enwiki-2014-04-02-lPqO.txt' IGNORE INTO TABLE `enwiki_neu` FIELDS TERMINATED BY '\t' ESCAPED BY '\\' LINES TERMINATED BY '\n' ;
commit; set autocommit = 1;


I believe there is a nonlinear performance drop, if the index-size becomes larger than the RAM. 

To stop import I use "kill query 12345678;" and jstop.
Comment 3 Andre Klapper 2014-04-21 04:46:27 UTC
Where?
Comment 4 Andre Klapper 2014-04-21 04:47:10 UTC
Is this about some Wikimedia Labs instance? Some tool on Tool Labs?
Comment 5 kolossos 2014-04-21 07:39:21 UTC
Toollabs: http://tools.wmflabs.org/templatetiger/

Thats why I put this report in "Product:Tools".
Comment 6 Andre Klapper 2014-04-21 08:46:00 UTC
https://bugzilla.wikimedia.org/describecomponents.cgi  :)
Comment 7 kolossos 2014-04-23 17:41:28 UTC
Process of enwiki is still there:
MariaDB [(none)]> show processlist;
+----------+--------+-------------------+-------------------------+---------+---------+-----------+------------------------------------------------------------------------------------------------------+----------+
| Id       | User   | Host              | db                      | Command | Time    | State     | Info                                                                                                 | Progress |
+----------+--------+-------------------+-------------------------+---------+---------+-----------+------------------------------------------------------------------------------------------------------+----------+
| 12142236 | s51071 | 10.68.17.64:38639 | s51071__templatetiger_p | Killed  | 1325555 | query end | LOAD  DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/enwiki-2014-04-02-lPqO.t |   50.000 |
Comment 8 kolossos 2014-04-30 17:45:02 UTC
After 11 days still running:
tools.templatetiger@tools-login:
MariaDB [(none)]> show processlist;
+----------+--------+-------------------+-------------------------+---------+---------+-----------+------------------------------------------------------------------------------------------------------+----------+
| Id       | User   | Host              | db                      | Command | Time    | State     | Info                                                                                                 | Progress |
+----------+--------+-------------------+-------------------------+---------+---------+-----------+------------------------------------------------------------------------------------------------------+----------+
| 12142236 | s51071 | 10.68.17.64:38639 | s51071__templatetiger_p | Killed  | 1930465 | query end | LOAD  DATA LOCAL INFILE '/data/project/templatetiger/public_html/dumps/sort/enwiki-2014-04-02-lPqO.t |   50.000 |
| 18335208 | s51071 | 10.68.16.7:46051  | NULL                    | Query   |       0 | NULL      | show processlist                                                                                     |    0.000 |
+----------+--------+-------------------+-------------------------+---------+---------+-----------+------------------------------------------------------------------------------------------------------+----------+
2 rows in set (0.00 sec)
Comment 9 Tim Landscheidt 2014-04-30 21:25:32 UTC
Tim, just to be clear: On what DB host is this query running/hanging?  Looking at /data/project/templatetiger/public_html/einspielen.sql, this seems to be tools-db?

Replication for enwiki stopped on 2014-04-18 (twelve days ago) and was restarted on 2014-04-21 (nine days ago; cf. bug #64154), so this query in limbo might be related to that, thus assigning to Sean (even though I assume tools-db resides on a different DB server).
Comment 10 kolossos 2014-04-30 21:56:43 UTC
It's running on tools-db. I started it with jsub.
I never restarted the query and it has no contact to the official enwiki-db because I import an extract of templates as a text-file into my project-db. Template data are not included the official enwiki-db. I got the data from checkwiki-project.
Comment 11 Sean Pringle 2014-05-01 04:26:58 UTC
tools-db is labsdb1005. It isn't a production replicant, so this is unrelated to the replication outage.

LOAD DATA INFILE importing a lot of data to a transactional storage engine like InnoDB is asking for trouble because the statement is a also a transaction -- an 18GB transaction :-)

That means a whole lot of undo log entries are generated in case of rollback, much purge thread lag occurs, other traffic is slowed, and if the undo log exceeds buffer pool capacity it will start thrashing the tablespace on disk.

If the transaction gets killed and has to rollback the whole process will be even slower than the original load.

All that can be done now is:

a) Wait it out.

b) Restart mysqld and hope crash recovery is faster (may not be).

c) Not nice stuff that will need downtime for everyone.

In the future, better to do bulk data loads into ARIA tables then ALTER them to be InnoDB if you need it specifically. Your plan to batch the inserts in 2GB chunks is also good.
Comment 12 Tim Landscheidt 2014-05-12 21:53:01 UTC
I assume then that this (killed queries taking a long time to wind down) is not really a bug, but ... the way it is :-).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links