-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YT-CC-1189] Overlay ey-backup attributes to move MySQL backup to DB slave. #280
base: next-release
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
default['db_backup']['mysql']['backup_slave'] = false | ||
# default['db_backup']['mysql']['db_slave_name'] = 'backup' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,13 @@ | |
end | ||
end | ||
|
||
if node.dna['backup_window'] != 0 && ['db_master','solo'].include?(node.dna['instance_role']) | ||
is_backup_instance = if node['db_backup']['mysql']['backup_slave'] | ||
['db_slave'].include?(node.dna['instance_role']) && node['db_backup']['mysql']['db_slave_name'] == node['dna']['name'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change means that the customer must specify the name of the replica which should run the backup. What happens if they don't? What happens if the name they specify doesn't exist? Is it possible to gracefully fall back to the same behaviour as PostgreSQL in either of those cases, and just choose the first replica? (If so then it would be good to have this behaviour for both, and simply set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Obviously we would rename the variables if we were making this more general. |
||
else | ||
['db_master','solo'].include?(node.dna['instance_role']) | ||
end | ||
|
||
if node.dna['backup_window'] != 0 && is_backup_instance | ||
encryption_command = @encryption_command | ||
backup_command = "eybackup -e mysql #{encryption_command} >> /var/log/eybackup.log 2>&1" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DB Backup in Slave (MySQL only) | ||
|
||
This example contains a complete `cookbooks/` directory that you can use on the stable-v5 stack that will override the backup location of MySQL, moving it from the DB Master to a DB Slave named "backup". |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
default['db_backup']['mysql']['backup_slave'] = true | ||
default['db_backup']['mysql']['db_slave_name'] = 'backup' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a minute to get my head around this. Would it be clearer to assign
is_backup_instance
explicitly in the two different cases, rather than assigning the result of the if statement? (It would have been clearer to me :D )