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

Re: [MirageOS-devel] Sync Block Device



> On 12 Dec 2014, at 19:16, Konstantin Weitz <weitzkon@xxxxxx> wrote:
> 
> I'm trying to write a database. The database is using a block device for 
> storage. I want to make sure that after a commit, all data has actually been 
> persistent on disk. 
> 
> The documentation for the `write` command says that on success, the written 
> data is persistent:
> 
> https://github.com/mirage/mirage/blob/1.1.0/types/V1.mli#L134
> 
> Is this true, or do I need to call a `sync` command that asks the block 
> device to persist all writes (i.e. write the contents of the hard drive's 
> hardware cache to disk?)

Itâs supposed to be true :-) For reference two significant implementations are:

1. Xen blkfront: where the write is considered persistent when the request on 
the ring has been replied to. The usual contract is that the Xen backend wonât 
reply until the data has hit the disk. As an aside this can cause performance 
problems when the storage device has high latency (e.g. NFS) since the 
fixed-size ring fills up with pending requests.

2. Unix with O_DIRECT (unbuffered sector-aligned I/O)

Cheers,
Dave

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.