[keyserver] Limit mysqldump backup queries to 0.5 MiB
Summary:
I was seeing a very strange issue where restores of mysqldump backups would fail to correctly restore two specific rows in the notifications table, causing the delivery column to become corrupted.
After extensive testing spanning multiple days, I found two ways to avoid the problem:
- This fix, wherein we limit the number of rows in each INSERT.
- Deleting the SET FOREIGN_KEY_CHECKS=0 line that gets automatically inserted at the top of the backup file by mysqldump.
I can't tell why the second option works and there's no way to configure mysqldump to prevent it from spitting out that line. We can remove it after-the-fact but that would be more work.
On the other hand, this solution is simple and "just works".
Test Plan:
- I patched the change on my production keyserver and generated a backup from there
- I downloaded the backup to my laptop and restored it
- I then generated a second backup (with the change) on my laptop
- Finally I restored the second backup on my laptop, confirming there was no corruption and that everything worked
Reviewers: atul, tomek
Reviewed By: tomek
Subscribers: adrian, abosh
Differential Revision: https://phab.comm.dev/D4642