Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
Hi,
Yes, this looks like a corruption problem. You have already provided a lot
information, thanks. The version you are using should be fine, I'm not aware of
any
bugs related to such problems that are fixed in later versions. I'm afraid I
can not
really solve this problem right now because I don't have a reproducible test
case,
but maybe we can find out more details, and maybe I can give some advice how to
avoid
such problems.
> 1. Other than as a result of accidentally attempting to access the database
> from multiple threads, is there any other known way to cause this type of
> database corruption?
I got some reports that 'power off' while writing can cause such problems. I
will try
to reproduce this, I may be even able to automate a test case, but this will
take
some time. Most likely I will do that using the new 'page store' mechanism.
> 2. We tried running the output through the RunScript tool on a blank
database, and it failed with a syntax error.
What were those errors exactly? I like to fix this problem.
> 4. ... modifications that had been made... were gone.
This may be a problem of the Recover tool. I will check that if you can send me
the
database files (all files, including .data.db, .index.db and all .log.db files).
You can find out if the database is corrupted when running SCRIPT TO
'test.sql'. This
can also be used to create backups (the advantage over file backups and BACKUP
TO is
that this will detect corruptions).
> The app prevents multiple instances from running simultaneously.
Do you use the default 'database file locking' mechanism in H2? How does the
database
URL look like?
Original comment by thomas.t...@gmail.com
on 4 Sep 2009 at 2:22
Hello again,
Thank you for your detailed response. My apologies for the delay in replying
back.
I will send you the corrupt database files by email, using the address:
dbsupport
-at- h2database -dot- com
Below is to provide more information to you and the forum, and to answer your
questions:
1. reports that 'power off' while writing can cause such problems.
After extensive monitoring of the users of our application, we have concluded
that
this problem occurs most often, and possibly only, after users terminate the
application from Task Manager when they believe it to be non-responsive.
Whether
this constitutes 100% of the cases of corruption is not certain, but I believe
it
likely, especially in light of those reports about power off while writing.
My team has some work to do to ensure that the application never appears
non-responsive in order to reduce this tendency by our users, but it would be
great
if you were able to write a test case to reproduce the core problem of
corruption
during power off. If I'm able to find the time to do so, I'll also try.
2. Syntax errors in Recover tool output.
Using the attached database files with the Recover tool, and then using
RunScript on
the output, the first such error is "Column count does not match". This is
because a
line that appears to be intended as a comment (starting with a "--") is actually
getting interpreted as an SQL statement. This should be reproducible with the
attached files.
3. Still curious about the duplicate key errors in the output generated by the
Recover tool. Perhaps this is purely an artifact of the data corruption?
4. By "SCRIPT TO", I assume this is equivalent to the following (taken from the
browser interface):
java -cp h2*.jar org.h2.tools.Script -url "jdbc:h2:~/test" -user "sa" -script
"~/backup.sql"
Running this against the corrupt database yields the same double allocation
error, so
it never generates the output. If you mean something else by "SCRIPT TO" I'd
be very
interested to try that.
5. Regarding the app preventing multiple instances from running simultaneously,
we
use what is turned on by default with this URL:
jdbc:h2:file:C:\path\to\database
or, from the browser interface when trying to recover:
jdbc:h2:file:C:\path\to\database;RECOVER=1
When using the browser interface, I have a batch file based on the one from the
distribution, modified as follows to allow access to the lucene libraries:
@cd C:\path\to\h2\bin
@java -Xmx1024m -classpath
"h2.jar;%H2DRIVERS%;%CLASSPATH%;C:\path\to\lucene\lucene-core-2.2.0.jar"
org.h2.tools.Console
@if errorlevel 1 pause
I hope this helps to further investigate. Thank you again.
Steve Fram
Original comment by sbf...@gmail.com
on 16 Sep 2009 at 7:40
If you have time, could you try with a newer version, using the new page store
storage mechanism? For example version 1.2.123. This mechanism should now be
stable.
I have already run some 'power failure' tests and could not find problems so
far, but
I will continue to test it.
Original comment by thomas.t...@gmail.com
on 8 Nov 2009 at 1:35
The newest version should be more stable.
If you still experience problems, please open a new bug.
Original comment by thomas.t...@gmail.com
on 15 Jan 2010 at 8:13
Original issue reported on code.google.com by
sbf...@gmail.com
on 2 Sep 2009 at 4:59