[PATCH 0/2] libceph: support pg_upmap_primary (the read balancer)

From: Xiubo Li via B4 Relay

Date: Mon Nov 30 2026 - 01:12:47 EST


Since reef, the mgr read balancer ("ceph balancer mode read" or
"upmap-read") and "ceph osd pg-upmap-primary" choose the primary of
each PG explicitly, so that reads, which normally go to the primary,
are spread evenly over the OSDs.

Kernel clients cannot take part today. libceph does not decode
pg_upmap_primary and does not advertise SERVER_REEF, the feature the
monitors require from every client once the OSDMap holds such an
entry. So "ceph osd set-require-min-compat-client reef" is refused
while kernel clients are connected, and a kernel client can neither
mount CephFS nor map an rbd image on a cluster that already uses the
read balancer:

libceph: RADOS feature set mismatch: server's required > my supported 0x2f018fb87aa4aafe, missing 0x80000000
libceph: mon0 (2)127.0.0.1:17300 missing required protocol features

Patch 1 decodes the mappings from full and incremental maps and
applies them the way OSDMap::_apply_upmap() does. Patch 2 advertises
SERVER_REEF, which towards clients only selects the OSDMap encodings
that carry pg_upmap_primary.

Tested with the series applied to a 7.2-based tree, built as the
libceph, ceph and rbd modules, against a 3-OSD tentacle cluster:
CephFS mounts and rbd maps work with the read balancer on, the
kernel's pg_upmap_primary entries follow the cluster through full and
incremental maps, and all I/O of a PG goes to the chosen primary.
Without entries, krbd fio and an IO500 run show no difference from the
unpatched modules. The read balancer numbers are in patch 2.

---
Xiubo Li (2):
libceph: decode and apply pg_upmap_primary mappings
libceph: advertise SERVER_REEF

include/linux/ceph/ceph_features.h | 4 +-
include/linux/ceph/osdmap.h | 4 ++
net/ceph/debugfs.c | 7 +++
net/ceph/osdmap.c | 99 +++++++++++++++++++++++++++++++++++++-
4 files changed, 112 insertions(+), 2 deletions(-)
---
base-commit: 3f90412e989cb381d4bf96260468f5c7b2d08655
change-id: 20261130-b4-libceph-upmap-primary-9fc9dbab8652

Best regards,
--
Xiubo Li <xiubo.li@xxxxxxxxx>