Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Diagnostic/Reparation tool
[CDO] Diagnostic/Reparation tool [message #1001705] Thu, 17 January 2013 08:54 Go to next message
Christophe MOINE is currently offline Christophe MOINE
Messages: 34
Registered: February 2012
Member
Hi all,

We have clients' DB that are corrupted, for exemple (in case of multiple refs, and default db mapping):
- The table tableA_myref_list have index no more starting at zero
- The number of items referenced in the tableA_myref_list table does not match the size specified in the "myref" column of tableA
- ...

Of course, it makes insiduous problems in the runtime that are quite difficult to track. So far we try try fix the client DB manually, but it would be great to have to tool that repair the Database more or less automatically: has someone ever worked on something like this ?

Thank you in advance,

Cheers,

/Christophe.
Re: [CDO] Diagnostic/Reparation tool [message #1001712 is a reply to message #1001705] Thu, 17 January 2013 09:06 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5524
Registered: July 2009
Senior Member
Am 17.01.2013 09:54, schrieb Christophe MOINE:
> Hi all,
>
> We have clients' DB that are corrupted, for exemple (in case of multiple refs, and default db mapping):
> - The table tableA_myref_list have index no more starting at zero
Depending on the configuration/mapping that may be allowed as an optimization of removes from a list head. May we see
your cdo-server.xml?

> - The number of items referenced in the tableA_myref_list table does not match the size specified in the "myref"
> column of tableA
I've heard this only once: https://bugs.eclipse.org/bugs/show_bug.cgi?id=396743

IIRC., it was not possible to reproduce that anywhere.

> - ...
What else?

>
> Of course, it makes insiduous problems in the runtime that are quite difficult to track. So far we try try fix the
> client DB manually, but it would be great to have to tool that repair the Database more or less automatically:
It would be great to find and fix that bug, if it is a bug.

> has someone ever worked on something like this ?
I hope not. That would efficiently prevent to find the root cause.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Diagnostic/Reparation tool [message #1001743 is a reply to message #1001712] Thu, 17 January 2013 10:12 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINE
Messages: 34
Registered: February 2012
Member
Here is my cdo-server.xml (Btwn, the cdo-server.xml is "patched" dynamically)

<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>
	<acceptor type="tcp" listenAddr="0.0.0.0" port="${cdo.server.port}"/>

	<repository name="repo1">
		<property name="overrideUUID" value=""/>
		<property name="supportingAudits" value="false"/>

		<store type="db">
			<mappingStrategy type="horizontal">
				<property name="qualifiedNames" value="false"/>
				<property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
				<property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
			</mappingStrategy>

			<dbAdapter name="mysql"/>
			<dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" 
				url="jdbc:mysql://${db.host}:${db.port}/${db.schema}"
				user="${db.user}" password="${db.password}"/>
		</store>
	</repository>
</cdoServer>
Re: [CDO] Diagnostic/Reparation tool [message #1001753 is a reply to message #1001743] Thu, 17 January 2013 10:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5524
Registered: July 2009
Senior Member
Am 17.01.2013 11:12, schrieb Christophe MOINE:
> Here is my cdo-server.xml (Btwn, the cdo-server.xml is "patched" dynamically)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="${cdo.server.port}"/>
>
> <repository name="repo1">
> <property name="overrideUUID" value=""/>
> <property name="supportingAudits" value="false"/>
Yes, I think the optimization I mentioned applies to non-auditing mode. Stefan?

Cheers
/Eike

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


>
> <store type="db">
> <mappingStrategy type="horizontal">
> <property name="qualifiedNames" value="false"/>
> <property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
> <property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
> </mappingStrategy>
>
> <dbAdapter name="mysql"/>
> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
> url="jdbc:mysql://${db.host}:${db.port}/${db.schema}"
> user="${db.user}" password="${db.password}"/>
> </store>
> </repository>
> </cdoServer>
Re: [CDO] Diagnostic/Reparation tool [message #1001754 is a reply to message #1001743] Thu, 17 January 2013 10:26 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINE
Messages: 34
Registered: February 2012
Member
The DB corruption may came from a previous release of CDO. It seems the problem occurs less with newer version.

It is very hard to find what occured this problem, but our assumption is:
- cdoserver is killed savagely
- cdoserver is run twice (this we are sure): we now made check to prevent this, but not old versions.....
Re: [CDO] Diagnostic/Reparation tool [message #1001796 is a reply to message #1001754] Thu, 17 January 2013 11:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5524
Registered: July 2009
Senior Member
Am 17.01.2013 11:26, schrieb Christophe MOINE:
> The DB corruption may came from a previous release of CDO. It seems the problem occurs less with newer version.
>
> It is very hard to find what occured this problem, but our assumption is:
> - cdoserver is killed savagely
> - cdoserver is run twice (this we are sure): we now made check to prevent this, but not old versions.....
Because the DBStore relies on DB transactions I suspect either wrong DB configuration (isolation level?) or a bug in CDO.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Diagnostic/Reparation tool [message #1001868 is a reply to message #1001796] Thu, 17 January 2013 13:32 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINE
Messages: 34
Registered: February 2012
Member
Can we customize the isolation level at CDO level ?

Just to be sure: if a request something like
select min(cdo_idx) from tableA_ref_list where cdo_source=....
Does it necessarily return zero (or no row of course) ? If so, we have plenty of theses Sad
Re: [CDO] Diagnostic/Reparation tool [message #1002194 is a reply to message #1001868] Fri, 18 January 2013 06:35 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5524
Registered: July 2009
Senior Member
Am 17.01.2013 14:32, schrieb Christophe MOINE:
> Can we customize the isolation level at CDO level ?
No, I don't think so. Maybe it's part of the data source URL? I *believe* that's normally part of the configuration of
the external DB system, but I'm not an expert. And I didn't say that this is likely the cause.

> Just to be sure: if a request something like select min(cdo_idx) from tableA_ref_list where cdo_source=.... Does it
> necessarily return zero (or no row of course) ? If so, we have plenty of theses :(
I don't know what you mean here.

One thing is clear: we update the element rows and the count value in the other table within the same JDBC transaction.
With an adequate transaction isolation level other connections shouldn't ever see intermediate, inconsistent states. As
you say, most DB-based systems have plenty of these multi-table updates and wouldn't work at all if this fundamental
guarantee wasn't there.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[CDO] Can client listen for new objects added to server?
Next Topic:Existing XMI, meta-model changes
Goto Forum:
  


Current Time: Sat Sep 20 22:21:56 GMT 2014

Powered by FUDForum. Page generated in 0.01737 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software