Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: hacim on January 07, 2011, 05:33:09 PM



Title: Needed: calling db4.8 testers!
Post by: hacim on January 07, 2011, 05:33:09 PM
The distributed binary of bitcoin is compiled against libdb4.7++. However, compiling it against libdb4.8++ seems to work fine,  at least in my tests on Debian. It seems that the FreeBSD people are also compiling against 4.8 (at least according to http://bitcointalk.org/index.php?topic=379.0), and I think it would be a worthwhile pursuit to find out if others are able to use this newer format.

If you are willing to test, I'm interested in hearing what your results are. If you are, you should be *very careful* with your wallet, because hey that is your money. Backup your wallet before you mess around. If you don't know how to backup your wallet, you shouldn't be testing. Verify your wallet is backed up, if you don't know how to verify your wallet is backed up, you shouldn't be testing.

Now that you have verified your wallet is backed up, stop bitcoind, install libdb4.8++ and compile the bitcoin binary against it instead of 4.7. Make sure you aren't linking against 4.7 in the process. Then launch bitcoind and verify that things are working. The upgrade to 4.8 will automatically upgrade your database files to the new format and you should notice no difference in operation.

One issue with moving to 4.8 is that although going back to 4.7 is possible, it may be risky, so making sure you have a backup is important. To go back to 4.7, you just need to stop bitcoind and then delete .bitcoin/database/* and then start up the version compiled against 4.7.

Maybe you are using libdb4.8 already? If so, please post here which operatingsystem you are using.


Title: Re: Needed: calling db4.8 testers!
Post by: BioMike on January 07, 2011, 05:47:05 PM
Using db4.8 already for some time here on Gentoo Linux. Never had any issues.


Title: Re: Needed: calling db4.8 testers!
Post by: jgarzik on January 08, 2011, 12:34:32 AM
db 4.8, 4.9 and 5.0 work here on Fedora.


Title: Re: Needed: calling db4.8 testers!
Post by: nanotube on January 09, 2011, 01:30:08 AM
4.8 worked on ubuntu lucid (10.04) 32bit with no problems.


Title: Re: Needed: calling db4.8 testers!
Post by: theymos on January 09, 2011, 01:37:43 AM
Build-unix.txt says:
Quote
You need Berkeley DB 4.7.  Don't use 4.8, the database/log0000* files are incompatible.

Possibly using 4.8 would not allow you to restore correctly in case of database corruption.


Title: Re: Needed: calling db4.8 testers!
Post by: davux on January 09, 2011, 02:22:33 AM
I'm feeling uncomfortable here.  All this testing and wondering about the reason for a specific decision would be a lot easier if Bitcoin's author were a little more present in this kind of discussion, and/or if her/his decisions were more transparent in the first place, or even taken through an open discussion.  Satoshi hardly communicates at all – IMHO, Bitcoin really needs a more open process.


Title: Re: Needed: calling db4.8 testers!
Post by: The Madhatter on January 09, 2011, 03:19:30 AM
I can confirm that db4.7 and db4.8 work perfectly on FreeBSD. I have not tried switching db versions on active Bitcoin installations. I had suspected the file formats may be different.


Title: Re: Needed: calling db4.8 testers!
Post by: BioMike on January 09, 2011, 07:36:06 AM
I think it has to do with:

http://download.oracle.com/docs/cd/E17276_01/html/programmer_reference/changelog_4_8.html#id1655659

Database or Log File On-Disk Format Changes:

   1.  The log file format changed in 4.8.

db4.8 logs are not backward compatible with 4.7. I wonder if bitcoin really needs the logs (sync db before shutdown should remove the need to keep them).


Title: Re: Needed: calling db4.8 testers!
Post by: teknohog on January 09, 2011, 12:45:12 PM
Using db4.8 already for some time here on Gentoo Linux. Never had any issues.

Same here. I started using Bitcoin in July 2010, and all that time I have used db 4.8, as it has been the latest stable version.


Title: Re: Needed: calling db4.8 testers!
Post by: nanotube on January 09, 2011, 03:45:46 PM
Build-unix.txt says:
Quote
You need Berkeley DB 4.7.  Don't use 4.8, the database/log0000* files are incompatible.

Possibly using 4.8 would not allow you to restore correctly in case of database corruption.

indeed, when i did a switchback from my build with bdb4.8 to the official build, i had to delete database/log* files in order for it to work.
that said, all the important bits (wallet) and the not-so-important bits (block chain and index) were just fine.

the testing is being done to see if there are any issues for switching the official build to 4.8 (in which case, there shouldn't be a reason for people to go back)


Title: Re: Needed: calling db4.8 testers!
Post by: hacim on January 10, 2011, 03:55:07 AM
Using db4.8 already for some time here on Gentoo Linux. Never had any issues.

Same here. I started using Bitcoin in July 2010, and all that time I have used db 4.8, as it has been the latest stable version.

What operating system are you using?


Title: Re: Needed: calling db4.8 testers!
Post by: hacim on January 10, 2011, 03:56:55 AM
So far everyone replying has been using a GNU/Linux distribution or FreeBSD.

Are there any windows/mac users out there?


Title: Re: Needed: calling db4.8 testers!
Post by: hacim on January 10, 2011, 05:06:19 AM
db4.8 logs are not backward compatible with 4.7. I wonder if bitcoin really needs the logs (sync db before shutdown should remove the need to keep them).

Well, logs of current transactions are there so that the database can be recovered in the event of an application crash. However, I think that BDB never deletes any logs by default, because the administrator may wish to backup the log files before removal to make database recovery possible even after a catastrophic failure, such as file system corruption.

To have them removed automatically, place set_flags DB_LOG_AUTOREMOVE directive in DB_CONFIG.
Note: If the log files are removed automatically, recovery after a catastrophic failure is likely to be impossible.


Title: Re: Needed: calling db4.8 testers!
Post by: BioMike on January 10, 2011, 06:09:15 AM
Nobody uses the logs as backup and transactions can be re-fetched from the network. The only example I can think of, is when the client itself does a transaction and the client dies before sending it to the network, that may be only present in the logs. But in that case the logs will not be deleted and bdb takes them up at restart.