byzhang / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

PosixMmapReadableFile fails on FreeBSD with large dataset #241

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
See https://github.com/bitcoin/bitcoin/issues/4362 
I think it happens when it reads very large dataset like blockchain on FreeBSD

What is the expected output? What do you see instead?
expected: Valid database is readed without exceptions.
instead: Invalid argument: not an sstable (bad magic number)

What version of the product are you using? On what operating system?
1.17, FreeBSD amd64

Please provide any additional information below.
I read about previous OSX unmap bug which was corrupting files and find out 
that if i comment out lines 322-337 in file util/env_posix.cc and force program 
to use PosixRandomAccessFile instead of PosixMmapReadableFile everything works 
as expected. There are reported similar issues on ARM. (I am not C++ programmer 
so i cant tell whats wrong with mmap on FreeBSD nor if it is connected to ARM 
problems)

Original issue reported on code.google.com by efe...@gmail.com on 19 Jun 2014 at 8:15

GoogleCodeExporter commented 9 years ago
How large are the datasets? I'm seeing a similar reports with that error 
message on Android, but haven't been able to repro it yet.

Original comment by r...@google.com on 27 Jun 2014 at 5:42

GoogleCodeExporter commented 9 years ago
Also, would you have links to the similar issues on ARM you referred to? Thanks.

Original comment by r...@google.com on 27 Jun 2014 at 6:01

GoogleCodeExporter commented 9 years ago
Sorry, blockchain is not in leveldb. Leveldb is used only for index of 
blockchain and for db of unspent transactions. Actualy all these database files 
are now about 43MB and 473MB. I am trying to separate behaviour which is 
causing error but with no luck yet (imho mostly because i dont understand C++)

Original comment by efe...@gmail.com on 1 Jul 2014 at 8:02