Skip to content

Commit 3669a41

Browse files
authored
DPE-2957 async replication (#375)
* import from k8s and owned library * standardized address * method in lib * to be removed workaround before confirming proper behavior * addressing PR comments * scale-in locks write to global primary * second batch of PR comments adressing * fence/unfence actions * fix for single unit replica cluster * workaround: secrets in relation data * append correct host when syncing users and fix option setup * unit test fixes * refactor for code sharing * port from k8s and test fixes * fix for localhost only root * address pr feedback * (wip) integration test * tweak test execution * missing parameter * adding test coverage * increasing coverage * more coverage #2 * increase coverage #3 * pr comments * increase coverage #4 * bump lib version since previous version merged on k8s * better messaging and rollback hack on data_secrets
1 parent 14e7dd5 commit 3669a41

22 files changed

+2794
-258
lines changed

actions.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
get-cluster-status:
55
description: Get cluster status information
6+
params:
7+
cluster-set:
8+
type: boolean
9+
default: False
10+
description: Whether to fetch the cluster or cluster-set status.
11+
Possible values are False (default) or True.
612

713
get-password:
814
description: Fetch the system user's password, which is used by charm.
@@ -53,3 +59,53 @@ restore:
5359
pre-upgrade-check:
5460
description: Run necessary pre-upgrade checks and preparations before executing a charm refresh.
5561

62+
promote-standby-cluster:
63+
description: |
64+
Promotes this cluster to become the leader in the cluster-set. Used for safe switchover or failover.
65+
Must be run against the charm leader unit of a standby cluster.
66+
params:
67+
cluster-set-name:
68+
type: string
69+
description: |
70+
The name of the cluster-set. Mandatory option, used for confirmation.
71+
force:
72+
type: boolean
73+
default: False
74+
description: |
75+
Use force when previous primary is unreachable (failover). Will invalidate previous
76+
primary.
77+
78+
recreate-cluster:
79+
description: |
80+
Recreates cluster on one or more standalone units that were previously part of a standby cluster.
81+
82+
When a standby cluster is removed from an async replication relation, the cluster will be dissolved and
83+
each unit will be kept in blocked status. Recreating the cluster allows to rejoin the async replication
84+
relation, or usage as a standalone cluster.
85+
86+
fence-writes:
87+
description: |
88+
Stops write traffic to a primary cluster of a ClusterSet.
89+
params:
90+
cluster-set-name:
91+
type: string
92+
description: |
93+
The name of the cluster-set. Mandatory option, used for confirmation.
94+
95+
unfence-writes:
96+
description: |
97+
Resumes write traffic to a primary cluster of a ClusterSet.
98+
params:
99+
cluster-set-name:
100+
type: string
101+
description: |
102+
The name of the cluster-set. Mandatory option, used for confirmation.
103+
104+
rejoin-cluster:
105+
description: |
106+
Rejoins an invalidated cluster to the cluster-set, after a previous failover or switchover.
107+
params:
108+
cluster-name:
109+
type: string
110+
description: |
111+
The name of the cluster to be rejoined.

config.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

44
options:
55
cluster-name:
6-
description: "Optional - Name of the MySQL InnoDB cluster"
6+
description: "Optional - Name of the MySQL InnoDB cluster, set once at deployment"
7+
type: "string"
8+
cluster-set-name:
9+
description: |
10+
Optional - Name for async replication cluster set, set once at deployment.
11+
On `recreate-clster` action call, the cluster set name will be re-generated automatically.
712
type: "string"
813
profile:
914
description: |

0 commit comments

Comments
 (0)