Bug #78942 mysqlserverclone is useless
Submitted: 23 Oct 2015 13:41 Modified: 24 Oct 2015 6:00
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:1.6.2 OS:Any
Assigned to: CPU Architecture:Any

[23 Oct 2015 13:41] Sveta Smirnova
Description:
At http://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlserverclone.html this utility described as one, which "enables you to clone an existing MySQL server instance to create a new server instance on the same host" But it practically spawns new process on empty datadir with defaults (unless overwritten on command line). This process is hardly can be called "cloning".

How to repeat:
"Clone" an existing MySQL Server instance, then check size of InnoDB log files created:

sveta@thinkie:~/build/mysql-5.7/mysql-test> ls -lh var/mysqld.1/data/ib_log*
-rw-r--r-- 1 sveta users 5.0M Oct 23 15:51 var/mysqld.1/data/ib_logfile0
-rw-r--r-- 1 sveta users 5.0M Oct 22 22:58 var/mysqld.1/data/ib_logfile1
sveta@thinkie:~/build/mysql-5.7/mysql-test> ls -lh /home/sveta/tmp/mysqlserverclone/ib_log*
-rw-r----- 1 sveta users 48M Oct 23 16:12 /home/sveta/tmp/mysqlserverclone/ib_logfile0
-rw-r----- 1 sveta users 48M Oct 23 16:11 /home/sveta/tmp/mysqlserverclone/ib_logfile1

Suggested fix:
Make mysqlserver clone clone at least all options, existed in running server. Then suggest users to use mysqldbcopy to clone data.
[23 Oct 2015 13:48] Shahriyar Rzayev
Yes it is actually, just creates new MySQL server process in given datadir...
Maybe should called "Process cloning" or "Will Create new fresh MySQL instance" etc.
[24 Oct 2015 6:00] Umesh Shastry
Hello Sveta,

Thank you for the report.

Thanks,
Umesh
[24 Oct 2015 6:01] Umesh Shastry
//
[root@cluster-repo ~]# ls -lh /var/lib/mysql/ib_log*
-rw-r----- 1 mysql mysql 64M Oct 26 18:29 /var/lib/mysql/ib_logfile0
-rw-r----- 1 mysql mysql 64M Oct 26 18:29 /var/lib/mysql/ib_logfile1
[root@cluster-repo ~]#

    [root@cluster-repo ~]# ls -lh /var/lib/mysql/ib_log*
    -rw-r----- 1 mysql mysql 64M Oct 26 18:29 /var/lib/mysql/ib_logfile0
    -rw-r----- 1 mysql mysql 64M Oct 26 18:29 /var/lib/mysql/ib_logfile1
    [root@cluster-repo ~]# mysqlserverclone --server=root:pass@localhost \
    >     --new-data=/tmp/test123 --new-port=3310 \
    >     --root-password=pass --mysqld=--log-bin=mysql-bin
    WARNING: Using a password on the command line interface can be insecure.
    # Cloning the MySQL server running on localhost.
    # Creating new data directory...
    # Configuring new instance...
    # Locating mysql tools...
    # Setting up empty database and mysql tables...
    # Starting new instance of the server...
    # Testing connection to new instance...
  .
  [root@cluster-repo ~]# ls -lh /tmp/test123/ib_log*
    -rw-r----- 1 root root 48M Oct 26 18:32 /tmp/test123/ib_logfile0
    -rw-r----- 1 root root 48M Oct 26 18:31 /tmp/test123/ib_logfile1
    [root@cluster-repo ~]#