Skip to content
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

'--single-transaction' flag added to mysql backup generation command #373

Closed
wants to merge 4 commits into from
Closed

'--single-transaction' flag added to mysql backup generation command #373

wants to merge 4 commits into from

Conversation

jerinpetergeorge
Copy link
Contributor

Fixes #372

@jonathan-s
Copy link
Contributor

Thanks for making this. I think it would be worthwhile to write about this in the documentation that this indeed is happening. Linking to the dba post would be good to do as well.

@jerinpetergeorge
Copy link
Contributor Author

@jonathan-s I have updated the PR with a few changes. Could you review these changes?

@jonathan-s
Copy link
Contributor

jonathan-s commented Dec 2, 2020

Thank you for making an update!

Given that --single-transaction only works for one storage in mysql it sounds like it would make more sense for that to be False by default.

Assume that you were using a two different storage engines in mysql and you dumped both databases at the same time. If you included the flag would you get a fatal error? Or would it just ignore the flag for the engine that didn't support it?

Lastly, a question regarding ergonomics, right now you've defined it as setting. Given that this flag is something you might want to use on certain supported databases in MySQL would make more sense to put this flag on the command itself?

Ie here -> https://github.com/django-dbbackup/django-dbbackup/blob/master/dbbackup/management/commands/dbbackup.py#L21-L37

@jerinpetergeorge
Copy link
Contributor Author

Assume that you were using a two different storage engines in mysql and you dumped both databases at the same time. If you included the flag would you get a fatal error? Or would it just ignore the flag for the engine that didn't support it?

I have done a few tests on my local machine and it seems MySQL isn't raising any error or unexpected behavior while using the --single-transaction flag in other engines. This leads me to believe that Mysql simply ignoring the flag if we are using it in a different, un-supported engine.


The rest of your arguments are seemed good to me, will do the necessary changes asap.

@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #373 (d92ddec) into master (246c1dd) will decrease coverage by 0.71%.
The diff coverage is 22.22%.

@@            Coverage Diff             @@
##           master     #373      +/-   ##
==========================================
- Coverage   90.87%   90.16%   -0.72%     
==========================================
  Files          19       19              
  Lines         855      864       +9     
  Branches      173      176       +3     
==========================================
+ Hits          777      779       +2     
- Misses         42       47       +5     
- Partials       36       38       +2     
Impacted Files Coverage Δ
dbbackup/apps.py 100.00% <ø> (ø)
dbbackup/checks.py 80.64% <14.28%> (-19.36%) ⬇️
dbbackup/db/mysql.py 96.96% <50.00%> (-3.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 246c1dd...d92ddec. Read the comment docs.

@Archmonger Archmonger marked this pull request as draft May 4, 2022 07:39
@jerinpetergeorge jerinpetergeorge closed this by deleting the head repository Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MySQL backup freezing on active connection
3 participants