Allow setting of RandomizedDelaySec for backup systemd timers

By allowing for a random delay for the OnCalendar timers it's possible
to run backups on multiple nodes without having them happen at the exact
same time. By omitting the option by default the current behavior remains
unchanged.

Change-Id: I005cf8ba94ab043d7075039975d5f0bc250f9187
This commit is contained in:
Christian Rohmann 2022-09-01 10:13:25 +02:00
parent a5835fd611
commit ae0e53a9be
3 changed files with 11 additions and 0 deletions

View File

@ -299,10 +299,12 @@ galera_mariadb_backups_group_name: backups
galera_mariadb_backups_path: "/var/backup/mariadb_backups"
galera_mariadb_backups_full_copies: 2
galera_mariadb_backups_full_on_calendar: "*-*-* 00:00:00"
#galera_mariadb_backups_full_randomized_delay_sec: <timespan to randomize the full backup timer by>
galera_mariadb_backups_increment_on_calendar:
- "*-*-* 06:00:00"
- "*-*-* 12:00:00"
- "*-*-* 18:00:00"
#galera_mariadb_backups_incremental_randomized_delay_sec: <timespan to randomize the incremental backup timer by>
#galera_mariadb_backups_user is the name of the mariadb database user
galera_mariadb_backups_user: galera_mariadb_backup
galera_mariadb_backups_suffix: "{{ inventory_hostname }}"

View File

@ -0,0 +1,7 @@
---
features:
- Add parameters ``galera_mariadb_backups_full_randomized_delay_sec`` and
``galera_mariadb_backups_incremental_randomized_delay_sec`` to run the
systemd timers for mariabackup with a randomized delay. This is useful if
backups are done of more than one node to avoid running it at the exact
same time.

View File

@ -48,6 +48,7 @@
state: "started"
options:
OnCalendar: "{{ galera_mariadb_backups_full_on_calendar }}"
RandomizedDelaySec: "{{ galera_mariadb_backups_full_randomized_delay_sec | default(omit) }}"
Persistent: true
Unit: "mariabackup-full.service"
@ -74,6 +75,7 @@
state: "started"
options:
OnCalendar: "{{ galera_mariadb_backups_increment_on_calendar }}"
RandomizedDelaySec: "{{ galera_mariadb_backups_increment_randomized_delay_sec | default(omit) }}"
Persistent: true
Unit: "mariabackup-increment.service"
when: galera_mariadb_backups_increment_on_calendar is defined