Question

"Waiting for backup lock" when altering table in managed MySQL database

I’m trying to run a migration and the process for an alter table command is locked with show processlist giving its state as Waiting for backup lock

The text seems kind of self explanatory, there must be a backup happening.

Unfortunately I can’t see anything in the control panel that refers to backups, such as what time they happen, logs of how long they take or anyway to be able to identify if one is happening.

How can I change when backups occur?

How can I know if a backup is running before attempting to run some code so I don’t hit this problem again?


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 18, 2023

Hi there,

To verify if this was indeed a backup, you can use the DigitalOcean API and send a GET request to /v2/databases/$DATABASE_ID/backups which will return a list of your database backups and the time they were created:

https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_list_backups

What you could also do is to change your maintenance window by sending a PUT request to /v2/databases/$DATABASE_ID/maintenance:

https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_update_firewall_rules

Hope that this helps!

Best,

Bobby