[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: application level write ordering guarantees?

On Mon, Dec 16, 2002 at 09:26:52AM -0500, Theodore Ts'o wrote:
> In general, applications can't expect anything about data write
> ordering unless they use fsync(), which guarantees that everything
> written up to that point is flushed out to disk.  And with filesystems
> that do not have journalling support, in general there is no
> guarantees at all about whether file deletes, renames, etc. will be
> committed to disk in any order, or if they will happen at all in the
> advent of a crash.

I see.  So if I want to require that a file gets renamed before
another file gets deleted, after the rename I would fsync() the file?
If the file is moving from one directory to another I would also have
to fsync() the destination (?) directory?

> you care about ordering, then the application may need to do its own
> application-level journaling (that's what most databases do, for
> example).

Yes, I think I will have to do some (mild) version of this.

> I hope this helps!

Indeed, your message was very helpful.  I realize now my previous
strategy (involving a lot of writing files and then renaming them)
isn't very robust against system crashes.

Ben Escoto

Attachment: pgp00000.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]