ilovejs / h2database

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

Corruption: Indexes for table with more than 5000 rows gets corrupted (sample app included) #566

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.  Run the attached RecreateError.java class with h2-1.4.178.jar in the 
classpath.

What is the expected output? You should get nothing back on the console.

What do you see instead?

You will observe the following output to stderr:
Database thinks it has 5133 rows
Couldn't find 5001
Couldn't find 5002 (and onward).

I have done some digging around in the code to try to run down this.  I found 
that if I went to org.h2.mvstore.db.MVTable and go into method 
rebuildIndexBlockMerge and I adjust the line 

int bufferSize = Constants.DEFAULT_MAX_MEMORY_ROWS /2; 

to be something big enough to hold the whole index in one buffer, the problem 
does not occur.  So I am concluding that there is something wrong with the 
joining of multiple named buffers down inside of the call to:

index.addBufferedRows(bufferNames);

I am not expert in this code though to really perceive where the problem is.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by davidben...@gmail.com on 19 Jun 2014 at 3:11

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot! This issue is already fixed in the trunk.

Original comment by thomas.t...@gmail.com on 20 Jun 2014 at 7:36

GoogleCodeExporter commented 9 years ago
Should be fixed with version 1.4.179

Original comment by thomas.t...@gmail.com on 23 Jun 2014 at 6:35

GoogleCodeExporter commented 9 years ago
I have upgraded to 1.4.179 and the problem is still there.

Original comment by vsahar...@gmail.com on 2 Jul 2014 at 4:56

GoogleCodeExporter commented 9 years ago
You need to re-create the database, or at least re-create the index.

Original comment by thomas.t...@gmail.com on 4 Jul 2014 at 7:33