<div dir="ltr">Thanks for clarifying this. My concern is that an "application writer" can be a Windows VM via qemu and I don't know if flush requests are supported in the specific qemu version we're using, I'm in the process of confirming that.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 9:58 PM, Spelic <span dir="ltr"><<a href="mailto:spelic@shiftmail.org" target="_blank">spelic@shiftmail.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/03/2015 18:13, Thanos Makatos wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks, Joe. So just to make sure I've understood correctly, if the SSD cache is configured as a write-back cache but the device cache is disabled/set to write-though on the HDD and the SSD, then there is no risk of data loss in the event of a failure. Is my understanding correct?<br>
<br>
</blockquote>
<br></span>
You don't seem to understand the semantics of flush.<br>
Writes on filesystems and databases are made more or less like a copy-on-write semantic:<br>
- New data is written elsewhere<br>
- a flush is issued<br>
- when flush returns you are sure that such new data is on stable storage (disk platters or similar)<br>
- change one pointer to point from old data to new data (so small that this change is atomic)<br>
- flush again<br>
when this flush returns you are sure that the data on-disk is updated.<br>
<br>
Now you understand why dm-cache has the semantics that it has, which is the same semantics as DRAM caches on HDDs.<br>
<br>
Applications writers have to follow the semantics described above, in order to have "atomic" updates on disk. This is true with dm-cache but also with DRAM caches on HDDs.<br>
Partial data losses are irrelevant if the above logic is followed.<br>
<br>
S.<br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com" target="_blank">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/dm-devel</a><br>
</blockquote></div><br></div>