From 1f745a1c8c14a27369f576e3c055de221c046726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavi=20Lle=C3=B3=20Tom=C3=A1s?= Date: Fri, 4 Apr 2025 13:38:56 +0200 Subject: [PATCH] db: refs #8140 - clean party --- roles/db/defaults/main.yaml | 3 +-- roles/db/files/scripts/events-demote.sh | 16 ---------------- roles/db/files/scripts/events-promote.sh | 15 --------------- 3 files changed, 1 insertion(+), 33 deletions(-) delete mode 100755 roles/db/files/scripts/events-demote.sh delete mode 100755 roles/db/files/scripts/events-promote.sh diff --git a/roles/db/defaults/main.yaml b/roles/db/defaults/main.yaml index 7dd354f..81e7852 100644 --- a/roles/db/defaults/main.yaml +++ b/roles/db/defaults/main.yaml @@ -29,8 +29,7 @@ required_mariabackup_files_and_scripts: - { src: scripts/check-memory.sh, dest: /root/scripts/check-memory.sh, mode: u=rwx,g=rx,o=rx } - { src: scripts/export-privs.sh, dest: /root/scripts/export-privs.sh, mode: u=rwx,g=rx,o=rx } - { src: scripts/mysqltuner.pl, dest: /root/scripts/mysqltuner.pl, mode: u=rwx,g=rx,o=rx } - - { src: scripts/events-promote.sh, dest: /root/scripts/events-promote.sh, mode: u=rwx,g=rx,o=rx } - - { src: scripts/events-demote.sh, dest: /root/scripts/events-demote.sh, mode: u=rwx,g=rx,o=rx } + - { src: scripts/role-change.sh, dest: /root/scripts/role-change.sh, mode: u=rwx,g=rx,o=rx } - { src: scripts/README.md, dest: /root/scripts/README.md, mode: u=rw,g=r,o=r } - { src: scripts/scheduler-log.sh, dest: /root/scripts/scheduler-log.sh, mode: u=rwx,g=rx,o=rx } configuration_files: diff --git a/roles/db/files/scripts/events-demote.sh b/roles/db/files/scripts/events-demote.sh deleted file mode 100755 index 4856f4f..0000000 --- a/roles/db/files/scripts/events-demote.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -mysql -e "SET GLOBAL event_scheduler = OFF" - -echo "SELECT db, name FROM mysql.event WHERE status = 'ENABLED'" | mysql --raw --silent | \ -awk '{ - gsub("`", "``", $1); - gsub("`", "``", $2); - print "`"$1"`.`"$2"`"; -}' | \ -while read event; do - mysql -e "ALTER EVENT $event DISABLE ON SLAVE" -done - -mysql -e "SET GLOBAL event_scheduler = ON" - diff --git a/roles/db/files/scripts/events-promote.sh b/roles/db/files/scripts/events-promote.sh deleted file mode 100755 index d4b5b9f..0000000 --- a/roles/db/files/scripts/events-promote.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -mysql -e "SET GLOBAL event_scheduler = OFF" - -echo "SELECT db, name FROM mysql.event WHERE status = 'SLAVESIDE_DISABLED'" | mysql --raw --silent | \ -awk '{ - gsub("`", "``", $1); - gsub("`", "``", $2); - print "`"$1"`.`"$2"`"; -}' | \ -while read event; do - mysql -e "ALTER EVENT $event ENABLE" -done - -mysql -e "SET GLOBAL event_scheduler = ON"