Skip to content

Commit

Permalink
Fix mariadb recover seqnum regex
Browse files Browse the repository at this point in the history
Regex used to find the recover seqnum partition is not
returning the real num id rather a None.
Task fails due seqnum[0] is not iterable.

Change-Id: I1be55b6ebfc17c6d423e638662ec2a9f4b9b49a2
Closes-Bug: #1752128
(cherry picked from commit 8a63c80)
  • Loading branch information
xNaaro committed Apr 17, 2018
1 parent 3299d18 commit 41596e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ansible/roles/mariadb/tasks/recover_cluster.yml
Expand Up @@ -43,7 +43,7 @@
shell: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log"

- name: Get MariaDB wsrep recovery seqno
shell: "tail -n 200 /tmp/mariadb_tmp.log | grep Recovered | tail -1 | awk '{print $7}' | awk -F'\n' '{print $1}' | awk -F':' '{print $2}'"
shell: tail -n 200 /tmp/mariadb_tmp.log | awk -F" " '$0~/Recovered position/{print $NF;exit;}' | awk -F":" '{print $1}'
register: wsrep_recovery_seqno

- name: Removing MariaDB log file from /tmp
Expand Down

1 comment on commit 41596e3

@fat8701
Copy link

@fat8701 fat8701 commented on 41596e3 Mar 4, 2019

Choose a reason for hiding this comment

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

hello,
shell: tail -n 200 /tmp/mariadb_tmp.log | awk -F" " '$0~/Recovered position/{print $NF;exit;}' | awk -F":" '{print $1}'
did this caught the uuid not the seqno?
tail -n 200 /tmp/mariadb_tmp.log | grep Recovered | tail -1 | awk '{print $7}' | awk -F'\n' '{print $1}' | awk -F':' '{print $2}' is useful for me.
if the mariadb restart several times, tail -n 200 may get old&wrong seqno, tail -1 is necessary to get the new&right seqno.

Please sign in to comment.