Skip to contentSkip to conversation

reiser4 data journalling?

DISCUSSION Tupshin Harper 9 participants 20 messages Aug 28, 2003 – Sep 3, 2003

lore
Share & tools
lore
#0 lore raw

Will reiser4 have options equivalent to ext3's data=journal and data=ordered options? My understanding is that reiser4(and reiser3) do the equivalent of ext3's writeback mode(correct?). Any plans for the other modes in order to maximize data integrity?

-Tupshin

#1 lore raw
Quoted 3 lines · Tupshin Harper

Will reiser4 have options equivalent to ext3's data=journal and data=ordered options? My understanding is that reiser4(and reiser3) do the equivalent of ext3's writeback mode(correct?). Any plans for the

reiserfs has meta-data only journalling by default (equivalent to writeback mode), and optionally supports full data journalling (Chris patches).

reiser4 supports full data journalling only, but it is still faster than ext3-writeback.

Look at http://www.namesys.com/benchmarks.html for last benchmarking results.

Quoted 4 lines

other modes in order to maximize data integrity?

-Tupshin

Nikita.

#2 lore raw
Quoted 9 lines · Nikita Danilov
Quoted 1 line · Tupshin Harper

Will reiser4 have options equivalent to ext3's data=journal and data=ordered options? My understanding is that reiser4(and reiser3) do the equivalent of ext3's writeback mode(correct?). Any plans for the

reiserfs has meta-data only journalling by default (equivalent to writeback mode), and optionally supports full data journalling (Chris patches).

reiser4 supports full data journalling only

full data journaling means that if you perform writes that are 4k or less, and page align them, they will be performed atomically.

Reiser4 is a fully atomic filesystem, and that means that you can perform a set of filesystem operations of any size, and they will be performed atomically. By default, every fs system call is performed atomically.

Please describe reiser4 as an atomic filesystem, not as (just) a data journaling filesystem, ok?

Quoted 16 lines

, but it is still faster than
ext3-writeback.

Look at http://www.namesys.com/benchmarks.html for last benchmarking results.

Quoted 4 lines

other modes in order to maximize data integrity?

-Tupshin

Nikita.

Signature · 1 line
Hans
#3 lore raw
Quoted 2 lines · Hans Reiser

full data journaling means that if you perform writes that are 4k or less, and page align them, they will be performed atomically.

would it be much more difficult to allow non-page aligned bufs to be written atomically? a fully atomic fs would be very nice. otherwise, a lot of utils and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic. of course, even neater would be the ability to group multiple ops into one atomic action. (this is probably already planned - it's been a while since i read the reiserfs4 paper on the namesys site.)

Signature · 2 lines
Tom Vier <[email protected]>
DSA Key ID 0xE6CB97DA
#4 lore raw
Quoted 7 lines · Tom Vier
Quoted 3 lines · Hans Reiser

full data journaling means that if you perform writes that are 4k or less, and page align them, they will be performed atomically.

Quoted 10 lines

would it be much more difficult to allow non-page aligned bufs to be written atomically? a fully atomic fs would be very nice. otherwise, a lot of utils and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic. of course, even neater would be the ability to group multiple ops into one atomic action. (this is probably already planned - it's been a while since i read the reiserfs4 paper on the namesys site.)

reiser4 does all this that you ask for, although the user space API is not yet compiling;-)

Signature · 1 line
Hans
#5 lore raw
Quoted 13 lines · Hans Reiser
Quoted 12 lines · Tom Vier

would it be much more difficult to allow non-page aligned bufs to be written
atomically? a fully atomic fs would be very nice. otherwise, a lot of utils and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic. of course, even neater would be the ability to group multiple ops into one atomic action. (this is probably already planned - it's been a while since i
read the reiserfs4 paper on the namesys site.)

Quoted 3 lines

reiser4 does all this that you ask for, although the user space API is not yet compiling;-)

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

#6 lore raw

Hello!

Quoted 4 lines · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Data does not need to be page aligned for atomic operations.

Bye,
Oleg

#16 lore raw
In reply to Tom Vier
Quoted 2 lines · Tom Vier

and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic.

mv (ie, rename), ln and rm have always been atomic. That's a POSIX requirement.

The new thing with reiserfs4 seems to be that if you do a write of, say, 1M size in the atomic way, another reading process will either see all of the write or none of the write to have taken place.

(Right now, you could see a 'partial' read, where some pages from the write have been written already while others return the old data.)

And apparently, you can say "begin transaction" and "commit / abort transaction" to achieve the same for multiple operations as a group.

Hans, does that support nested transactions, too?

And one thing has slipped from my mind: How do I enter a transaction? is it like chroot(), or a task-specific thing, how can child processes participate in the transaction etc?

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 3 lines
High Availability & Clustering		ever tried. ever failed. no matter.
SuSE Labs				try again. fail again. fail better.
Research & Development, SuSE Linux AG		-- Samuel Beckett
#7 lore raw
In reply to Oleg Drokin
Quoted 13 lines · Oleg Drokin

Hello!

Quoted 6 lines · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Quoted 8 lines

Data does not need to be page aligned for atomic operations.

Bye,
Oleg

in reiser4

Signature · 1 line
Hans
#8 lore raw
Quoted 17 lines · Hans Reiser
Quoted 15 lines · Oleg Drokin

Hello!

Quoted 6 lines · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Data does not need to be page aligned for atomic operations.

Quoted 7 lines
Quoted 6 lines

Bye,
Oleg

in reiser4

Why?

Quoted 4 lines
Signature · 2 lines
-- 
Hans

Nikita.

Quoted 1 line
#9 lore raw
Quoted 24 lines · Nikita Danilov
Quoted 23 lines · Hans Reiser
Quoted 21 lines · Oleg Drokin

Hello!

Quoted 6 lines · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Data does not need to be page aligned for atomic operations.

Bye,
Oleg

Quoted 3 lines
Quoted 1 line

in reiser4

Why?

I mean, neither it need to be in ext[23].

Quoted 6 lines
Quoted 5 lines
Signature · 2 lines
-- 
Hans

Nikita.

Quoted 2 lines
Quoted 2 lines
#10 lore raw
In reply to Nikita Danilov
Quoted 24 lines · Nikita Danilov
Quoted 23 lines · Hans Reiser
Quoted 21 lines · Oleg Drokin

Hello!

Quoted 6 lines · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will act on them atomically? Or does that mean that the utils are already page aligned by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Data does not need to be page aligned for atomic operations.

Bye,
Oleg

Quoted 6 lines
Quoted 1 line

in reiser4

Why?

Because atomicity in ext3 basically consists of guaranteeing that the filesystem is consistent, and due to the disk drive implementation 4k blocks are written atomically. So, if you span more than one block, it is not guaranteed to be atomic.

Someone should correct me if I got it wrong, as ext3 is not my specialty....

#15 lore raw
In reply to Mike Fedyk
Quoted 18 lines · Mike Fedyk
Quoted 15 lines · Hans Reiser
Quoted 12 lines · Tom Vier

would it be much more difficult to allow non-page aligned bufs to be written atomically? a fully atomic fs would be very nice. otherwise, a lot of utils and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic. of course, even neater would be the ability to group multiple ops into one atomic action. (this is probably already planned - it's been a while since i read the reiserfs4 paper on the namesys site.)

Quoted 8 lines
Quoted 4 lines

reiser4 does all this that you ask for, although the user space API is not yet compiling;-)

So you can have one 5k memory area that spans two pages, and it will act on them atomically?

we deal with files not memory areas.

Quoted 7 lines

Or does that mean that the utils are already page aligned
by other kernel mechanisims? Or that they'll have to use the reiser API to do some of the above (other than the op grouping)?

Signature · 1 line
Hans
#11 lore raw
In reply to Hans Reiser
Quoted 43 lines

-----Mensaje original-----
De: Hans Reiser [mailto:[email protected]] Enviado el: viernes, 29 de agosto de 2003 23:43
Para: Nikita Danilov
CC: Oleg Drokin; Mike Fedyk; Tom Vier; Reiserfs List
Asunto: Re: reiser4 data journalling?

Quoted 10 lines · Nikita Danilov
Quoted 9 lines · Hans Reiser
Quoted 7 lines · Oleg Drokin

Hello!

Quoted 1 line · Mike Fedyk

So you can have one 5k memory area that spans two pages, and it will

act on

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

them atomically? Or does that mean that the utils are already page

aligned

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by other kernel mechanisims? Or that they'll have to use the reiser

API to

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines

do some of the above (other than the op grouping)?

Data does not need to be page aligned for atomic operations.

Bye,
Oleg

Quoted 6 lines
Quoted 1 line

in reiser4

Why?

Quoted 8 lines

Because atomicity in ext3 basically consists of guaranteeing that the filesystem is consistent, and due to the disk drive implementation 4k blocks are written atomically. So, if you span more than one block, it is not guaranteed to be atomic.

Someone should correct me if I got it wrong, as ext3 is not my specialty....

I think that is right.

#12 lore raw
In reply to Hans Reiser
Quoted 2 lines · Hans Reiser
Quoted 1 line

Because atomicity in ext3 basically consists of guaranteeing that the filesystem is consistent, and due to the disk drive implementation 4k blocks are written atomically. So, if you span more than one block, it is not guaranteed to be atomic.

I was told most modern disks run with 32-64K blocks internally.

4K is very unlikely.

Of course they don't always guarantee that a write of such a block is atomic, but then they also don't guarantee it for 4K.

The only sure way is to wait for the disk telling you it is finished (= use write barriers) and/or turn the write buffer off. Even then you have to hope that the disk firmware doesn't lie to you.

-Andi

#17 lore raw
In reply to Lars Marowsky-Bree
Quoted 5 lines · Lars Marowsky-Bree

On 2003-08-28T20:18:14,
Tom Vier <[email protected]> said:

Quoted 8 lines
Quoted 4 lines

and shell builtins would have to be modded to insure page alignment. it would be neat if all the regular builtins (cp, mv, ln) were atomic.

mv (ie, rename), ln and rm have always been atomic. That's a POSIX requirement.

Programs that need atomicity find it inconvenient that only one mv, or one ln, and or one rm, or one 4k write of a block, are atomic operations.

Quoted 7 lines

The new thing with reiserfs4 seems to be that if you do a write of, say, 1M size in the atomic way,

another reading process will either see all of the write or none of the write to have taken place.

No, isolation is not yet implemented and won't be unless we come up with some more funding from somewhere. The txnmgr seems to be structured to handle isolation, but....

The new thing with reiser4 is that if you do that write of 1MB to a file, and perhaps updates to 63 other files as well, as part of an atom, it will either all survive a crash, or none of it will. We have considered using the term "transcrash" for this.

Quoted 18 lines

(Right now, you could see a 'partial' read, where some pages from the write have been written already while others return the old data.)

And apparently, you can say "begin transaction" and "commit / abort transaction" to achieve the same for multiple operations as a group.

Hans, does that support nested transactions, too?

And one thing has slipped from my mind: How do I enter a transaction? is it like chroot(), or a task-specific thing, how can child processes participate in the transaction etc?

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 1 line
Hans
#13 lore raw
In reply to Andi Kleen
Quoted 9 lines · Andi Kleen
Quoted 3 lines · Hans Reiser

Because atomicity in ext3 basically consists of guaranteeing that the filesystem is consistent, and due to the disk drive implementation 4k blocks are written atomically. So, if you span more than one block, it is not guaranteed to be atomic.

I was told most modern disks run with 32-64K blocks internally.

This is very interesting, it would explain something that has puzzled me for a long time about 64k being the optimal transfer size.

Quoted 5 lines

4K is very unlikely.

Of course they don't always guarantee that a write of such a block is atomic, but then they also don't guarantee it for 4K.

What they do in the event of power loss is the big unclear for hard drives. Maybe I should ask for government funding to test hard drives for what they actually do, and how they handle power loss.;-) Somebody needs to test these folks.....

Most filesystems are designed based around the assumption that ecc on the drive will detect failed writes with 4k granularity. If I remember right, some folks on this list have said some things suggesting that for some IBM drives a power failure can cause a more than 4k chunk to go bad, and that this can be a problem for filesystem consistency.

It would probably be nice for the OS and the drive to use the same block size..... or at least interesting to experiment with.

Quoted 8 lines

The only sure way is to wait for the disk telling you it is finished (= use write barriers) and/or turn the write buffer off. Even then you have to hope that the disk firmware doesn't lie to you.

-Andi

Signature · 1 line
Hans
#14 lore raw
Quoted 2 lines · Hans Reiser

some IBM drives a power failure can cause a more than 4k chunk to go bad, and that this can be a problem for filesystem consistency.

this thread talks about fsync, wb's, etc, and i think also mentions the problem w/ an ibm drive. if not, it's in another thread from around the same time. i forgot i had this linked on wipe.sf.net (shameless plug ;).

http://www.ussg.iu.edu/hypermail/linux/kernel/0103.0/0331.html

Signature · 2 lines
Tom Vier <[email protected]>
DSA Key ID 0xE6CB97DA
#18 lore raw
In reply to Hans Reiser
Quoted 3 lines · Hans Reiser

No, isolation is not yet implemented and won't be unless we come up with some more funding from somewhere. The txnmgr seems to be structured to handle isolation, but....

Ah, okay. Sorry, I think I had older plans in mind and hadn't checked how far the current roadmap matched up to them ;-)

Quoted 4 lines

The new thing with reiser4 is that if you do that write of 1MB to a file, and perhaps updates to 63 other files as well, as part of an atom, it will either all survive a crash, or none of it will. We have considered using the term "transcrash" for this.

So it's ACD and not ACID ;-) Sounds good. How is this weak transaction exported to userspace, ie how do I signal BEGIN and COMMIT/ABORT?

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 3 lines
High Availability & Clustering		ever tried. ever failed. no matter.
SuSE Labs				try again. fail again. fail better.
Research & Development, SuSE Linux AG		-- Samuel Beckett
#19 lore raw
Quoted 18 lines · Lars Marowsky-Bree
Quoted 3 lines · Hans Reiser

No, isolation is not yet implemented and won't be unless we come up with some more funding from somewhere. The txnmgr seems to be structured to handle isolation, but....

Ah, okay. Sorry, I think I had older plans in mind and hadn't checked how far the current roadmap matched up to them ;-)

Quoted 3 lines

The new thing with reiser4 is that if you do that write of 1MB to a file, and perhaps updates to 63 other files as well, as part of an atom, it will either all survive a crash, or none of it will. We have considered using the term "transcrash" for this.

Quoted 10 lines

So it's ACD and not ACID ;-) Sounds good. How is this weak transaction exported to userspace, ie how do I signal BEGIN and COMMIT/ABORT?

Sincerely,
Lars Marowsky-Brée <[email protected]>

sys_reiser4 allows various operations such as assignment, and transactions are indicated using a delimiter. I am still trying to figure out what is the best delimiter to use, it needs to be a delimiter pair, but what?

Perhaps t{ and }t

?

I worry that users will let a legitimate t variable name get too close to the {}'s.....

There is a symbol shortage unfortunately.

Probably I should use x{ and }x as a convention for new kinds of delimiters, and let x be t in the case of delimiting transactions.

Signature · 1 line
Hans