After a CephFS client evict: check and clear the OSD blocklist
A CephFS client evict blocklists the address with no expiry, so the 1-hour mon_osd_blocklist_default_expire applies. Check it with ceph osd blocklist ls/rm.
When you run ceph tell mds.<id> client evict, the client loses more than its MDS session: its address goes on the OSD blocklist and it cannot reach data either. By default the entry stays for one hour, and the same mount cannot reconnect during that time. The recovery the docs recommend is to unmount that client and mount it fresh.
[1] Find the client first. As in the docs, read id and inst (the address) from the session list.
$ ceph tell mds.0 client lsIn an inst value such as client.4305 192.0.2.34:0/422650892 (the docs' example, with only the address changed to a documentation range), the IP:0/number part is the address that will be blocklisted.
[2] Evict it. The docs warn that any un-flushed buffered writes are lost.
$ ceph tell mds.0 client evict id=4305[3] Know what happens next. On eviction, Squid 19.2.3's MDSRank.cc sends this command to the monitors (source; Reef 18.2.7 has the same code):
*css << "{\"prefix\":\"osd blocklist\", \"blocklistop\":\"add\","; *css << "\"addr\":\""; *css << addr; *css << "\"}";There is no expire. When expire is missing, the monitor's OSDMonitor.cc uses mon_osd_blocklist_default_expire (source):
if (blocklistop == "add") { utime_t expires = ceph_clock_now(); // default one hour double d = cmd_getval_or<double>(cmdmap, "expire", g_conf()->mon_osd_blocklist_default_expire);| Option | Default (Reef 18.2.7, Squid 19.2.3) | Meaning |
|---|---|---|
mds_session_blocklist_on_evict | true | Blocklist on manual eviction |
mds_session_blocklist_on_timeout | true | Blocklist when stale sessions are dropped automatically |
mon_osd_blocklist_default_expire | 1_hr | Seconds an entry added without expiry stays in the OSD map |
Defaults come from src/common/options/mds.yaml.in and mon.yaml.in in both releases. Check your own cluster's values:
$ ceph config get mds mds_session_blocklist_on_evict$ ceph config get mon mon_osd_blocklist_default_expire[4] Check the blocklist. This is the example output from the docs:
$ ceph osd blocklist lslisted 1 entries127.0.0.1:0/3710147553 2018-03-19 11:32:24.716146The time after the address is the expiry; with -f json the same value appears as until (source). Match it against the evicted client's inst address. Once that time passes, the entry leaves the OSD map.
[5] Remove an entry early only when you must. The docs' example:
$ ceph osd blocklist rm 127.0.0.1:0/3710147553un-blocklisting 127.0.0.1:0/3710147553ceph osd blocklist clear removes every entry, including other evicted clients and entries added during failovers, so do not use it for a single client.
[6] Consider disabling blocklisting only for frequent evictions. The docs say that if slow client hosts or an unreliable network cannot be fixed, you can set mds_session_blocklist_on_timeout (automatic) and mds_session_blocklist_on_evict (manual) to false. Sessions are then dropped but OSD access remains. In that mode an eviction only affects the MDS you send it to, so with multiple active MDS daemons you must send it to each. To undo, return to the default (true) with ceph config rm mds <option>.
The automatic eviction conditions (session_autoclose 300 seconds, mds_reconnect_timeout 45 seconds and so on) are in the same document. For another MDS-side check, see cephfs-journal-tool EPERM.