lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

double allocation in file #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1. import hamburg.osm.bz2 into the latest svn-version of Traveling Salesman

What is the expected output? What do you see instead?

> General error: java.lang.RuntimeException: double allocation in file
> D:\.osm\LOD1.index.db page 899 blocks 57536-57599 [50000-115]

What version of the product are you using? On what operating system, file
system, and virtual machine?

1.1.115
Windows XP on Eeepc901

Do you know a workaround?

no

How important/urgent is the problem for you?

In your view, is this a defect or a feature request?

defect. On-disk -structures of a database must be consistent
at all times.

Please provide any additional information below.

I can provide the database and all software needed to reproduce it.

Original issue reported on code.google.com by Marcus.W...@gmail.com on 21 Jul 2009 at 5:23

GoogleCodeExporter commented 9 years ago
Hi,

> I can provide the database and all software needed to reproduce it.

That would be great! Could you send it to dbsupport at 
h2database -dot- com? I will be on vacation for one week, not sure
if I have internet access during that time.

Original comment by thomas.t...@gmail.com on 21 Jul 2009 at 3:19

GoogleCodeExporter commented 9 years ago
I just tested this and I was unable to duplicate the issue:

1. Downloaded latest traveling salesman from SVN: 
svn co https://travelingsales.svn.sourceforge.net/svnroot/travelingsales 
travelingsales

2. Compiled the included dependencies and the actual application. 

3. Downloaded hamburg.osm.bz2 from: 
http://download.geofabrik.de/osm/europe/germany/hamburg.osm.bz2

4. Started the application and imported the downloaded map file ..  
successfully:
INFO: Imported new map-data in:
    340672 nodes in 73084ms = 4.661375950960538 nodes/ms
    68015 ways in 179647ms = 0.37860359482763417 ways/ms
    868 relations in 3543ms = 0.24499012136607395 relations/ms
    sum 256274ms

5. Closed the application and restarted.

6. Everything worked ok.

opening Map-Database...
Map-Database opened

Maybe I'm missing something here, but this seems to work (?)

Original comment by ilkka.my...@gmail.com on 21 Jul 2009 at 4:03

GoogleCodeExporter commented 9 years ago
In my 5th try it now worked now too.
I guess it may be related to the netbook
being suspended and re-awakened in the middle
of the import in the first 4 runs where
this happened.
I'll try to find a reliable way to reproduce
this and get back to you.

Is there a way to check and repair broken 
databases that I could offer my users in the
documentation?

Original comment by Suran...@gmail.com on 22 Jul 2009 at 6:50

GoogleCodeExporter commented 9 years ago
I just noticed that my earlier test was not valid for reproducing the issue.

The Traveling Salesman application defaulted to HSQLDB database engine instead 
of H2.
(I checked the database in (home)/.openstreetmap/map)

How do you force the application to initialize with H2 by default?

And to your question about database repair: 

You could create a "recovery mode" to the application which starts the internal 
H2 database with ;RECOVER=1 
appended to JDBC URL. This would be much nicer than requiring users to modify 
internal database files 
directly. Of course this is not 100% safe, but better than nothing.

Original comment by ilkka.my...@gmail.com on 22 Jul 2009 at 7:24

GoogleCodeExporter commented 9 years ago
Ah, yes.
In your home-directory there us a directory .libosm or "application data/libosm"
with a file preferences.xml .
There you can force H2 by setting:
plugin.useImpl.IDataSet.LOD0 to
org.openstreetmap.osm.data.h2.H2DataSet

or set plugin.useImpl.IDataSet to use just 1 database without multiple levels of
detail.

Thanks for mentioning the "recover"-option.
When opening the DB fails I'll add it in the
catch-clause. :)

Original comment by Suran...@gmail.com on 22 Jul 2009 at 8:54

GoogleCodeExporter commented 9 years ago
Ok, I cleared .openstreemap folder and started with following configuration:

<entry 
key="plugin.useImpl.IDataSet.LOD2">org.openstreetmap.osm.data.h2.H2DataSet</entr
y>
<entry 
key="plugin.useImpl.IDataSet.LOD1">org.openstreetmap.osm.data.h2.H2DataSet</entr
y>
<entry 
key="plugin.useImpl.IDataSet.LOD0">org.openstreetmap.osm.data.h2.H2DataSet</entr
y>

I started the application and imported the map osm - successfully (btw. nice to 
see that H2 is 2x faster than 
HSQLDB here;))

INFO: Imported new map-data in:
    340672 nodes in 36223ms = 9.404853270021809 nodes/ms
    68015 ways in 74448ms = 0.9135906941758005 ways/ms
    868 relations in 1074ms = 0.8081936685288641 relations/ms
    sum 111745ms

But: after previous INFO log the application just got stuck - completely.

I waited few minutes and then forced the application to close. When restarting, 
the app starts but with 
obviously corrupted map data:

Problem while painting map! 

due to:
 a UndeclaredThrowableException "null"
in:
 SimpleMapPanel:paint()

But I am unable to get any errors from H2 database engine. H2 itself seems to 
work even if the import 
somehow failed.

Any suggestions?

Original comment by ilkka.my...@gmail.com on 22 Jul 2009 at 9:28

GoogleCodeExporter commented 9 years ago
The upcomming error-dialog should show the complete stack-trace.
As does the help->debug log if opened before importing.

I'll try myself on the train-ride back home and get back to you.

Original comment by Suran...@gmail.com on 22 Jul 2009 at 11:14

GoogleCodeExporter commented 9 years ago
I am closing this issue for now, but I will reopen it once you can provide more
information.

Original comment by thomas.t...@gmail.com on 4 Sep 2009 at 2:01