XF 2.3 mariadb-dump: Error 1412: Table definition has changed

karll

Well-known member
I have an OS cron job that takes a backup of my XF database every day. This has worked flawlessly from the beginning.

However, today the cron job ran into an error which has made me concerned:
mariadb-dump: Error 1412: Table definition has changed, please retry transaction when dumping table xf_thread_view at row: 0

This seems to imply that the table definition was changed while the backup was running. I believe this could be caused by either an "ALTER TABLE" or a "TRUNCATE" SQL statement.

I've checked with XF Support via a ticket, and they have told me that XF itself does not run any ALTER TABLE or TRUNCATE statements against that table expect maybe during upgrades.

No one was logged into the adminCP at the time. No upgrades or anything like that should be running. The only thing I can think of would be XF/add-on cron jobs.

I have XFES and Xon's Search Improvements add-on, as well as a handful of other add-ons.

Has anyone else run into this problem? Or have any clue what could be wrong?
 
This table is actually truncated by a cron task every 15 minutes. The data is ephemeral so you can likely exclude it from backups without issue.
 
You can set the table clear method to delete from the default of truncate, which will also resolve this.
That sounds like a good solution, could you possibly provide some more details about this? Which XF cron job is it? And are you saying I could change the cron callback? If so, to which method?
 
I added this to the config and ran a backup to test and still had the same error. Can I ignore this table during the mysqldump to avoid the error... if so, when I do an import of the backup if I ever have to restore, will it give me an error that the table doesn't exist, or will it be created by the cron job?
 
Back
Top Bottom