@Override
  public void onAlterDatabase(AlterDatabaseEvent dbEvent) throws MetaException {
    Database oldDb = dbEvent.getOldDatabase();
    Database newDb = dbEvent.getNewDatabase();
    if (!oldDb.getCatalogName().equalsIgnoreCase(newDb.getCatalogName()) ||
        !oldDb.getName().equalsIgnoreCase(newDb.getName())) {
      txnHandler = getTxnHandler();
      txnHandler.onRename(
          oldDb.getCatalogName(), oldDb.getName(), null, null,
          newDb.getCatalogName(), newDb.getName(), null, null);
    }
  }
It handles cleanup of dropped partition/table/database in ACID related metastore tables
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java