Jump to content

Fast-import and changeset numbering bug


mvdzwaan

Recommended Posts

After some initial troubles getting our plastic 3...(32) repositories to plastic 4 (see other thread) my final fast-export + fast-import scripts are working fine. I get correctly processed messages on all repositories and everything seems fine when showing branch explorer, branches, changesets and items.

However when I checkin a new changeset is created with changeset id 1, instead of (lastid+1).

If I look in my rep database, in the table changeset I see

iobjid ichangesetid fidbranch fidrootrevision iparentid scomplete

5 0 3 4 -1 T

111 1 3 63 0 T

124 2 3 116 1 T

... and so on...

6214 142 3 6202 141 T

6225 1 3 6217 142 T

This leads to all kinds of strange behaviour within Plastic.

It seems plastic uses a per repository 'last-changeset-id' somewhere (have looked but did not find) to get the next changeset number, and this variable is not set on fast-import.

Is there a fix for this ? Either a fast-import fix, or a way to fix this within the database itself ?

Link to comment
Share on other sites

On start up plastic will calculate the "last cset" and use it to work with...

It does a "select max" to get it. :?

That would be the correct way to implement it in this database (as per the db independency you don't use constraints/identity etc.). But as the copy/paste of my changesets table shows this appears not to be the case.

Maybe the select max(ichangesetid) has additional where statements which have not met by the imported changesets ?

Link to comment
Share on other sites

  • 4 weeks later...

This issue is not fixed in version 4.0.237.7.

On start up plastic will calculate the "last cset" and use it to work with...

It does a "select max" to get it. :?

The key here is "on startup"... Following workaround did it for me:

  1. fast import your repository
  2. restart your plastic server
  3. checkins will create correct changeset numbers

Link to comment
Share on other sites

This issue is not fixed in version 4.0.237.7.

The key here is "on startup"... Following workaround did it for me:

  1. fast import your repository
  2. restart your plastic server
  3. checkins will create correct changeset numbers

I will give this a try this weekend, would be great if this is the solution (I do not doubt you but still have to test it myself).

It would also allow for an easy explanation. The plastic server does use the select max statement as psantosl mentioned but only does this on startup and than keep a cached variable for the new changeset number.

In any case, thank you very much !

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...