• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Server issue  Post from deleted member assigned to new member?

yoghurtfarmer

Well-known member
#1
Something odd happened. There was a spammer that posted a thread. I deleted the account but left the thread intact.

Appropriately, the post showed:

Spammer
Guest

However, today a new member signed up and now the post shows:

Username
New Member

I looked at the database and it seems that the new member was assigned a user_id that's the same as the deleted user. I believe the expected behaviour is that deleted user_ids are skipped when someone new registers. The new member registered via facebook, so maybe the user_id bug only happens with Facebook Connect?
 

Jake Bunce

XenForo moderator
Staff member
#2
I spent some time playing with this and I am unable to reproduce the problem. But I don't have a facebook account to test that registration path. Are you able to reproduce this problem yourself?

It certainly sounds like the user_id is being recycled. Maybe it's a problem with the database. You should check the definition of the xf_user.user_id field in the database to make sure it is autoincrementing and unique. Also check the auto_increment value of the table which specifies the next user_id to be used.
 

yoghurtfarmer

Well-known member
#3
phpMyAdmin shows "auto-increment" being checked. Is there a unique setting?

I scrolled through my list of users and there are some skipped user ids. Since I have deleted users in the past, I suspect the recycling is indeed unique to facebook registration. My facebook account is already registered on the forum so I can't quite test it. Is your forum online? If so I could register with my fb account.
 

yoghurtfarmer

Well-known member
#6
Was your MySQL server restarted in the middle of this?

http://mysql2.mirrors-r-us.net/doc/refman/5.1/en/innodb-auto-increment-column.html
(why that mirror beat out the MySQL docs themselves, I don't know)

It looks like that could cause it, which is something I didn't realize.
Oh, sounds like that's the reason. I'm on shared hosting and the MySQL server did go down recently. Could this also cause thread and post ids to be recycled and will there be any huge problems down the line as a result of this?
 

Mike

XenForo developer
Staff member
#7
No, this is pretty much the only situation where it might be a problem. (And changing it is part of other bigger changes that may happen down the line.) It effectively is only an issue if there is some sort of "orphaned" data (the user_id associated with the post in this case).