Berkeley DB recoverability on Linux - 01-08-2004 , 12:15 PM
I am trying to understand how to apply
http://www.sleepycat.com/docs/ref/tr.../reclimit.html to a Linux x86
My file system has the typical block size (4096), and I don't tweak the
Berkeley DB page size ... so it's also 4096 on this file system.
strace(1) shows that Berkeley DB writes to my database file in chunks of
4096 [using pwrite(2)], and to the log files in variable-size chunks
Now, are these 4096-bytes Berkeley DB pages written atomically?
First, I suspect each pwrite(...., 4096) will always write a single fs
block, not several partial blocks. Is this correct?
Next, whether or not the OS can write each block atomically depends on
the underlying controller and disk drive. Each fs block is written on
a number of sectors on my hard drive. With a sector size of 512 bytes,
that's 8 sectors per file system block.
On my IDE disk, `hdparm -m /dev/hda` returns 16. Does this guarantee
that up to 16 sectors will be written atomically by the OS?
Is there anything equivalent with a SCSI disk? Or do I need to use
512-bytes file system blocks to ensure atomicity?
A related question is which Linux file system is best suited for
Berkeley DB databases and log files. Is it useful to use a journaled
file system? Journal just the metadata or the data as well (with
ext3's journal_data option)?
Thanks for any info!