Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions e2e-tests/cross-site/conf/cross-site-replica.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ spec:
storage: 2Gi
affinity:
antiAffinityTopologyKey: none
haproxy:
proxysql:
enabled: true
size: 2
image: -haproxy
scheduler:
enabled: true
volumeSpec:
persistentVolumeClaim:
resources:
requests:
storage: 2G
size: 3
image: -proxysql
resources:
requests:
requests:
memory: 0.1G
cpu: 100m
Expand Down
13 changes: 10 additions & 3 deletions e2e-tests/cross-site/conf/cross-site-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ spec:
storage: 6Gi
affinity:
antiAffinityTopologyKey: "kubernetes.io/hostname"
haproxy:
proxysql:
enabled: true
size: 2
image: -haproxy
scheduler:
enabled: true
volumeSpec:
persistentVolumeClaim:
resources:
requests:
storage: 2G
size: 3
image: -proxysql
resources:
requests:
memory: 0.1G
Expand Down
13 changes: 6 additions & 7 deletions e2e-tests/cross-site/run
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ main() {
source_endpoint1=$(get_service_ip ${source_cluster}-pxc-1)
source_endpoint2=$(get_service_ip ${source_cluster}-pxc-2)

source_primary=$(run_mysql 'SELECT @@hostname hostname;' "-h ${source_cluster}-haproxy -p33062 -uroot -proot_password")
source_primary=$(run_mysql 'SELECT @@hostname hostname;' "-h ${source_cluster}-proxysql -p3306 -uroot -proot_password")
source_primary_endpoint=$(get_service_ip ${source_primary})
desc "patch source cluster with replicationChannels settings"
kubectl_bin patch pxc $source_cluster --type=merge --patch '{"spec": {"pxc":{"replicationChannels": [{"name":"source_to_replica", "isSource": true}]}}}'
desc "patch main cluster secrets with replication user"
kubectl_bin patch secret my-cluster-secrets -p '{"data":{"replication": "'$(echo -n new_password | base64)'"}}'
sleep 15
wait_cluster_consistency "$source_cluster" 3 2
wait_cluster_consistency "$source_cluster" 3 3

desc 'write data to source cluster'
run_mysql \
Expand Down Expand Up @@ -65,15 +65,14 @@ main() {
| $sed -e "s~#destination~${destination}~" \
| $sed -e "s~minio-service.#namespace~minio-service.${namespace}~" \
| kubectl_bin apply -f -
wait_cluster_consistency "$replica_cluster" 3 2
wait_cluster_consistency "$replica_cluster" 3 3

desc "get replica cluster services endpoints"
replica_endpoint0=$(get_service_ip ${replica_cluster}-pxc-0)
replica_endpoint1=$(get_service_ip ${replica_cluster}-pxc-1)
replica_endpoint2=$(get_service_ip ${replica_cluster}-pxc-2)
replica_primary=$(run_mysql 'SELECT @@hostname hostname;' "-h ${replica_cluster}-haproxy -p33062 -uroot -proot_password")
replica_primary=$(run_mysql 'SELECT @@hostname hostname;' "-h ${replica_cluster}-proxysql -p3306 -uroot -proot_password")
replica_primary_endpoint=$(get_service_ip ${replica_primary})

run_mysql \
'DELETE FROM myApp.myApp WHERE id=100500' \
"-h $replica_primary_endpoint -uroot -proot_password"
Expand All @@ -85,15 +84,15 @@ main() {
desc "patch replica cluster secrets with replication user"
kubectl_bin patch secret my-cluster-secrets -p '{"data":{"replication": "'$(echo -n new_password | base64)'"}}'
sleep 15
wait_cluster_consistency "$replica_cluster" 3 2
wait_cluster_consistency "$replica_cluster" 3 3

desc "Check replication works between source -> replica"
compare_mysql_cmd "select-2" "SELECT * from myApp.testSourceReplica;" "-h $replica_endpoint0 -uroot -proot_password"
compare_mysql_cmd "select-2" "SELECT * from myApp.testSourceReplica;" "-h $replica_endpoint1 -uroot -proot_password"
compare_mysql_cmd "select-2" "SELECT * from myApp.testSourceReplica;" "-h $replica_endpoint2 -uroot -proot_password"

run_backup "$replica_cluster" "backup-minio-replica"

exit 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
exit 1
exit 1

desc "Switch clusters over"
kubectl_bin config set-context $(kubectl_bin config current-context) --namespace="$namespace"

Expand Down
Loading