Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql([CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql)
[CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #931515] Wed, 03 October 2012 05:25 Go to next message
Yvan Lussaud is currently offline Yvan Lussaud
Messages: 14
Registered: July 2009
Junior Member
Hi,

for some reason I have a standalone CDO server that crashed. So I restarted it and now I get the following error :

Exception in thread "main" org.eclipse.net4j.db.DBException: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.ObjectTypeTable.getMaxID(ObjectTypeTable.java:185)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.DelegatingObjectTypeMapper.getMaxID(DelegatingObjectTypeMapper.java:85)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.repairAfterCrash(AbstractHorizontalMappingStrategy.java:94)
at org.eclipse.emf.cdo.server.internal.db.DBStore.repairAfterCrash(DBStore.java:679)
at org.eclipse.emf.cdo.server.internal.db.DBStore.reStart(DBStore.java:661)
at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:556)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1845)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208)
at ch.paranor.reverse.specification.server.CDOServer.start(CDOServer.java:230)
at ch.paranor.reverse.specification.server.CDOServer.main(CDOServer.java:275)
Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.ObjectTypeTable.getMaxID(ObjectTypeTable.java:174)
... 15 more


It happen when running the following SQL statement :

SELECT MAX(cdo_id) FROM cdo_objects;


So I tried to run in from the psql util :


SELECT MAX(cdo_id) FROM cdo_objects;
max
-----
73
(1 row)


It works fine... so I thought it was the JDBC driver version that was not up to date. My 8.44 server is 9.1. I was using the JDBC driver v3 for postgresql 8.4. I moved to JDBC driver v3 for postgresql 9.1. But I still have the same issue.


Any idea of how I can recover this repository ?

regards,
Yvan.
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #931663 is a reply to message #931515] Wed, 03 October 2012 08:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Hi Yvan,

Vik, who's developed the PostgresAdapter is absent for a while. I have no Postgres experience at all. Google shows this
kind of issue with many higher-level frameworks:

https://www.google.de/search?hl=de&site=&source=hp&q=org.postgresql.util.PSQLException%3A+ERROR%3A+current+transaction+is+aborted%2C+commands+ignored+until+end+of+transaction+block+&oq=org.postgresql.util.PSQLException%3A+ERROR%3A+current+transaction+is+aborted%2C+commands+ignored+until+end+of+transaction+block+&gs_l=hp.3...6478.6478.0.6667.1.1.0.0.0.0.0.0..0.0...0.0...1c.1.PYZHuUUWZYM

Can it be that this is not the first error in the log? What about possible "|OutOfMemoryError: PermGen space" or
similar, so that your exception is kind of a follow-up problem?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


|
Am 03.10.2012 11:25, schrieb Yvan Lussaud:
> Hi,
>
> for some reason I have a standalone CDO server that crashed. So I restarted it and now I get the following error :
>
> Exception in thread "main" org.eclipse.net4j.db.DBException: org.postgresql.util.PSQLException: ERROR: current
> transaction is aborted, commands ignored until end of transaction block
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.ObjectTypeTable.getMaxID(ObjectTypeTable.java:185)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.DelegatingObjectTypeMapper.getMaxID(DelegatingObjectTypeMapper.java:85)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.repairAfterCrash(AbstractHorizontalMappingStrategy.java:94)
> at org.eclipse.emf.cdo.server.internal.db.DBStore.repairAfterCrash(DBStore.java:679)
> at org.eclipse.emf.cdo.server.internal.db.DBStore.reStart(DBStore.java:661)
> at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:556)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
> at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1845)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
> at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208)
> at ch.paranor.reverse.specification.server.CDOServer.start(CDOServer.java:230)
> at ch.paranor.reverse.specification.server.CDOServer.main(CDOServer.java:275)
> Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of
> transaction block
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252)
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.ObjectTypeTable.getMaxID(ObjectTypeTable.java:174)
> ... 15 more
>
>
> It happen when running the following SQL statement :
>
> SELECT MAX(cdo_id) FROM cdo_objects;
>
>
> So I tried to run in from the psql util :
>
>
> SELECT MAX(cdo_id) FROM cdo_objects;
> max -----
> 73
> (1 row)
>
>
> It works fine... so I thought it was the JDBC driver version that was not up to date. My 8.44 server is 9.1. I was
> using the JDBC driver v3 for postgresql 8.4. I moved to JDBC driver v3 for postgresql 9.1. But I still have the same
> issue.
>
>
> Any idea of how I can recover this repository ?
>
> regards,
> Yvan.
>
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #931789 is a reply to message #931663] Wed, 03 October 2012 10:28 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan Lussaud
Messages: 14
Registered: July 2009
Junior Member
I found something about a schema that doesn't exist in the database...

2012-10-03 15:20:40 CEST ERROR: schema "specification" does not exist at character 27

I created it but it doesn't help

2012-10-03 16:16:34 CEST ERROR: relation "specification.cdo_objects" does not exist at character 27

is it possible to directly use tables in the recovery process ?

[Updated on: Wed, 03 October 2012 10:28]

