diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml
index 0c36e42fa8752a21572bd7d477d7e71a72169c89..88324d54b5e40150fb4b9f9050f4614a4dfcc835 100644
--- a/ansible/roles/mariadb/tasks/recover_cluster.yml
+++ b/ansible/roles/mariadb/tasks/recover_cluster.yml
@@ -49,7 +49,7 @@
     # WSREP: Recovered position: <UUID>:<seqno>.
     - name: Get MariaDB wsrep recovery seqno
       become: true
-      shell: tail -n 200 /tmp/mariadb_tmp.log | awk -F" " '$0~/Recovered position/{print $NF;exit;}' | awk -F":" '{print $2}'
+      shell: awk -F" " '/Recovered position/{seqno=$NF} END{split(seqno, a, ":"); print a[2]}' /tmp/mariadb_tmp.log
       register: wsrep_recovery_seqno
 
     - name: Removing MariaDB log file from /tmp
diff --git a/releasenotes/notes/fix_mariadb_cluster_recovery-1a48db23cb99d4c0.yaml b/releasenotes/notes/fix_mariadb_cluster_recovery-1a48db23cb99d4c0.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..1775a99afc5c5027709dd797674bc67c2ca58993
--- /dev/null
+++ b/releasenotes/notes/fix_mariadb_cluster_recovery-1a48db23cb99d4c0.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+  - |
+    Fixed an issue where the MariaDB Cluster recovery process would fail if the
+    sequence number was not found in the logs. The recovery process now checks
+    the complete log file for the sequence number and recovers the cluster.
+    See `LP#1821173 <https://bugs.launchpad.net/kolla-ansible/+bug/1821173>`__
+    for details.