Improve backup resiliency #15

Merged
jlecour merged 14 commits from multi-servers-fallback into master 2019-04-03 11:54:48 +02:00
Owner

If the backup server is unreachable, zzz_evobackup falls back to the next in the list until one is available; otherwise it stops with an error.

If the backup server is unreachable, `zzz_evobackup` falls back to the next in the list until one is available; otherwise it stops with an error.
benpro reviewed 2019-04-01 11:51:52 +02:00
zzz_evobackup Outdated
@ -24,0 +24,4 @@
SERVERS="node0.backup.example.com:2XXX node1.backup.example.com:2XXX"
# timeout (in seconds) for the SSH test
SSH_CONNECT_TIMEOUT=10
Contributor

Maybe we can use a higher value. SSH connection can be really slow when the server I/O struggle.
60s?

Maybe we can use a higher value. SSH connection can be really slow when the server I/O struggle. 60s?
Contributor

Or 30s.
10s is a bit too low.

Or 30s. 10s is a bit too low.
zzz_evobackup Outdated
@ -34,0 +71,4 @@
fi
salt=$(hostname | cksum | cut -d' ' -f1)
item=$(( ($(date +%d) + salt + inc) % list_length ))
Contributor

This part is not easy to understand quickly.
Could you add some comments for test_server and pick_server, to explain what the function do precisely.
Also maybe you could use an array for the server list?

This part is not easy to understand quickly. Could you add some comments for test_server and pick_server, to explain what the function do precisely. Also maybe you could use an array for the server list?
zzz_evobackup Outdated
@ -36,2 +81,2 @@
if [ -e $PIDFILE ]; then
pid=$(cat "$PIDFILE")
PIDFILE="/var/run/evobackup.pid"
if [ -e "${PIDFILE}" ]; then
Contributor

Adding quotes and braces is not related to the PR.
I guess this is hard to refrain from "beautifying" the code. ;)

Adding quotes and braces is not related to the PR. I guess this is hard to refrain from "beautifying" the code. ;)
zzz_evobackup Outdated
@ -66,3 +99,3 @@
## OpenLDAP : example with slapcat
# slapcat -l /home/backup/ldap.bak
# slapcat -l ${LOCAL_BACKUP_DIR}/ldap.bak
Contributor

Adding variables is not related to backup resiliency. I guess this is hard to refrain from “beautifying” the code. ;)

Adding variables is not related to backup resiliency. I guess this is hard to refrain from “beautifying” the code. ;)
zzz_evobackup Outdated
@ -214,2 +266,4 @@
fi
# /!\ DO NOT USE COMMENTS in the rsync command /!\
# It breaks the command and destroys data, simply remove (or add) lines.
Contributor

Not related to resiliency. This PR should really be split.

Not related to resiliency. This PR should really be split.
Author
Owner

@benpro I've added comments, like you suggested. I've removed the LOCAL_BACKUP_DIR variable extraction.

@benpro I've added comments, like you suggested. I've removed the LOCAL_BACKUP_DIR variable extraction.
Contributor

LGTM. But some cosmetic change could be done in an other PR.
(spaces, braces, adding ", …)

LGTM. But some cosmetic change could be done in an other PR. (spaces, braces, adding `"`, …)
Author
Owner

I've removed all "cosmetic changes"

I've removed all "cosmetic changes"
Contributor

LGTM. /cc @vlaborie

LGTM. /cc @vlaborie
Ghost approved these changes 2019-04-02 16:29:42 +02:00
Ghost left a comment
First-time contributor

LGTM

LGTM
First-time contributor

LGTM

LGTM
Ghost approved these changes 2019-04-03 10:00:10 +02:00
benpro approved these changes 2019-04-03 10:06:34 +02:00
jlecour closed this pull request 2019-04-03 11:54:48 +02:00
jlecour deleted branch multi-servers-fallback 2019-04-03 11:54:55 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evobackup#15
No description provided.