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

Re: Ordered/Writeback mode questions


On Fri, Aug 03, 2001 at 10:58:17PM +0800, Yusuf Goolamabbas wrote:
> Some more dumb question, assuming I was using writeback mode and I made
> a series of inserts into a database (not neccasary a database
> transaction), my understanding is if the machine rebooted between
> inserts, I couldn't gurantee if the data actually was on disk or not
> even though the database server could have returned an okay saying it
> got an okay from the filesystem (assuming I have write-caching on disk
> disabled)

No, because a database cannot return the "OK" value without first
telling the kernel to be sure that everything is flushed to disk,
either by writing with O_SYNC or by calling fsync on the file.  All
ext3 data modes obey those instructions correctly.  

> Now, if I were to use ordered mode. Everything would be in the right
> place on the disk in the above scenario.

If the application asks for sync data, yes.  If not, then neither
writeback nor ordered data mode will make that guarantee --- in both
cases the filesystem will write the data back asynchronously.  The
only difference is that the ordered mode guarantees that the data is
flushed before the metadata, whereas writeback mode doesn't make that


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