Summary

Performing a full Controller upgrade, an upgrade of MySQL, or changing the database configuration in db.cnf (through the Enterprise Console) may cause mysqld to crash at shutdown, potentially resulting in data corruption and/or loss.

The crash is due to a known MySQL bug, MySQL Bug #95285 which results in mysqld_safe performing an unexpected restart of mysqld. Processes performing a MySQL shutdown expect it to be down and subsequent operations based on that expectation can cause MySQL corruption. For example:

Affected Software

On-premises Controllers with MySQL v5.7.26 or higher (see the database.log banner)

Workaround

You must apply the Oracle workaround, particularly if you plan on performing an upgrade.


For a Standalone Controller

Before you start this procedure, you must take the system down because a Controller restart is required. 

  1. Perform a backup of <Controller Home>/db/db.cnf, enter:

    cp <Controller Home>/db/db.cnf <Controller Home>/db/db.cnf.pre-oracle-patch
  2. Oracle has provided a configuration change to prevent the crash during shutdown.
    1. If not present, add or update the value in <Controller Home>/db/db.cnf.
    2. Change internal_tmp_disk_storage_engine=INNODB to internal_tmp_disk_storage_engine=MYISAM.
  3. Shut down the Controller App Server, enter:

    <Controller Home>/bin/controller.sh stop-appserver 
  4. Shut down the Controller database, enter:

    <Controller Home>/bin/controller.sh stop-db
  5. Verify that the database is stopped by checking the process, enter:

    ps -ef | grep mysqld
  6. Add or update the configuration from the Enterprise Console UI so that the values will persist during upgrades.
    1. If not present, add or update the value in <Controller Home>/db/db.cnf.
    2. Change internal_tmp_disk_storage_engine=INNODB to internal_tmp_disk_storage_engine=MYISAM.
    3. Select Save to start the database and the Controller.  
  7. Update the Enterprise Controller to the latest version.
  8. Upgrade the Controller. 

For an HA Controller

Before you start this procedure, you must take the system down because a Controller restart is required. 

  1. Perform a backup of <Controller Home>/db/db.cnf on both servers, enter:

    cp <Controller Home>/db/db.cnf <Controller Home>/db/db.cnf.pre-oracle-patch
  2. Oracle has provided a configuration change to prevent the crash during shutdown.
    1. If not present, add or update the value in <Controller Home>/db/db.cnf.
    2. Change internal_tmp_disk_storage_engine=INNODB to internal_tmp_disk_storage_engine=MYISAM.
  3. Restart the secondary database. To stop the secondary database, enter:

    <Controller Home>/bin/controller.sh stop-db
  4. Verify that the secondary database is stopped by checking the process, enter:

    ps -ef | grep mysqld
  5. Start the secondary database, enter:

    <Controller Home>/bin/controller.sh start-db
  6. If running on the secondary database, stop the Watchdog. 
  7. On the primary, shut down the Controller App Server, enter:

    <Controller Home>/bin/controller.sh stop-appserver 
  8. Shut down the primary database. To stop the primary database, enter:

    <Controller Home>/bin/controller.sh stop-db
  9. Verify that the primary database is stopped by checking the process, enter:

    ps -ef | grep mysqld
  10. Add or update the configuration from the Enterprise Console UI so that the values will persist during upgrades.
    1. If not present, add or update the value in <Controller Home>/db/db.cnf.
    2. Change internal_tmp_disk_storage_engine=INNODB to internal_tmp_disk_storage_engine=MYISAM.
    3. Select Save to start the database and the Controller.  
  11. Update the Enterprise Controller to the latest version.
  12. Upgrade the Controller. 


Resolution

AppDynamics is actively working on wrapper code for the shutdown procedure as a fix until Oracle issues a long-term solution.

Revision History

05/05/2020, v1 (initial publication of this advisory)