I’m running the current master branch version (1c2edd9f) and find that most times when I start bitcoind it spends about 10 minutes thrashing my hard drive doing a ‘compaction’ of the chainstate database.
The relevant stack trace:
[#9](/bitcoin-bitcoin/9/) 0x000055555596ce1f in leveldb::DBImpl::DoCompactionWork (this=0x7fffd8619e90, compact=0x7fffa8015860) at leveldb/db/db_impl.cc:1006
[#10](/bitcoin-bitcoin/10/) 0x000055555596d69f in leveldb::DBImpl::BackgroundCompaction (this=0x7fffd8619e90) at leveldb/db/db_impl.cc:736
[#11](/bitcoin-bitcoin/11/) 0x000055555596e192 in leveldb::DBImpl::BackgroundCall (this=0x7fffd8619e90) at leveldb/db/db_impl.cc:674
[#12](/bitcoin-bitcoin/12/) 0x00005555559951a3 in BGThread (this=0x7fffd847c490) at leveldb/util/env_posix.cc:582
[#13](/bitcoin-bitcoin/13/) leveldb::(anonymous namespace)::PosixEnv::BGThreadWrapper (arg=0x7fffd847c490) at leveldb/util/env_posix.cc:521
[#14](/bitcoin-bitcoin/14/) 0x00007ffff4cc30a4 in start_thread (arg=0x7fffb73bc700) at pthread_create.c:309
I tried restarting bitcoind 10 times and kept a copy of the LOG file each time. Here are the file sizes:
-rw------- 1 chris chris 184366 Feb 3 11:19 LOG.00
-rw------- 1 chris chris 182024 Feb 3 11:30 LOG.01
-rw------- 1 chris chris 344 Feb 3 12:11 LOG.02
-rw------- 1 chris chris 194758 Feb 3 12:27 LOG.03
-rw------- 1 chris chris 344 Feb 3 12:27 LOG.04
-rw------- 1 chris chris 187248 Feb 3 12:36 LOG.05
-rw------- 1 chris chris 571 Feb 3 15:28 LOG.06
-rw------- 1 chris chris 189728 Feb 3 15:45 LOG.07
-rw------- 1 chris chris 194434 Feb 3 16:00 LOG.08
-rw------- 1 chris chris 188599 Feb 3 16:16 LOG.09
7 out of 10 times it did a full recompact, causing the computer to almost come to a standstill while it kept the harddrive busy. One of the 10 times bitcoind crashed hard almost immediately, but I’m sure that’s a separate issue (#9683).
Here’s the LOG file from the ~/.bitcoin/chainstate/ folder.
Edit: note that I use:
./configure --with-incompatible-bdb
And see “Using BerkeleyDB version Berkeley DB 5.3.28: (September 9, 2013)” in the debug.log.
If I run configure without that flag I see an error:
configure: error: Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)