
rolfm at denison
Jan 21, 2009, 9:15 AM
Views: 7064
Permalink
|
Well, we've got the first error message from a story version being corrupted thanks to our new unique key index on story instance. The scenerio: A person checked in a story. The check in failed in some manner, as it is still on their workflow. If you go to the desk, there is a button that claims it can be checked out. Attempting to check it out results in this error in the logs Unable to execute SQL statement: DBD::Pg::st execute failed: ERROR: duplicate key violates unique constraint "udx_story__story_instance"\n [.for Statement "INSERT INTO story_instance (id, name, description, story__id, version, usr__id, primary_oc__id, slug, cover_date, note, checked_out)VALUES (NEXTVAL('seq_story_instance'), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" with ParamValues: 6='1', 3='7616', 7='Overview', 9=undef, 2='', 8='2007-06-20 19:15:00', 1='Overview', 4='11', 10='1', 5='1029'] at / usr/local/bricolage/lib/Bric/Util/DBI.pm line 1087, <GEN1620> line 68.\n [/usr/local/bricolage/lib/Bric/Util/DBI.pm:1088] Which makes sense. Go to the story instance table, though, and we see this: id | name | description | story__id | version | usr__id | slug | primary_oc__id | cover_date | note | checked_out ... 73198 | Overview | | 7616 | 7 | 1366 | Overview | 1 | 2007-06-20 19:15:00 | | f 73304 | Overview | | 7616 | 8 | 1366 | Overview | 1 | 2007-06-20 19:15:00 | | f 90836 | Overview | | 7616 | 9 | 1312 | Overview | 1 | 2007-06-20 19:15:00 | | f 101200 | Overview | | 7616 | 10 | 1312 | Overview | 1 | 2007-06-20 19:15:00 | | f 101212 | Overview | | 7616 | 11 | 1312 | Overview | 1 | 2007-06-20 19:15:00 | | f 101799 | Overview | | 7616 | 11 | 1312 | Overview | 1 | 2007-06-20 19:15:00 | | t Now we actually have lots of stories that look like this - 435 to be exact. Most of the time it means that the latest version is being worked on, and hasn't been checked in yet. But you've got the database creating a new record with the same version when a story is checked out, and then incrementing that on checkin. Maybe that is part of the problem here, and it would be better to increment the version number on the initial check out - maybe it would help prevent this sort of thing. But I'm not sure why the checkin partially works, but leaves a version on her workspace and doesn't increment the version number. What do other people think? -Matt
|