Report message to a moderator

Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #932907 is a reply to message #931789] Thu, 04 October 2012 10:59 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 03.10.2012 16:28, schrieb Yvan Lussaud:
> I found something about a schema that doesn't exist in the database...
>
> 2012-10-03 15:20:40 CEST ERROR: schema "specification" does not exist at character 27
>
> but it doesn't help
>
> 2012-10-03 16:16:34 CEST ERROR: relation "specification.cdo_objects" does not exist at character 27
>
> is it possible to directly use tables in the recovery process ?
I don't understand. Didn't you say there are tables missing? How can anything use them? Directly or not...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #933897 is a reply to message #932907] Fri, 05 October 2012 08:40 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan Lussaud
Messages: 14
Registered: July 2009
Junior Member
Tables seems to be present for instance cdo_objects exists. But it can't be accessed via specification.cdo_objects. I guess this is because there is no schema named specification that contains cdo_objects. I tried to modify my sql dump to solve this but I ended up with a new CDO repository in the data base. In this clean CDO repository the schema specification is present. I guess something not related to CDO removed the schema. I activated the debug mode on the server to have more information the next time.

Thank you for your help.

Yvan.
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #933912 is a reply to message #933897] Fri, 05 October 2012 09:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 05.10.2012 14:40, schrieb Yvan Lussaud:
> Tables seems to be present for instance cdo_objects exists. But it can't be accessed via specification.cdo_objects. I
> guess this is because there is no schema named specification that contains cdo_objects. I tried to modify my sql dump
> to solve this but I ended up with a new CDO repository in the data base. In this clean CDO repository the schema
> specification is present. I guess something not related to CDO removed the schema. I activated the debug mode on the
> server to have more information the next time.
>
> Thank you for your help.
You're welcome and good luck ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #945948 is a reply to message #933912] Mon, 15 October 2012 16:17 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 866
Registered: July 2009
Senior Member
Hi Yvan,

I had the same problem, I patched it with this code, below. (Basically turn on auto-commit).
I registered a bug for this, also.


/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java

public CDOID getMaxID(Connection connection, IIDHandler idHandler)
{
Statement stmt = null;
ResultSet resultSet = null;

try
{
stmt = connection.createStatement();
connection.setAutoCommit(true);
resultSet = stmt.executeQuery("SELECT MAX(" + idField + ") FROM " + table);
connection.setAutoCommit(false);
if (resultSet.next())
{
return idHandler.getCDOID(resultSet, 1);
}

return null;
}
catch (SQLException ex)
{
throw new DBException(ex);
}
finally
{
DBUtil.close(resultSet);
DBUtil.close(stmt);
}
}

Cheers Christophe
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #946537 is a reply to message #945948] Tue, 16 October 2012 02:42 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 15.10.2012 22:17, schrieb Christophe Bouhier:
> Hi Yvan,
> I had the same problem, I patched it with this code, below. (Basically turn on auto-commit).
Hmm, wouldn't it be better to do this in org.eclipse.emf.cdo.server.internal.db.DBStore.repairAfterCrash()?

> I registered a bug for this, also.
What bug is that?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
> /org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
>
> public CDOID getMaxID(Connection connection, IIDHandler idHandler)
> {
> Statement stmt = null;
> ResultSet resultSet = null;
>
> try
> {
> stmt = connection.createStatement();
> connection.setAutoCommit(true);
> resultSet = stmt.executeQuery("SELECT MAX(" + idField + ") FROM " + table);
> connection.setAutoCommit(false);
> if (resultSet.next())
> {
> return idHandler.getCDOID(resultSet, 1);
> }
>
> return null;
> }
> catch (SQLException ex)
> {
> throw new DBException(ex);
> }
> finally
> {
> DBUtil.close(resultSet);
> DBUtil.close(stmt);
> }
> }
>
> Cheers Christophe
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #947724 is a reply to message #946537] Wed, 17 October 2012 07:14 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 866
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365602
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #947774 is a reply to message #947724] Wed, 17 October 2012 08:17 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 17.10.2012 13:14, schrieb Christophe Bouhier:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=365602
I see. Thanks!

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #965496 is a reply to message #931515] Wed, 31 October 2012 05:25 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan Lussaud
Messages: 14
Registered: July 2009
Junior Member
Hi,

I get the problem again and this time I applied your patch Christophe in the DBStore as suggested by Eike. It recovered the CDO repository and all my data.

Thank you,
Yvan.
Re: [CDO] Repository recovery fails after crash with stanalone CDO sever with postgresql [message #965564 is a reply to message #965496] Wed, 31 October 2012 06:31 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 31.10.2012 10:25, schrieb Yvan Lussaud:
> Hi,
>
> I get the problem again and this time I applied your patch Christophe in the DBStore as suggested by Eike. It
> recovered the CDO repository and all my data.
Just the other second I've fixed this guy:

364809: DBStore with Postgres fail to recover from crash
https://bugs.eclipse.org/bugs/show_bug.cgi?id=364809

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[EMFT] Reloading resources in a transactional editing context
Next Topic:[TEXO] ModelXMLLoader mapping
Goto Forum:
  


Current Time: Sun Apr 20 12:36:13 EDT 2014

Powered by FUDForum. Page generated in 0.01880 seconds