Bug #105252 Improve client side visibility when performing native cloning
Submitted: 18 Oct 2021 16:52 Modified: 19 Oct 2021 5:35
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S4 (Feature request)
Version:8.0.26 OS:Any
Assigned to: CPU Architecture:Any
Tags: native_cloning, show processlist, visibility

[18 Oct 2021 16:52] Simon Mudd
Description:
I found a box that wasn't doing what I expected so I connected to it. This is what I saw:

root@hostname [(none)]> SHOW PROCESSLIST;
+-----+------+-----------+------+---------+------+----------------------------+------------------+
| Id  | User | Host      | db   | Command | Time | State                      | Info             |
+-----+------+-----------+------+---------+------+----------------------------+------------------+
|   7 | root | localhost | NULL | Query   |  473 | waiting for handler commit | NULL             |
| 292 | root | localhost | NULL | Query   |    0 | init                       | show processlist |
+-----+------+-----------+------+---------+------+----------------------------+------------------+
2 rows in set (0.00 sec)

It's not doing anything is it? Wrong.
It's doing native cloning which I can (now) see from my own cloning application logging:

2021-10-18 18:31:51 hostname.example.com native_cloning[22722] INFO Running CLONE INSTANCE FROM 'user'@'some-host.example.com':3306 IDENTIFIED BY '*****' REQUIRE SSL

Why can I not see this from the show processlist output? I think that should be clearer. Thread id doesn't appear to be doing much yet actually load on the server is about 9 and now I know I can see this elsewhere:

root@hostname [(none)]> select * from performance_schema.clone_progress;  -- sort of made up data
+------+-----------+-------------+----------------------------+----------------------------+---------+-------------+------------+------------+------------+---------------+
| ID   | STAGE     | STATE       | BEGIN_TIME                 | END_TIME                   | THREADS | ESTIMATE    | DATA       | NETWORK    | DATA_SPEED | NETWORK_SPEED |
+------+-----------+-------------+----------------------------+----------------------------+---------+-------------+------------+------------+------------+---------------+
|    1 | DROP DATA | Completed   | 2021-10-18 18:31:51.894022 | 2021-10-18 18:31:51.988282 |       1 |           0 |          0 |          0 |          0 |             0 |
|    1 | FILE COPY | In Progress | 2021-10-18 18:31:51.988467 | NULL                       |       8 | 10000000000 | 6000000000 | 6000000000 |  968237341 |     968289050 |
|    1 | PAGE COPY | Not Started | NULL                       | NULL                       |       0 |           0 |          0 |          0 |          0 |             0 |
|    1 | REDO COPY | Not Started | NULL                       | NULL                       |       0 |           0 |          0 |          0 |          0 |             0 |
|    1 | FILE SYNC | Not Started | NULL                       | NULL                       |       0 |           0 |          0 |          0 |          0 |             0 |
|    1 | RESTART   | Not Started | NULL                       | NULL                       |       0 |           0 |          0 |          0 |          0 |             0 |
|    1 | RECOVERY  | Not Started | NULL                       | NULL                       |       0 |           0 |          0 |          0 |          0 |             0 |
+------+-----------+-------------+----------------------------+----------------------------+---------+-------------+------------+------------+------------+---------------+
7 rows in set (0.01 sec)

SHOW PROCESSLIST is misleading and completely unhelpful.

How to repeat:
See above.

Suggested fix:
Improve the status shown from SHOW PROCESSLIST to better reflect that native cloning is taking place on the server (and this server is a recipient of the clone).
[19 Oct 2021 5:35] MySQL Verification Team
Hello Simon,

Thank you for the feature request!

regards,
Umesh