Dear Sequoia Developers,
I have a single Virtual DB distributed over two (or more) controllers.
During the
installation / upgrade procedures the VDB configuration is loaded into
one of the
controllers with the 'init' flag so that any recovery log present will
be cleared.
Unfortunately if the Recovery Log is freshly created a 'Duplicate Key'
SQL Exception
is thrown during the VDB loading. This is due tot he Recovery Log
creation methods
inserting the 'last man down' flag into the newly created CHECKPOINT
table and later
the VDB XML parser does the same because the 'init' flag is set.
Although the workaround is obvious - delete the Recovery Log before
loading the VDB
XML with the 'init' - this is for me a bit horrible.
Below is a suggested patch to the database parser to first clear the
'last man down'
flag before setting it. It seems to work in all situations that I've
tried so far.
I am 'barking up the wrong tree' on this or should I go ahead and create
a JIRA
issue??
Many Thanks in Advance,
Nick Smith
p.s. How does one get commit access to the CVS repository?
diff -c DatabasesParser.java DatabasesParser.java.orig
*** DatabasesParser.java Mon Oct 22 15:24:30 2007
--- DatabasesParser.java.orig Mon Oct 22 15:24:59 2007
***************
*** 696,702 ****
}
if (forceload)
{
- recoveryLog.clearLastManDown();
recoveryLog.setLastManDown();
}
if (currentVirtualDatabase instanceof
DistributedVirtualDatabase)
--- 696,701 ----
Excerpt from the full_cluster.log file
--------------------------------------
2007-10-22 15:07:13,950 INFO controller.core.Controller Loading
configuration file: /apps/rwds/rwds2.0.2.rrg/xpe/config/controller.xml
2007-10-22 15:07:14,258 INFO controller.core.Controller JMX is enabled
2007-10-22 15:07:14,513 INFO controller.core.Controller Starting JMX
server on host: lotus.techop.ch
2007-10-22 15:07:15,222 INFO controller.core.Controller Waiting for
connections on 192.168.204.34:25322
2007-10-22 15:07:15,230 INFO controller.core.Controller Controller
started on 2007.10.22 43 at 03:07:15 PM CEST
2007-10-22 15:07:15,231 INFO controller.core.Controller Controller
lotus.techop.ch:25322 ready, listening to requests ...
2007-10-22 15:07:47,009 INFO controller.backup.BackupManager
Registering backuper DerbyEmbeddedBackuper to handle format Derby
embedded compressed dump
2007-10-22 15:07:47,129 INFO DatabaseBackend.rwds.lotus-db1 Adding
connection manager for virtual user "rwds"
2007-10-22 15:07:47,163 INFO DatabaseBackend.rwds.lotus-db2 Adding
connection manager for virtual user "rwds"
2007-10-22 15:08:00,673 INFO sequoia.controller.recoverylog Creating
recovery log table: RECOVERY
2007-10-22 15:08:01,170 INFO sequoia.controller.recoverylog Creating
checkpoint table: CHECKPOINT
2007-10-22 15:08:01,526 INFO sequoia.controller.recoverylog Creating
backend table: BACKEND
2007-10-22 15:08:01,610 INFO sequoia.controller.recoverylog Creating
dump table: DUMP
2007-10-22 15:08:02,295 INFO controller.RequestManager.rwds Request
manager will parse requests with the following granularity: TABLE
2007-10-22 15:08:02,390 ERROR controller.jmx.MBeanServer Register mbean
of type
sequoia:VirtualDataBase=rwds,type=VirtualDataBase.RequestManager.ParsingCache
failed with error
sequoia:type=VirtualDataBase.RequestManager.ParsingCache,VirtualDataBase=rwds
({2})
2007-10-22 15:08:02,486 ERROR controller.xml.DatabasesParser The virtual
database rwds could not be added to the controller (because of The
statement was aborted because it would have caused a duplicate key value
in a unique or primary key constraint or unique index identified by
'SQL071022150801170' defined on 'CHECKPOINT'.)
java.sql.SQLException: The statement was aborted because it would have
caused a duplicate key value in a unique or primary key constraint or
unique index identified by 'SQL071022150801170' defined on 'CHECKPOINT'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at
org.continuent.sequoia.controller.recoverylog.RecoveryLog.setLastManDown(RecoveryLog.java:3553)
at
org.continuent.sequoia.controller.xml.DatabasesParser.endElement(DatabasesParser.java:699)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at
org.continuent.sequoia.controller.xml.DatabasesParser.readXML(DatabasesParser.java:294)
at
org.continuent.sequoia.controller.xml.DatabasesParser.readXML(DatabasesParser.java:343)
at
org.continuent.sequoia.controller.core.Controller.addVirtualDatabases(Controller.java:222)
at
org.continuent.sequoia.controller.core.Controller.loadXmlConfiguration(Controller.java:555)
at
ch.techop.excalibur.cmc.CMCLocalClient.startDatabaseInternal(CMCLocalClient.java:668)
at
ch.techop.excalibur.cmc.CMCLocalClient.bootstrapDatabase(CMCLocalClient.java:242)
at ch.techop.excalibur.cmc.CMCServlet$2.run(CMCServlet.java:516)
at ch.techop.excalibur.cmc.CMCWorkerThread.run(CMCWorkerThread.java:31)
Caused by: ERROR 23505: The statement was aborted because it would have
caused a duplicate key value in a unique or primary key constraint or
unique index identified by 'SQL071022150801170' defined on 'CHECKPOINT'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at
org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown
Source)
at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown
Source)
at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown
Source)
at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown
Source)
at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown
Source)
at
org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown
Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown
Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
... 19 more
2007-10-22 15:08:02,500 WARN controller.core.Controller Loading of
virtual databases configuration file failed (because of The virtual
database rwds could not be added to the controller (because of The
statement was aborted because it would have caused a duplicate key value
in a unique or primary key constraint or unique index identified by
'SQL071022150801170' defined on 'CHECKPOINT'.)).
org.xml.sax.SAXException: The virtual database rwds could not be added
to the controller (because of The statement was aborted because it would
have caused a duplicate key value in a unique or primary key constraint
or unique index identified by 'SQL071022150801170' defined on
'CHECKPOINT'.)
at
org.continuent.sequoia.controller.xml.DatabasesParser.endElement(DatabasesParser.java:732)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at
org.continuent.sequoia.controller.xml.DatabasesParser.readXML(DatabasesParser.java:294)
at
org.continuent.sequoia.controller.xml.DatabasesParser.readXML(DatabasesParser.java:343)
at
org.continuent.sequoia.controller.core.Controller.addVirtualDatabases(Controller.java:222)
at
org.continuent.sequoia.controller.core.Controller.loadXmlConfiguration(Controller.java:555)
at
ch.techop.excalibur.cmc.CMCLocalClient.startDatabaseInternal(CMCLocalClient.java:668)
at
ch.techop.excalibur.cmc.CMCLocalClient.bootstrapDatabase(CMCLocalClient.java:242)
at ch.techop.excalibur.cmc.CMCServlet$2.run(CMCServlet.java:516)
at ch.techop.excalibur.cmc.CMCWorkerThread.run(CMCWorkerThread.java:31)
2007-10-22 15:08:02,504 ERROR controller.core.Controller Failed to send
file to Sequoia controller:
org.continuent.sequoia.common.exceptions.ControllerException: Loading of
virtual databases configuration file failed (because of The virtual
database rwds could not be added to the controller (because of The
statement was aborted because it would have caused a duplicate key value
in a unique or primary key constraint or unique index identified by
'SQL071022150801170' defined on 'CHECKPOINT'.)).
org.continuent.sequoia.common.exceptions.ControllerException: Loading of
virtual databases configuration file failed (because of The virtual
database rwds could not be added to the controller (because of The
statement was aborted because it would have caused a duplicate key value
in a unique or primary key constraint or unique index identified by
'SQL071022150801170' defined on 'CHECKPOINT'.)).
at
org.continuent.sequoia.common.exceptions.SequoiaException.fillInStackTrace(SequoiaException.java:103)
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at
org.continuent.sequoia.common.exceptions.SequoiaException.<init>(SequoiaException.java:57)
at
org.continuent.sequoia.common.exceptions.ControllerException.<init>(ControllerException.java:51)
at
org.continuent.sequoia.controller.core.Controller.addVirtualDatabases(Controller.java:229)
at
org.continuent.sequoia.controller.core.Controller.loadXmlConfiguration(Controller.java:555)
at
ch.techop.excalibur.cmc.CMCLocalClient.startDatabaseInternal(CMCLocalClient.java:668)
at
ch.techop.excalibur.cmc.CMCLocalClient.bootstrapDatabase(CMCLocalClient.java:242)
at ch.techop.excalibur.cmc.CMCServlet$2.run(CMCServlet.java:516)
at ch.techop.excalibur.cmc.CMCWorkerThread.run(CMCWorkerThread.java:31)
_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia