Post
Topic
Board Development & Technical Discussion
Re: RFC: ship block chain 1-74000 with release tarballs?
by
jgarzik
on 26/11/2010, 02:07:43 UTC
Maybe Berkeley DB has some tweaks we can make to enable or increase cache memory.

Which of the ACID properties do you need, while downloading?

Adding BDB records is simply appending to a log file, until you issue a checkpoint.  The checkpoint then updates the main database file.

Under a normal BDB transaction, you are guaranteed that each log record will be sync'd to disk platter, before the transaction commit succeeds. This is very strict, but required for full ACID. Enabling DB_TXN_NOSYNC still gives you a lot:

     "database integrity will be maintained, but if the application or system fails, it is possible
      some number of the most recently committed transactions may be undone during recovery"

bitcoin can obviously recover if recent transactions are undone, so, it seems useful for this flag to be set for 100% of the initial block download.

That leaves checkpointing, which is a balance between amount of work performed at checkpoint time -- number of records that must be copied from log to database file -- and wall clock time.  Just gotta try some values and see what "feels" right -- maybe checkpoint every 10,000 blocks?