db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Thalamati <suresh.thalam...@gmail.com>
Subject Re: Derby db files get corrupted
Date Tue, 21 Feb 2006 20:00:27 GMT
Hi Knut,

I think the change made by Øystein to fix DERBY-298 makes it hard to 
reproduce in 10.2, the problem you are seeing in 10.1 is still there.
DERBY-298 fix added a code to check for last good instant of the
last log file before switching to a new log file to handle crashes
during the log file creation. For problem to appear the last log 
instant wrtten in the second database has to exactlty match with what 
was there when switch to the second log file happend on the first 
databse.

Could you please file JIRA report for this issue ,  I think database 
creation should  FAIL if there is a LOG directory at the specified log 
device path already; This is similar what is done if there is a 
database with same name aready in the derby home.

After a bit of struggle to get the log instant end at the right place, 
I manage to reproduce on a 10.2 client with the attached scripts. 
Repro is flakey, it will not work if some new log record is generated 
on a database creation or by some other operation.

Repro:

1) run logd.sql , then kill IJ
2) change the log swith interval to 
derby.storage.logSwitchInterval=3145727
3) run logd1.sql , then kill IJ
4) reconnect to wombat1 , it will fail with following error.
ij> connect 'wombat1';
ERROR XJ040: Failed to start database 'wombat1', see the next 
exception for deta
ils.
ERROR XSDB4: Page Page(1,Container(0, 896)) is at version 2, the log 
file contains change version 3, either there are log records of this 
page missing, or this page did not get written out to disk properly.



Thanks
-suresh

Knut Anders Hatlen wrote:
> Maciek <wegorkie@interia.pl> writes:
> 
> 
>>Knut Anders Hatlen <Knut.Hatlen@...> writes:
>>
>>
>>>I have seen this error when I have deleted the database directory and
>>>recreated the database, but not deleted the log directory. Could that
>>>be your problem too?
>>
>>Well, deleting log files helped. DB is working and the user claims no data is
>>lost. Maybe adding a "repair tool" to my app that deletes log files could solve
>>future problems of this.
> 
> 
> I have been trying to reproduce this problem with no luck. Then I
> moved from the development trunk to the 10.1.1.0 release, and I was
> immediately able to reproduce the error by doing this:
> 
>   1) Create a database with logDevice set to /tmp/log
>   2) Run some transactions so that a couple of log files are generated
>   3) Kill Derby
>   4) Delete database directory
>   5) Re-create database with logDevice set to /tmp/log
>   6) Run some transactions so that some, but not all of the log files
>      are overwritten.
>   7) Kill Derby
>   8) Restart Derby
> 
> During the recovery in 8) I got this error message:
> 
>   ERROR XSDB4: Page Page(0,Container(0, 768)) is at version 2,657, the
>   log file contains change version 2,715, either there are log records
>   of this page missing, or this page did not get written out to disk
>   properly.
> 
> Since I don't get this error with the development trunk (and I have
> really tried hard!), it seems like the problem has been fixed. I was
> also able to reproduce the error using the 10.1.2.1 release.
> 
> Maybe someone knows when this was fixed and can advise how to port the
> fix to the release you are running?
> 


Mime
View raw message