Commit 77cc47c
committed
lio_ha: add TrueNAS LIO HA forwarding module
Introduces lio_ha.ko, a kernel module that implements active/standby
high-availability for the LIO SCSI target subsystem on TrueNAS.
On the STANDBY node, the module intercepts every SCSI command, TMR,
and PR OUT before it reaches the local backend and forwards it to the
ACTIVE node over a private TCP channel (port 999). On failover a
single write to a configfs attribute clears the forwarding flag;
lio_ha restores replicated Persistent Reservation state directly into
LIO core, opens the local iblock/fileio backends, and resumes local
execution -- without removing or reinserting any LUN.
On the ACTIVE node, a private fabric driver (ha_recv) accepts the TCP
connection from STANDBY, creates a synthetic se_session for each
initiator with the correct node_acl, and submits forwarded commands to
LIO core for local execution under the right I_T nexus context so that
PR per-I_T nexus checking remains correct across the HA pair.
The module is loaded on both nodes. A single persistent TCP
connection carries session lifecycle, I/O, TMR, PR replication
(PERS_ACTION), and bulk PR sync (LUN_SYNC) traffic.
Enabled by CONFIG_LIO_HA (tristate, depends on CONFIG_TRUENAS).1 parent ba4e7fa commit 77cc47c
15 files changed
Lines changed: 4524 additions & 0 deletions
File tree
- drivers/target
- lio_ha
- scripts/package/truenas
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments