Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,22 @@ for CELL in $(echo $CELLS); do
done
----

. Wait for the `mariadb-copy-data` pod to reach the podified MariaDB:
+
----
$ oc rsh mariadb-copy-data mysql -rsh "${PODIFIED_MARIADB_IP['super']}" \
-uroot -p"${PODIFIED_DB_ROOT_PASSWORD['super']}" -e 'select 1;'
----
+
[NOTE]
====
For BGP-enabled environments, this command might take a few moments to succeed while BGP routes are advertised and propagated through the network. The `mariadb-copy-data` pod needs to receive the route to the podified MariaDB IP address through BGP before it can establish a connection. If the command fails, wait a few seconds and retry. The connection should succeed once the BGP route advertisement is complete.

Comment thread
klgill marked this conversation as resolved.
For IPv6 environments, this command might take a few moments to succeed while the network IPv6 stack completes its setup. If the command fails, wait a few seconds and retry.

For standard deployments, such as non-BGP deployments or IPv4 deployments, this command should succeed immediately.
====

. Test the connection to the control plane upcall and cells databases:
+
----
Expand Down
3 changes: 0 additions & 3 deletions tests/roles/common_defaults/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ octavia_adoption: true
# dataplane_adoption and development_environment
prelaunch_octavia_workload: false

# MariaDB client connection timeout in seconds
# Related to OSPRH-18618
mariadb_client_timeout: 0
mariadbcheck: true

# Whether bgp is configured
Expand Down
22 changes: 12 additions & 10 deletions tests/roles/mariadb_copy/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,18 @@
retries: 25
delay: "{{ mariadb_retry_delay }}"

# MariaDB client connection timeout in seconds
# Related to OSPRH-18618
- name: Add sleep time
ansible.builtin.pause:
seconds: "{{ mariadb_client_timeout }}"

- name: wait bgp
when: bgp
ansible.builtin.pause:
seconds: 60
Comment thread
jistr marked this conversation as resolved.
- name: wait until podified MariaDB is reachable
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ oc_header }}
{{ mariadb_copy_shell_vars_dst }}
oc rsh mariadb-copy-data mysql -rsh "${PODIFIED_MARIADB_IP['super']}" \
-uroot -p"${PODIFIED_DB_ROOT_PASSWORD['super']}" -e 'select 1;'
register: _podified_db_check
retries: 60
delay: 3
until: _podified_db_check.rc == 0
changed_when: false

- name: check that the Galera database cluster(s) members are online and synced, for all cells
no_log: "{{ use_no_log }}"
Expand Down
4 changes: 2 additions & 2 deletions tests/roles/mariadb_copy/templates/pre_checks.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

# Test the connection to the control plane "upcall" and cells' databases
for CELL in $(echo "super $RENAMED_CELLS"); do
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \
bash -c "sleep {{ mariadb_client_timeout }} && mysql -rsh \"${PODIFIED_MARIADB_IP[$CELL]}\" -uroot -p\"${PODIFIED_DB_ROOT_PASSWORD[$CELL]}\" -e 'SHOW databases;'"
oc rsh mariadb-copy-data mysql -rsh "${PODIFIED_MARIADB_IP[$CELL]}" \
-uroot -p"${PODIFIED_DB_ROOT_PASSWORD[$CELL]}" -e 'SHOW databases;'
done
Loading