Skip to content

RFC ceph: manual client session reset via debugfs

Alex Markuze ceph-devel linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ceph: convert inode flags to named bit positionsfs/ceph/locks.c fs/ceph/mds_client.c fs/ceph/super.h+38 -272 replies
2/4ceph: add bounded timeout and diagnostics to wait_caps_flush()fs/ceph/caps.c fs/ceph/mds_client.c fs/ceph/super.h+48 -20 replies
3/4ceph: implement manual client session reset via debugfsfs/ceph/debugfs.c fs/ceph/locks.c fs/ceph/mds_client.c +3 more+707 -210 replies
4/4ceph: rework mds_peer_reset() for robust session recoveryfs/ceph/mds_client.c+86 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH v1 0/4] ceph: manual client session reset via debugfs

In production CephFS deployments we regularly encounter situations where MDS sessions become stuck or hung, requiring a full unmount/ remount cycle to recover. This is disruptive for workloads that cannot tolerate the downtime or the loss of cached state that comes with unmounting.

This series adds a mechanism to manually trigger MDS session reconnection from the client side without unmounting, exposed via debugfs:

echo "reason text" > /sys/kernel/debug/ceph/<fsid>/reset/trigger cat /sys/kernel/debug/ceph/<fsid>/reset/status

The reset lifecycle:
1. Operator writes to the trigger file
2. A work item collects all active sessions and initiates reconnection on each (via send_mds_reconnect with from_reset=true)
3. New metadata requests and lock acquisitions are blocked until the reset completes (120s timeout)
4. Session completions are tracked via a per-session generation counter to handle stale completions from timed-out prior resets
5. Lock reclamation is always attempted during reset-initiated reconnects, regardless of prior CEPH_I_ERROR_FILELOCK state

Patch breakdown:
1. Convert CEPH_I_* flags to named bit positions so test_bit/ set_bit/clear_bit can be used in reconnect paths
2. Make wait_caps_flush() bounded with periodic diagnostic dumps to aid debugging hung flush scenarios (independent improvement that surfaced during development)
3. The core reset implementation: debugfs interface, reset work function, request/lock blocking, tracepoints, and session reconnect completion tracking
4. Rework mds_peer_reset() to properly handle all session states and integrate with the reset completion tracking

Open questions / areas for review:
- Is debugfs the right interface, or should this be a mount option / sysfs attribute / netlink command?
- The request gating in ceph_mdsc_submit_request() is best-effort (no lock serialization) to avoid penalizing the normal path. Is this acceptable?
- Should the 60s reconnect timeout and 120s blocked-request timeout be configurable (e.g. via mount options)?
- mds_peer_reset() rework (patch 4) is substantial -- would reviewers prefer it split further?

Alex Markuze (4):
ceph: convert inode flags to named bit positions
ceph: add bounded timeout and diagnostics to wait_caps_flush()
ceph: implement manual client session reset via debugfs
ceph: rework mds_peer_reset() for robust session recovery

 fs/ceph/caps.c              |   7 +
 fs/ceph/debugfs.c           | 171 ++++++++++-
 fs/ceph/locks.c             |  24 +-
 fs/ceph/mds_client.c        | 577 ++++++++++++++++++++++++++++++++++--
 fs/ceph/mds_client.h        |  33 +++
 fs/ceph/super.h             |  60 ++--
 include/trace/events/ceph.h |  60 ++++
 7 files changed, 879 insertions(+), 53 deletions(-)
Signature · 1 line
2.34.1