Skip to content

Commit

Permalink
Merge pull request #164 from aiven/packi-also-skip-on-duplicate-enums
Browse files Browse the repository at this point in the history
Skip rebuilding tables on duplicate enum values
  • Loading branch information
alexole authored Jul 11, 2023
2 parents 0c13519 + 08f44ca commit 15d3ac9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions myhoard/restore_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,13 @@ def rebuild_tables(self) -> None:
raise
except pymysql.err.OperationalError as e:
# ERROR 1148: The used command is not allowed with this MySQL version
if e.args[0] == 1148:
# This happens for some tables which are marked as using InnoDB but are actually not
# normal tables (like mysql.innodb_index_stats and mysql.innodb_table_stats).
# The known ones are already skipped but if we encounter more, we just skip them.
# This happens for some tables which are marked as using InnoDB but are actually not
# normal tables (like mysql.innodb_index_stats and mysql.innodb_table_stats).
# The known ones are already skipped but if we encounter more, we just skip them.
#
# ERROR 1291: Column '<colname>' has duplicate value '<value' in ENUM
# Seems like an issue with user-data when rebuilding tables.
if e.args[0] in (1148, 1291):
self.log.error("Could not rebuild %s, error: %s, skipping it", escaped_table_designator, str(e))
else:
raise
Expand Down

0 comments on commit 15d3ac9

Please sign in to comment.