New copy 'placement' dataset property #16095
Replies: 3 comments 4 replies
-
So then the next question becomes, what happens if my special device completely fails? As a prerequisite, let say we make sure 100% of the critical metadata for importing the pool always has at least one copy on the pool. @behlendorf thinks this metadata may only be a few megabytes. I'm not talking about the file metadata here, I'm talking about just enough critical metadata to have '/tank' imported with literally no files in it. However, all is not lost, as every dataset that has Let's run though an example: $ zpool create tank /dev/sda special /dev/nvme1n1
<install Fedora on pool>
# Mark the directories we really really care about with
# placement=resilient. We know that their metadata
# will have 2 copies written by default, and since we set
# placement=resilient then we know one copy will be
# on the pool.
zfs set placement=resilient tank/home
zfs set placement=resilient tank/etc
$ ls /tank
afs bin boot dev etc home junk lib lib64 lost+found media mnt opt proc root run sbin srv sys tank tmp usr var
< we add users, write data to the pool, years pass >
< special disks fail >
$ zpool import tank
Warning, your special allocation vdevs are missing but you have
feature@copy_placement enabled, so some datasets that have a copy
of their data on the pool may be recoverable. Pass -f to import
anyway.
$ zpool import -f tank
# The two directories we marked with placement=resilient show up, but nothing else
$ ls /tank
etc home |
Beta Was this translation helpful? Give feedback.
-
The advantages of this over #16073:
|
Beta Was this translation helpful? Give feedback.
-
So ultimately I don't think that a per-dataset property is going to work as a replacement for #16073, due to the dedup data being per-pool. I've decided to go with a new, simplied version of my old PR instead. The new PR is here: #16185 |
Beta Was this translation helpful? Give feedback.
-
@behlendorf and I got to talking about #16073, and we had an idea for a more elegant way to handle backing up special device metadata to the pool. Imagine if we had a dataset property called
placement
that could control where each of the 3 DVA copies landed.These values are only a "preference", and ZFS can override them. Like, if if you do
placement=special
and there's no more special disk space, then write to the pool instead (which copies our current behavior inmaster
).To create a pool with all the metadata backed-up to the main pool:
placement
would overridespecial_small_blocks
for a dataset it unless it's set to "auto" ("auto" would honorspecial_small_blocks
and use all our normal data placement logic). So if you setplacement=special
and then wrote multi-GB ISOs into the directory, it would all go to special, regardless of whatspecial_small_blocks
was set to. This could be used as a way to get certain datasets to go completely on special devices (to reduce load times for games, serving a busy directory on a webserver that doesn't fit in RAM, etc).Alternate names for "placement": "copy_placement" "allocation_preference" "placement_preference" "copy_preference"
Beta Was this translation helpful? Give feedback.
All reactions