The database server of MySQL is doing some task around 12 hours now even though I haven't made any query during the time.
The CPU doesn't make any significant acitivity but the hard disk is in 100% usage all the time. So I guess the server is doing some work constructing index maybe, because it happened after I inserted around 3.5G of data.
Now, I want to shutdown my db server but I'm worrying if this will corrupt the database. Is there any safe way to shutdown the server? Or do I have to wait until the task is done?
I am adding more details for clarification and explain the new progress.
Before the problem happens, I was importing dump file which was around 5.5G in size. (I was executing the command from python script.)
But it took too long time so I stopped the python process before the import is completed. After that, the mysql server was doing the IO task for more than 12 hours and it is still doing.
With the advice from powerload79, I did query
SHOW FULL PROCESSLIST;
+----+-----------------+-----------------+--------+---------+--------+------------------------+-----------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-----------------+-----------------+--------+---------+--------+------------------------+-----------------------+
| 4 | event_scheduler | localhost | NULL | Daemon | 148754 | Waiting on empty queue | NULL |
| 28 | root | localhost:29209 | bitmex | Sleep | 57594 | | NULL |
| 30 | root | localhost:51361 | bitmex | Query | 0 | starting | SHOW FULL PROCESSLIST |
+----+-----------------+-----------------+--------+---------+--------+------------------------+-----------------------+
3 rows in set (0.00 sec)
It seemed there was no process doing IO task. So I tried to stop the server.
But the server didn't stop and went into a stop pending state. More than an hour was passed in the stop pending state. There is still a lot of activity in hard disk in the pending state. And the server is in offline and I cannot connect to the server from client anymore.
This is error logs generated when I tried to stop the server:
2020-03-15T03:15:00.384460Z 0 [System] [MY-013105] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Normal shutdown.
2020-03-15T03:15:02.386568Z 0 [Warning] [MY-010909] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Forcing close of thread 28 user: 'root'.
2020-03-15T03:15:02.387218Z 0 [Warning] [MY-010909] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Forcing close of thread 30 user: 'root'.