mattrogowski
Well-known member
- Affected version
- 2.2.8
If you set up a MySQL cluster for replication, the auto_increment values generated by MySQL will go up by more than 1 at a time (see auto_increment_increment) - the default (we've been told) is to increment them by 10. This means you use up IDs 10x quicker (so you'd run out of IDs at 420 million rows, not 4.2 billion).
If you have a particularly a) large, b) active, and c) long running forum, combined with the auto_increment values going up by 10 instead of 1, you will eventually (after many, many years) exhaust the IDs available for this table. Unlike the
The solution would be to change
If you have a particularly a) large, b) active, and c) long running forum, combined with the auto_increment values going up by 10 instead of 1, you will eventually (after many, many years) exhaust the IDs available for this table. Unlike the
xf_thread_view
table, xf_thread_read
is never truncated, it just has stale data deleted after the thread read cut-off period - so over time, the IDs keep growing and growing (quicker than usual when they're going up 10 at a time). When you end up reaching ID 4294967295 (which it did on a forum at 2am of all times), you will get an "out of range" error for that table. Our xf_thread_read
table currently has ~5m rows in it - as that's a 30 day rolling total, that can be extrapolated out for the number of rows created over the course of a year, and with the IDs going up 10 at a time, it's about 7 years until 420m rows are created and the IDs are exhausted.The solution would be to change
thread_read_id
to be a BIGINT. This will probably only ever affect 0.1% of forums, but considering some forums maybe have been running XF for over a decade now and could well be on a MySQL cluster after all that time, there may be some boards unknowingly creeping close to this issue. Updating the column type should stop this ever being an issue.
Last edited: