From: Spelic <spelic@shiftmail.org>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: dm-cache failure semantics in write-back mode
Date: Tue, 03 Mar 2015 22:58:00 +0100 [thread overview]
Message-ID: <54F62E68.4040002@shiftmail.org> (raw)
In-Reply-To: <CAM2wQBsS2hyA674CspKx6xZ49Fc1a=53UghaT5JkAPpjT3D_Ng@mail.gmail.com>
On 03/03/2015 18:13, Thanos Makatos wrote:
> 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?
>
You don't seem to understand the semantics of flush.
Writes on filesystems and databases are made more or less like a
copy-on-write semantic:
- New data is written elsewhere
- a flush is issued
- when flush returns you are sure that such new data is on stable
storage (disk platters or similar)
- change one pointer to point from old data to new data (so small that
this change is atomic)
- flush again
when this flush returns you are sure that the data on-disk is updated.
Now you understand why dm-cache has the semantics that it has, which is
the same semantics as DRAM caches on HDDs.
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.
Partial data losses are irrelevant if the above logic is followed.
S.
next prev parent reply other threads:[~2015-03-03 21:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 12:15 dm-cache failure semantics in write-back mode Thanos Makatos
2015-03-03 15:53 ` Thanos Makatos
2015-03-03 16:19 ` Joe Thornber
2015-03-03 17:13 ` Thanos Makatos
2015-03-03 17:28 ` Joe Thornber
2015-03-03 21:58 ` Spelic [this message]
2015-03-05 14:06 ` Thanos Makatos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F62E68.4040002@shiftmail.org \
--to=spelic@shiftmail.org \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.