MySQL for Tanzu Application Service fails to backup with error code, "exit status 2"
search cancel

MySQL for Tanzu Application Service fails to backup with error code, "exit status 2"

book

Article ID: 374138

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

When creating a backup of MySQL for Tanzu Application Service, the "cf adbr" command might fail with the following error messages:

[ERROR] 20##/##/## ##:##:## backup.go:125: failed to get backup artifact: failed to execute command: /var/vcap/jobs/streaming-mysql-backup-client/bin/client: exit status 2

Cause

There are several reasons which can cause the backup failure. One of the possibilities is that an optimized DDL operation is being performed and the backup tool is not able to make a consistent backup. We can see the following error message under such a scenario.

{"timestamp":"1722######.980981350","source":"/var/vcap/packages/streaming-mysql-backup-tool/bin/streaming-mysql-backup-tool","message":"/var/vcap/packages/streaming-mysql-backup-tool/bin/streaming-mysql-backup-tool.xtrabackup","log_level":2,"data":{"error":"InnoDB: Last flushed lsn: 103001270###### load_index lsn 103001309######\nInnoDB: An optimized (without redo logging) DDL operation has been performed. All modified pages may not have been flushed to the disk yet. \nPXB will not be able to make a consistent backup. Retry the backup operation\n"}}

Resolution

This limitation is documented in the MySQL Percona document, How to deal with skipping of redo logs for DDL operations?

There are two options listed in this document. However, they are not supported by the cf adbr plug-in. The current recommendation is to avoid executing DDL statements during the backup activity.

DDL(Data Definition Language) actually consists of the SQL commands that can be used to define the database schema. DDL allows to add / modify / delete the logical structures which contain the data or which allow users to access / maintain the data (databases, tables, keys, views…).