Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: " " <Cedric.dewijs@eclipso.eu>
To: <linux-btrfs@vger.kernel.org>
Subject: btrfs raid 1 with a shared fast read cache, and individual slow write caches in front of hard drives, how?
Date: Sun, 03 Jan 2021 13:46:44 +0100	[thread overview]
Message-ID: <fe1026c7d3efbf7d0ebb35cddb2c5774@mail.eclipso.de> (raw)

­I would like to create a btrfs raid array where one device (either hard drive, SSD or flash drive) can fail, and all the data survives.
Also, I would like to have a write cache in front of all the mechanical drives, so they can stay idle until the write cache if full, or data is requested that is not in the read cache.

I've looked at bcache. This can cache multiple block devices with a single read cache, but it cannot be stacked [1], so I cannot give each hard drive it's own (small) write cache, with a shared large read cache like this:
[1] https://bugzilla.kernel.org/show_bug.cgi?id=211011

+--------------------------------------------+
|         btrfs raid 1 (2 copies) /mnt       |
+--------------+--------------+--------------+
| /dev/bcache3 | /dev/bcache4 | /dev/bcache5 |
+--------------+--------------+--------------+
|              Read Cache (SSD)              |
|                /dev/sda4                   |
+--------------+--------------+--------------+
| /dev/bcache0 | /dev/bcache1 | /dev/bcache2 |
+--------------+--------------+--------------+
| Write Cache  | Write Cache  | Write Cache  |
|(Flash Drive) |(Flash Drive) |(Flash Drive) |
| /dev/sda5    | /dev/sda6    | /dev/sda7    |
+--------------+--------------+--------------+
| Data         | Data         | Data         |
| /dev/sda8    | /dev/sda9    | /dev/sda10   |
+--------------+--------------+--------------+

Would it be a good idea to use dm-cache to create pairs of hard drives and flash drives, and then use bcache on top of that to create a big shared read cache like this?

+--------------------------------------------+
|         btrfs raid 1 (2 copies) /mnt       |
+--------------+--------------+--------------+
| /dev/bcache0 | /dev/bcache1 | /dev/bcache2 |
+--------------+--------------+--------------+
|              Read Cache (SSD)              |
|                /dev/sda4                   |
+--------------+--------------+--------------+
| Logical      | Logical      | Logical      |
| Volume 0     | Volume 1     | Volume 2     |
+--------------+--------------+--------------+
| Cache volume | Cache volume | Cache volume |
|(Flash Drive) |(Flash Drive) |(Flash Drive) |
| /dev/sda5    | /dev/sda6    | /dev/sda7    |
+--------------+--------------+--------------+
| Origin volume| Origin volume| Origin volume|
| =Physical    | =Physical    | =Physical    |
| volume (PV)  | volume (PV)  | volume (PV)  |
| /dev/sda8    | /dev/sda9    | /dev/sda10   |
+--------------+--------------+--------------+

Will this stack survive a drive that goes missing? For instance by pulling out the data cable or the power cable of that drive?
Will this stack survive a drive that is silently corrupting data? For instance by dd'ing random data to it?

How would you solve this problem? 

---

Take your mailboxes with you. Free, fast and secure Mail &amp; Cloud: https://www.eclipso.eu - Time to change!



                 reply	other threads:[~2021-01-03 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=fe1026c7d3efbf7d0ebb35cddb2c5774@mail.eclipso.de \
    --to=cedric.dewijs@eclipso.eu \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox