Skip to content

Commit b78756f

Browse files
authored
Merge pull request #476 from percona/ps-9701
[DOCS] - Add Clone limitations 8.0
2 parents f7c23c6 + 0c55e04 commit b78756f

File tree

5 files changed

+182
-0
lines changed

5 files changed

+182
-0
lines changed

docs/clone-plugin-limitations.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Clone plugin limitations
2+
3+
The clone plugin clones instances within the same series only. It clones from version 8.0.37 to 8.0.42, but not from 8.0 to 8.4. Before the 8.0.37 version, it requires matching point release numbers.
4+
5+
Before version 8.0.27, the clone plugin blocks DDL on the donor and recipient during cloning. This block includes `TRUNCATE TABLE`. Use dedicated donor instances to work around this limitation. DML continues during cloning.
6+
7+
From the 8.0.27 version, the clone plugin allows concurrent DDL on the donor by default. The `clone_block_ddl` variable controls this limit.
8+
9+
The clone plugin clones from a donor to a hotfix instance of the same version from 8.0.26 version onward.
10+
11+
The clone plugin clones one MySQL instance at a time. It does not clone multiple instances in one operation.
12+
13+
The clone plugin does not support the X Protocol port (mysqlx_port) for remote cloning.
14+
15+
The clone plugin does not clone MySQL server configurations. The recipient keeps its own settings.
16+
17+
The clone plugin does not clone binary logs.
18+
19+
The clone plugin clones InnoDB data only. It clones other storage engine tables, like MyISAM and CSV, as empty tables.
20+
21+
The clone plugin does not support connections to the donor through MySQL Router.
22+
23+
Local cloning does not clone general tablespaces created with absolute paths. This prevents file path conflicts.

docs/clone-plugin-overview.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Clone plugin overview
2+
3+
The Clone plugin lets you clone data from either a local server or from a remote server. The plugin creates a physical snapshot of the data stored in InnoDB, which includes schemas, tables, tablespaces, and data dictionary metadata. The cloned data is a functional data directory and can be used for provisioning a server.
4+
5+
The following table lists the cloning operation types:
6+
7+
| Cloning operation type | Description |
8+
|---|---|
9+
| Local | Clones the data from the server where the operation is initiated to either a directory on the same server or a server node. |
10+
| Remote | Clones the data from the donor to the joiner over the network. |
11+
12+
When replicating a large number of transactions, the Clone plugin may be a more efficient solution.
13+
14+
## Install the Clone plugin
15+
16+
The Clone plugin must be installed on both the donor and the joiner servers at either server startup or at runtime. To install the plugin at runtime, run the following command:
17+
18+
```{.bash data-prompt="mysql>"}
19+
mysql> INSTALL PLUGIN clone SONAME 'mysql_clone.so';
20+
```
21+
22+
Review the INFORMATION_SCHEMA.PLUGINS table or run the `SHOW PLUGINS` command to verify the installation. The following is an example of querying the PLUGINS table.
23+
24+
```{.bash data-prompt="mysql>"}
25+
mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='clone';
26+
```
27+
28+
The result lists the Clone plugin and the status.
29+
30+
For more information about the Clone plugin, see:
31+
32+
* [Load the Clone plugin](load-clone-plugin.md)
33+
34+
* [Use the Clone plugin](clone-plugin-usage.md)
35+
36+
* [Clone plugin limitations](clone-plugin-limitations.md)

