Bug #11701 mysqlhotcopy - lock tables only when about to copy them
Submitted: 2 Jul 2005 9:57
Reporter: Dean Richardson Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:current OS:Any (any)
Assigned to: CPU Architecture:Any

[2 Jul 2005 9:57] Dean Richardson
Description:
Feature request:-  In addition to the current function (locking a whole database's tables at once, copying the tables individually, unlocking all the tables at once), could we have mysqlhotcopy lock/copy/unlock each table individually?

ie
mysqlhotcopy DatabaseName -justintimelocking

Procedure:-
for each table in DatabaseName
   lock the table
   copy the table
   unlock the table
next table in DatabaseName

Mysqlhotcopy is promoted that it can be run on a live/running server.  By mysqlhotcopy locking a whole series of tables at the beginning of the copying procedure, the locked tables cannot be updated ... and that can be quite a long time if the table-actually-being-copied is very large.  This situation can create stress on the server whilst it's queuing up threads waiting for tables to be locked.

Adding an option so that each table is locked only when it is able to be actually copied would help in this common situation.

Thanks.

How to repeat:
Not applicable

Suggested fix:
Add option to alter locking/copying procedure...

mysqlhotcopy DatabaseName -justintimelocking

Procedure:-
   for each table in DatabaseName
      lock the table
      copy the table
      unlock the table
   next table in DatabaseName
[31 Mar 2015 8:47] Daniƫl van Eeden
From http://dev.mysql.com/doc/refman/5.6/en/mysqlhotcopy.html
"This utility is deprecated in MySQL 5.6.20 and removed in MySQL 5.7"

So I think the status of this bug should be changed to 'Not Supported'