Better recovery from failed flush

Bug #656516 reported by Matt Haggard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
New
Undecided
Unassigned

Bug Description

I've added a tests to a patch by marienz.

I don't know how bzr works yes, but here's the branch: https://code.launchpad.net/~magmatt/storm/recover-from-failed-flush

Revision history for this message
James Henstridge (jamesh) wrote :

What kind of flush failures are you trying to recover from?

Revision history for this message
Matt Haggard (iffy) wrote :

If you violate a database-enforced unique key. Here's the test case:

http://bazaar.launchpad.net/~magmatt/storm/recover-from-failed-flush/revision/377

And here's a short example of how to do it: http://paste.pocoo.org/show/277464/

Revision history for this message
Matt Haggard (iffy) wrote :

Oh, and the reason the end result in http://paste.pocoo.org/show/277464/ is bad is because f2 does not have an id.

Revision history for this message
James Henstridge (jamesh) wrote :

Sorry for not getting back to you on this. If you receive an IntegrityError from the database, your only recourse is to roll back the transaction and try again. For instance, with PostgreSQL I get:

  template1=# create temporary table foo (id serial primary key, bar text unique);
  CREATE TABLE
  template1=# begin;
  BEGIN
  template1=# insert into foo (bar) values ('whatever');
  INSERT 0 1
  template1=# insert into foo (bar) values ('whatever');
  ERROR: duplicate key value violates unique constraint "foo_bar_key"
  template1=# insert into foo (bar) values ('something else');
  ERROR: current transaction is aborted, commands ignored until end of transaction block
  template1=# commit;
  ROLLBACK

The face that sqlite is letting you commit after this error sounds like a bug. it isn't a mode of use we are trying to support.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.