docs/clone-plugin-usage.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Use the Clone plugin
2+
3+
The Clone plugin in the server enables you to create a physical copy of a server instance. This feature simplifies server provisioning and replication setup. Using the Clone plugin, you can quickly copy data from one server instance (donor) to another (recipient).
4+
5+
## Common scenarios
6+
7+
The following are common scenarios for using the Clone plugin:
8+
9+
| **Scenario** | **Description** |
10+
|--------------------------------------------------|----------------------------------------------------------------------|
11+
| Set up new replicas quickly | Without manual data copying |
12+
| Bootstrap new Group Replication members | Efficiently add new members to the group |
13+
| Create physical backups | With minimal performance impact |
14+
| Build test environments | Mirror production data for accurate testing |
15+
| Provision new MySQL server instances | Quickly set up new servers with existing data |
16+
| Perform local cloning | Clone data within the same server for testing or backup purposes |
17+
| Clone encrypted and compressed data | Support for cloning encrypted and page-compressed data |
18+
19+
The Clone Plugin significantly reduces the time needed to create full server instance copies compared to traditional backup and restore methods.
20+
21+
## Local clone on the same server
22+
23+
To clone data to a different directory on the same server:
24+
25+
```{.bash data-prompt="mysql>"}
26+
mysql> CLONE LOCAL DATA DIRECTORY = '/path/to/destination/directory';
27+
```
28+
29+
This command creates a full copy of all databases in the source directory.
30+
31+
## Remote cloning to copy data between servers
32+
33+
On the source server, create a user with the necessary privileges:
34+
35+
```{.bash data-prompt="mysql>"}
36+
mysql> CLONECREATE USER clone_user@'%' IDENTIFIED BY 'password';
37+
mysql> GRANT CLONE_ADMIN ON *.* TO clone_user@'%';
38+
```
39+
40+
On the target server, run the clone command:
41+
42+
```{.bash data-prompt="mysql>"}
43+
mysql> CLONE INSTANCE FROM 'clone_user'@'donor_host':3306
44+
IDENTIFIED BY 'password';
45+
```
46+
47+
The destination server will shut down, replace its data, and restart automatically.
48+
49+
## Monitor clone operations
50+
51+
Check the status of ongoing and completed clone operations:
52+
53+
```{.bash data-prompt="mysql>"}
54+
mysql> SELECT * FROM performance_schema.clone_status;
55+
mysql> SELECT * FROM performance_schema.clone_progress;
56+
```
57+
58+
Additional details are recorded in the server error log.
59+
60+
For more information about the Clone plugin, see:
61+
62+
* [Clone plugin overview](clone-plugin-overview.md)
63+
64+
* [Load the Clone plugin](load-clone-plugin.md)
65+
66+
* [Clone plugin limitations](clone-plugin-limitations.md)

docs/load-clone-plugin.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Load the Clone plugin
2+
3+
You cannot use the `--plugin-load-add` option to load the clone plugin during an upgrade from a previous MySQL version. Attempting to do so will raise an error. Upgrade the server first, then start it with `plugin-load-add=mysql_clone.so`.
4+
5+
## Load the plugin
6+
7+
Locate the Plugin Library File: Ensure the plugin library file (`mysql_clone.so`) is in the MySQL plugin directory (`plugin_dir` system variable). Set `plugin_dir` at server startup if necessary.
8+
9+
=== "At server startup"
10+
11+
Load the Plugin at Server Startup: Use the `--plugin-load-add` option to name the library file. Add the following lines to your `my.cnf` file:
12+
13+
```ini
14+
[mysqld]
15+
plugin-load-add=mysql_clone.so
16+
```
17+
Restart the server to apply the new settings.
18+
19+
20+
=== "At runtime"
21+
22+
Load the Plugin at Runtime: Alternatively, you can load the plugin at runtime with the following SQL statement:
23+
24+
```sql
25+
INSTALL PLUGIN clone SONAME 'mysql_clone.so';
26+
```
27+
28+
This command loads the plugin and registers it in the `mysql.plugins` table, ensuring it loads automatically at subsequent server startups without `--plugin-load-add`.
29+
30+
## Verify Plugin installation
31+
32+
Check the `INFORMATION_SCHEMA.PLUGINS` table or use the `SHOW PLUGINS` statement to verify the plugin installation:
33+
34+
```sql
35+
SELECT PLUGIN_NAME, PLUGIN_STATUS
36+
FROM INFORMATION_SCHEMA.PLUGINS
37+
WHERE PLUGIN_NAME = 'clone';
38+
```
39+
If the plugin fails to initialize, check the server error log for diagnostic messages.
40+
41+
## Control plugin activation state
42+
43+
If the plugin is registered with `INSTALL PLUGIN` or loaded with `--plugin-load-add`, use the `--clone` option at server startup to control its activation state. To load the plugin at startup and prevent it from being removed at runtime, add these options:
44+
45+
```ini
46+
[mysqld]
47+
plugin-load-add=mysql_clone.so
48+
clone=FORCE_PLUS_PERMANENT
49+
```
50+
51+
To prevent the server from running without the clone plugin, use `--clone` with `FORCE` or `FORCE_PLUS_PERMANENT`. These options ensure the server startup fails if the plugin does not initialize successfully.

mkdocs-base.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ nav:
292292
- Manage:
293293
- extended-show-grants.md
294294
- uninstall-component.md
295+
- Plugins:
296+
- MySQL Clone plugin:
297+
- clone-plugin-overview.md
298+
- load-clone-plugin.md
299+
- clone-plugin-usage.md
300+
- clone-plugin-limitations.md
295301
- Back up and restore:
296302
- backup-restore-overview.md
297303
- backup-locks.md

0 commit comments

Comments
 (0)