Do we now have mirrored swap automatically?

Status
Not open for further replies.

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
The disadvantages of a disk failing while it has a swap partition are known. According to a bug report this is now 'fixed':

https://redmine.ixsystems.com/issues/23523


The user guide is silent on this question, or at least I can't find it. Can we assume that when we reboot into 11.1-RELEASE then the swap partitions will be mirrored (as long as there is more than one disk in the pool!) across all disks in the pool(s)? And that this is regardless of the type of raid used?

Thanks for any reassurance.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
You can see if you have a bunch of GEOM mirrors using geom mirror list.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
You can see if you have a bunch of GEOM mirrors using geom mirror list.
Well I could dismantle my swap file on the boot volume and reboot again, I just wanted some reassurance that it would be worth it!

Edit: wrote too soon! I have indeed got two swap mirrors each using 2 of my 4 pool disks! Even though I am not actually using them for swap.
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I'd like to hear a little more information on this. Kind of a big change for not having anything in the release notes or manual.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I'd like to hear a little more information on this. Kind of a big change for not having anything in the release notes or manual.
It was probably in the release notes for 11.1-BETA1, when it was released. (The idea of putting all release candidate changelogs in the stable release documentation is already the subject of a feature request for the future.)

What seems to happen is that all pool disks get paired up as 2GiB mirrors and encrypted and used as swap. This seems to be a BSD function rather than a zfs mirror. I don't know what happens if you have an odd number of pool disks, or more than one pool. I can't find any more documentation than this, but the bug report will probably lead to the actual commit if you know how to find it (I always get lost on the way). But it seems to be totally user transparent.

https://redmine.ixsystems.com/issues/23523
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I'd like to hear a little more information on this. Kind of a big change for not having anything in the release notes or manual.
Well, it addresses an old problem that never had been addressed in 9.x because 10/Corral was coming and included the fix.

What seems to happen is that all pool disks get paired up as 2GiB mirrors and encrypted and used as swap. This seems to be a BSD function rather than a zfs mirror. I don't know what happens if you have an odd number of pool disks, or more than one pool.
Instead of using the partitions directly for swap, they're bundled up in GEOM mirrors (in simple terms, GEOM is FreeBSD's disk access layer and provides a number of additional features, like basic software RAID). The new FreeNAS code should be smart enough to not do stupid things, like add a single partition to the swap. It also limits the maximum number of mirror pairs used in order to keep GEOM from complaining about excessive workload and union rules. The disks themselves all still get the same partitions as before.

What I don't know yet is what the behavior is supposed to be in failure scenarios. More specifically, what is needed to restore a mirror after one of its elements fails.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I guess my questions are:
1. does this just magically work after upgrade?
2. does it rebuild the swap mirror when a drive fails?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Status
Not open for further replies.
Top Bottom