Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOAD DATA LOCAL INFILE does not update processlist #7477

Closed
morgo opened this issue Aug 24, 2018 · 2 comments
Closed

LOAD DATA LOCAL INFILE does not update processlist #7477

morgo opened this issue Aug 24, 2018 · 2 comments

Comments

@morgo
Copy link
Contributor

morgo commented Aug 24, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

I imported sample data in 8 threads into TiDB using LOAD DATA LOCAL INFILE (script called from an xargs on ls):

#!/bin/sh
echo $1
mysql bikeshare -e "LOAD DATA LOCAL INFILE '$1' INTO TABLE trips FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' (duration, start_date, end_date, start_station_number, start_station, end_station_number, end_station, bike_number, member_type)";

I was trying to see the status of the files in SHOW PROCESSLIST or SHOW FULL PROCESSLIST:

mysql> show full processlist;
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
| Id   | User | Host      | db        | Command | Time | State | Info                  | Mem  |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
|   58 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   60 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|    7 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   63 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   52 | root | 127.0.0.1 |           | Query   |    0 | 2     | show full processlist |    0 |
|   64 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   65 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   66 | root | 127.0.0.1 |           | Query   |   25 | 2     | select sleep(60)      |    0 |
|   62 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
|   54 | root | 127.0.0.1 | bikeshare | Query   |    0 | 2     |                       |    0 |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
10 rows in set (0.00 sec)
  1. What did you expect to see?

It looks like the Time and Info columns are not updated for LOAD DATA LOCAL INFILE. There is an existing bug report on State not updating. For a normal select query, Time and Info update fine.

  1. What did you see instead?

Same behavior as a long-running select. Here is a MySQL 8.0 example (it is useful to see info populated):

mysql [localhost] {msandbox} ((none)) > show processlist;
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
| Id | User            | Host      | db        | Command | Time | State                  | Info                                                                                                 |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
|  4 | event_scheduler | localhost | NULL      | Daemon  | 1439 | Waiting on empty queue | NULL                                                                                                 |
| 37 | msandbox        | localhost | NULL      | Query   |    0 | starting               | show processlist                                                                                     |
| 55 | msandbox        | localhost | bikeshare | Query   |  439 | query end              | LOAD DATA LOCAL INFILE '2016Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY  |
| 60 | msandbox        | localhost | bikeshare | Query   |  439 | executing              | LOAD DATA LOCAL INFILE '2017Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY  |
| 62 | msandbox        | localhost | bikeshare | Query   |  439 | executing              | LOAD DATA LOCAL INFILE '2017Q2-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY  |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

I'm running a branch which has tracing. I built it today:

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: rc1-3104-g51046aa7
Git Commit Hash: 51046aa717e782d3843ae2c91f0a0952de05a4e5
Git Branch: tidb_tracing_prototype
UTC Build Time: 2018-08-23 08:21:06
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)
@morgo
Copy link
Contributor Author

morgo commented Oct 2, 2018

The Time column is now accurately maintained. See: #7765

@morgo
Copy link
Contributor Author

morgo commented Oct 26, 2018

This was fixed in I believe #7844

MySQL [(none)]> show processlist\G
*************************** 1. row ***************************
     Id: 4
   User: root
   Host: 127.0.0.1
     db: bikeshare
Command: Query
   Time: 70
  State: 2
   Info: LOAD DATA LOCAL INFILE '2011-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY ',
    Mem: 0
*************************** 2. row ***************************
     Id: 3
   User: root
   Host: 127.0.0.1
     db: 
Command: Query
   Time: 0
  State: 2
   Info: show processlist
    Mem: 0
2 rows in set (0.00 sec)

@morgo morgo closed this as completed Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants