Issue Id Numbers are Skipping Numbers

Topics: Core, General
Jul 16, 2013 at 8:34 PM
Have been using BugNet for a while now and we are seeing that randomly the issue Id number is jumping around. Not sure what would cause this but we are a little worried the number could be deleted as easily as they are begin skipped. Any advice or thought would be a great help.

Example below:
These tickets do NOT exist but the numbers before and after the number ranges do…Any idea what’s going on?
996-1988
2005-2988
2999-3993

thanks!
Brittany
Jul 17, 2013 at 6:54 PM
Do you have other projects configured? The Issue Id is a continuous number that is shared across all projects.
Jul 17, 2013 at 8:56 PM
Yes we have about 20 different projects but no where never 4000 issues entered. I just added a few issues and the issue number is now up to 4997. I don't understand why it would jump around so much. Is there a cap on the issue number you can reach? My fear is we are going to run into issues with the issue id number because of the randomness.

Thanks!
Jul 18, 2013 at 1:30 AM
BrittParsons wrote:
Yes we have about 20 different projects but no where never 4000 issues entered. I just added a few issues and the issue number is now up to 4997. I don't understand why it would jump around so much. Is there a cap on the issue number you can reach? My fear is we are going to run into issues with the issue id number because of the randomness.

Thanks!
This does sound a bit fishy. Can you look at the database , specifically the issues view and see what the data looks like?
Jul 19, 2013 at 6:39 PM
Nothing weird in the data but it seems like every time we have upgrade the server it is on the numbers have jumped. Does that make sense to you?

Thanks,
Brittany
Jul 19, 2013 at 7:36 PM
So the data was sequential in the database or were there missing Id's as well?
Jul 25, 2013 at 9:07 PM
They are not sequential in the database the ID's were missing. Thanks!
Nov 7, 2014 at 7:14 PM
We also ran into this issue and I finally got to the bottom of it. We recently (since May 2014) had three jumps in Issue IDs.

3385 -> 4385
4442 -> 5440
5476 -> 6475

It turns out this is because we migrated to SQL Server 2012. This is a new "feature". This forum post "Primary key auto incrementing by 1000 instead of 1" informed me that when SQL Server 2012 restarts it skips/jumps Identities ahead. See: Failover or Restart Results in Reseed of Identity. Apparently this was on purpose and is not going away.

The quick fix is to add a -t272 startup parameter to SQL Serve. This walk through shows how but it incorrectly shows a capital T and that will not work. Again, you must use "-t272" not "-T272".

The long term fix would be to not use the primary key/identity as the Issue Id. To help with this MS finally added sequences to SQL 2012 and they have a NO CACHE option to prevent this specific behavior. Of course, if you are going to support older versions of SQL Server things get more complicated.

MS FAIL
Nov 12, 2014 at 6:17 PM
Yikes, thank you for your investigation. This is very dis-concerning not just for this app but other applications I have built as well. We will have to keep this in mind when making future changes to the db schema.