Bug 30511

Summary: Don't lock entire database when dumping Koha instance
Product: Koha Reporter: Alex Buckley <alexbuckley>
Component: Command-line UtilitiesAssignee: Alex Buckley <alexbuckley>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: dcook, m.de.rooy, martin.renvoize, robin, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Attachments: Bug 30511: Don't lock up entire database while running koha-dump
Bug 30511: Don't lock up entire database while running koha-dump
Bug 30511: Don't lock up entire database while running koha-dump

Description Alex Buckley 2022-04-12 02:20:51 UTC
koha-dump should use the --single-transaction flag, like misc/cronjobs/backup.sh does. This is to avoid koha-dump locking up the whole database.

More information on the single-transaction flag can be found here: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction
Comment 1 Alex Buckley 2022-04-12 02:22:23 UTC
Created attachment 133203 [details] [review]
Bug 30511: Don't lock up entire database while running koha-dump

Test plan:
1. Apply the patch
2. Restart services
3. Run koha-dump
4. Confirm the .sql.gz and .tar.gz files are generated successfully

Sponsored-by: Catalyst IT
Comment 2 David Cook 2022-04-12 07:05:49 UTC
Created attachment 133204 [details] [review]
Bug 30511: Don't lock up entire database while running koha-dump

Test plan:
1. Apply the patch
2. Restart services
3. Run koha-dump
4. Confirm the .sql.gz and .tar.gz files are generated successfully

Sponsored-by: Catalyst IT

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 3 David Cook 2022-04-12 07:12:02 UTC
I've been using this in production for a while and it's been great.
Comment 4 Marcel de Rooy 2022-04-29 06:32:50 UTC
Created attachment 134347 [details] [review]
Bug 30511: Don't lock up entire database while running koha-dump

Test plan:
1. Apply the patch
2. Restart services
3. Run koha-dump
4. Confirm the .sql.gz and .tar.gz files are generated successfully

Sponsored-by: Catalyst IT

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2022-04-29 06:34:04 UTC
We could do so since we do no longer have a mix of InnoDB and MyISAM tables. This produces a coherent dump for InnoDB tables.
Comment 6 Fridolin Somers 2022-05-11 08:49:04 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