WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] All IDs Incrementing By 10 Instead of 1 (4 posts)

  1. Curtiss Grymala
    Member
    Posted 3 years ago #

    I've got a weird, fringe case where, on one of my sites, all of the IDs are incrementing by 10 instead of 1.

    For instance, the second site I created has an ID of 11 instead of having an ID of 2. With 501 users in our database, the ID of the most recent user is 5021. MySQL indicates that the next auto-increment ID for the table is 5022, but if I add another user, that user will end up with an ID of 5031 instead.

    This is happening wherever WordPress uses auto-incrementing IDs (site table, blogs table, users table, usermeta table, posts tables, post_meta, etc., etc.)

    At this point, I'm not extremely worried about it, as everything still seems to be working just fine; but I am concerned that once we really start pouring content and/or meta data into the database, it's remotely possible that some of the IDs will eventually reach the unsigned BIGINT limit of 4294967295 more quickly (10 times as quickly) than it normally would.

    I've tested inserting directly into MySQL from the command-line, and it still causes the issue, so I suspect that something is messed up in our SQL server somewhere, but I don't even know where to begin looking.

    If I run a SHOW CREATE TABLE query on a table that includes 3 records, I get a result that indicates the next auto-increment ID is 22 (AUTO_INCREMENT=22), but if I then run an INSERT query on that table, the ID of the inserted data will be 31 instead of 22.

    Has anyone seen this before? Anyone have any clue what might be happening?

    In case it matters, all of our database tables are using the InnoDB engine rather than MyISAM. Also, we have a virtually identical set up (the only real differences are the name of the database and the prefixes used for the WordPress tables) on another server that is working just fine.

  2. MichaelH
    Member
    Posted 3 years ago #

  3. Curtiss Grymala
    Member
    Posted 3 years ago #

    Sure enough; that's it. I have no idea how or why it got set like that. I'll talk to our sys admin to see if he did that on purpose before I change it. Thanks for the tip.

  4. Curtiss Grymala
    Member
    Posted 3 years ago #

    If anyone else happens to run into this, here's some more info about it. I talked to our sysadmin. It turns out this was, indeed, intentional. Apparently it's a method of ensuring auto-increment IDs don't conflict when you're replicating a MySQL server.

    Now I know, and knowing is half the battle. :)

Topic Closed

This topic has been closed to new replies.

About this Topic