Hi Leandro,
To use of Sequoia + Postgres + sequence you may have the follow problem that I discovery today:

When you make a insert that use sequence in Postgres, and the insert fail, the sequence increment will never rollback.
A solution is to access the sequence in a separate statement since PostgreSQL does not execute the entire statement atomically (the sequence is updated first and the overall statement fails after).

Another option is to change the code in RecoverThread line 345:
     if (!LogEntry.SUCCESS.equals(recoveryTask.getStatus()))
{ // Ignore failed queries unless they are stored procedures that could
       // have some side effect
       if (!(abstractTask.getRequest() instanceof StoredProcedure))
       {
         logIdx++;
         continue;
       }
     }

Instead of just trying to replay stored procedures, you can replay everthing (remove the test) or check if the SQL contains any access to a sequence (PostgreSQL specific code).

You might want to file a JIRA issue for this problem with your scenario.

Thanks again for your feedback,
Emmanuel

--
Emmanuel Cecchet
Chief Scientific Officer, Continuent

Blog: http://emanux.blogspot.com/
Open source: http://www.continuent.org
Corporate: http://www.continuent.com
Skype: emmanuel_cecchet
Cell: +33 687 342 685


_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to