1

Trying to kill a process that running a MySQL database backup, and has the tables locked. What will happen if I kill the process?

blunders
  • 813
  • 7
  • 14
  • 30
  • You need to look up transactions and trip ACID (atomicity, consistency, isolation, durability). Other databases (remaining anonymous) will assure recovery in x seconds or blocks read/written. Contact by email for details... – ArrowInTree Dec 15 '12 at 01:54

1 Answers1

1

It depends on the process that is doing the backup. Also, it depends on the signal you have sent to the process.

If you killed the process using a SIGTERM signal, the process may have implemented a proper signal handler. In this case, the process will be able to unlock the table before exiting.

If you killed the process using a SIGKILL signal (kill -9), the process will not have a chance to clean things up before exiting. So, the tables will remain locked. In this case, only mysql server will be able to unlock the tables (I am not sure if it will really do this).

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • Its a better idea to use 'mysqladmin kill' rather than sending a signal directly to the client app - this at least allows the DBMS to handle the clean up more gracefully. – symcbean Nov 05 '10 at 12:25