How to troubleshoot the following BACKUP DATABASE error:
ERROR: Failed taking a distributed backup for database `test_db` to directory `my/backup/dir` failed with (2482:An operation timed out after 180 seconds waiting on the global cluster operation lock. Use SHOW PROCESSLIST to investigate long running concurrent operation, or consider increasing the value of default_distributed_ddl_timeout.)
If a BACKUP DATABASE command is issued and fails, a long-running cluster operation took the global lock, preventing the backup from kicking off successfully.
- Use SHOW PROCESSLIST to investigate long-running concurrent operations.
- Confirm there are no long-running concurrent operations and try running the backup once more.
- Consult the Operations that Take Either a Database or a Cluster Lock documentation for more information on what these locks are, their impact and the operations that use them.
- Consider raising
default_distributed_ddl_timeoutto a higher value.
default_distributed_ddl_timeoutis the time in milliseconds to wait for a distributed DDL transaction to commit. This value sets the timeout for both ALTER TABLE and BACKUP commands. If the timeout is reached, the transaction is rolled back. This variable can sync to all aggregators and all leaves.
- More information on the
default_distributed_ddl_timeoutvariable can be found in the Long-Running Queries Blocking DDL Operations and Workload documentation.