gmirror balance model "prefer" doesnt work properly

Wojciech Puchar wojtek at puchar.net
Sat Aug 15 09:34:11 UTC 2020


ada0p3 is partition on SSD, ada3p3 is partition on magnetic disk.



Geom name: root
State: COMPLETE
Components: 2
Balance: prefer
Slice: 2097152
Flags: NONE
GenID: 0
SyncID: 1
ID: 3736675121
Type: AUTOMATIC
Providers:
1. Name: mirror/root
    Mediasize: 107374181888 (100G)
    Sectorsize: 512
    Stripesize: 4096
    Stripeoffset: 0
    Mode: r1w1e1
Consumers:
1. Name: ada0p3
    Mediasize: 107374182400 (100G)
    Sectorsize: 512
    Stripesize: 0
    Stripeoffset: 525139968
    Mode: r1w1e1
    State: ACTIVE
    Priority: 1
    Flags: (null)
    GenID: 0
    SyncID: 1
    ID: 3655477467
2. Name: ada3p3
    Mediasize: 107374182400 (100G)
    Sectorsize: 512
    Stripesize: 4096
    Stripeoffset: 0
    Mode: r1w1e1
    State: ACTIVE
    Priority: 0
    Flags: NONE
    GenID: 0
    SyncID: 1
    ID: 3836554217


according to manual reads should be preferred from device of higher 
priority. i've set priority 1 for ssd, 0 for hdd. but reads are from hdd 
only.

tried reverse - 0 for ssd, 1 for hdd - too reads are from hdd.

looking in code seems like it is not implemented at all

         LIST_FOREACH(disk, &sc->sc_disks, d_next) {
                 if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE)
                         break;
         }


just take first active disk.

why?


More information about the freebsd-hackers mailing list