For ALUA-capable storage arrays, multipath-tools currently uses TUR
(Test Unit Ready) as the default path checker while a separate
prioritizer determines ALUA state. When sysfs provides ALUA state
(the common case), no RTPG command is needed for priority. However,
if sysfs is unavailable or detect_prio is off, the prioritizer issues
RTPG, resulting in two SCSI commands per path check cycle: TUR + RTPG.

This patch series introduces:

1. An 'alua' path checker that uses RTPG as the path check command,
   providing richer path state information than TUR:
   * TRANSITIONING state detected and mapped to PATH_PENDING,
     preventing false all paths down during controller failover
   * STANDBY state detected and mapped to PATH_GHOST
   * UNAVAILABLE/OFFLINE states properly distinguished

2. An 'alua_cached' prioritizer that uses cached state from the alua
   checker, eliminating duplicate RTPG commands.

This design intentionally couples the checker and prioritizer: the
alua_cached prioritizer consumes state cached by the alua checker.
While this blurs the traditional separation between these components,
for ALUA the path state and priority fundamentally derive from the
same underlying data, making the coupling a natural fit.

The patches set the alua checker as the auto-detected default for ALUA
devices. Explicitly configured checkers in the hardware table take
precedence over auto-detection.

As part of this change, the common async threading infrastructure is
extracted from the TUR checker into a new async_checker base class.
Both TUR and ALUA checkers now extend this base, eliminating code
duplication and establishing a pattern for future async checkers.

Brian Bunker (2):
  checkers: add alua path checker and async checker framework
  prioritizers: add alua_cached prioritizer

 libmultipath/Makefile                   |   2 +-
 libmultipath/async_checker.c            | 245 +++++++++++++++++++
 libmultipath/async_checker.h            | 122 ++++++++++
 libmultipath/checkers.c                 |   1 +
 libmultipath/checkers.h                 |   1 +
 libmultipath/checkers/Makefile          |   3 +-
 libmultipath/checkers/alua.c            | 256 ++++++++++++++++++++
 libmultipath/checkers/tur.c             | 302 +++---------------------
 libmultipath/libmultipath.version       |   8 +
 libmultipath/prio.c                     |   1 +
 libmultipath/prio.h                     |   1 +
 libmultipath/prioritizers/Makefile      |   1 +
 libmultipath/prioritizers/alua.c        |  30 ---
 libmultipath/prioritizers/alua.h        |   8 +
 libmultipath/prioritizers/alua_cached.c | 193 +++++++++++++++
 libmultipath/prioritizers/alua_rtpg.c   |  57 ++++-
 libmultipath/prioritizers/alua_rtpg.h   |   4 +
 libmultipath/prioritizers/sysfs.c       |   7 +-
 libmultipath/propsel.c                  |  29 ++-
 libmultipath/structs.c                  |   2 +
 libmultipath/structs.h                  |   3 +
 multipath/multipath.conf.5.in           |  23 +-
 22 files changed, 988 insertions(+), 311 deletions(-)
 create mode 100644 libmultipath/async_checker.c
 create mode 100644 libmultipath/async_checker.h
 create mode 100644 libmultipath/checkers/alua.c
 create mode 100644 libmultipath/prioritizers/alua_cached.c

-- 
2.50.1 (Apple Git-155)


Reply via email to