Skip to contentSkip to conversation

Atomicity with reiser4?

DISCUSSION Nicolas Smallwood 3 participants 3 messages Feb 2, 2005 – Feb 3, 2005

lore
Share & tools
lore
#0 lore raw

Network BlitzHello,

I was running a test with some in-house database software that relies on fsync after transactions are complete. I noticed severe perfomance lapses,
and have bee profiling the software for several days. A minute ago, I
removed the fsync from the system, only making it think it had been fsyncing. This reduced my test from 15 minutes to less than 40 seconds.

Obviously there is a performance hit with using fsync, but we are of course worried about database integrity.

Is there an avaliable paper on how reiser4 handles atomicity, or can it be easily explained?
Essentially, my question is whether our database (using 4k blocksizes) will lose data during power loss or other occurrences if we do not fsync?

Thank You,

Nicolas Smallwood

#1 lore raw

Hello

Quoted 9 lines · Nicolas Smallwood

Hello,

I was running a test with some in-house database software that relies on fsync after transactions are complete. I noticed severe perfomance
lapses, and have bee profiling the software for several days. A
minute ago, I removed the fsync from the system, only making it think it had been fsyncing. This reduced my test from 15 minutes to less than 40 seconds.

How often do you call fsync?
If you used reiserfs or ext2 - how much would your software performance change when fsync is removed?
Would you brifly describe what kind of load for filesystem does your software generate?

Quoted 5 lines

Obviously there is a performance hit with using fsync, but we are of course worried about database integrity.

Is there an avaliable paper on how reiser4 handles atomicity, or can it be easily explained?

http://namesys.com/v4/v4.html#atomic_fs

Quoted 4 lines

Essentially, my question is whether our database (using 4k blocksizes) will lose data during power loss or other occurrences if we do not fsync?

Reiser4 flushes data to disk by portions of modified data called atom. Atom may contain modifed data of several system calls. Flushing one atom is called atom commit.
Atom gets committed whenever it becames too old or too large. They can be forced to commit by fsync.

Data of all atoms which were not committed at the moment of power loss will be lost.

Quoted 6 lines

Thank You,

Nicolas Smallwood

#2 lore raw

I think it is essential that you use the atomic transactions functionality to get good performance on top of reiser4 for what you are doing. Unfortunately, that API is still kernel internal at this time, and we have not yet coded the export of it to outside the kernel. We will though, we just need some time.

Hans