mds: only evict an unresponsive client when another client wants its caps
Instead of immediately evicting a client when it has not responded within the timeout, set a flag to mark the client as laggy. Then in Locker, when another client tries to do something that would be blocked by the laggy client, evict the laggy client.
Test this by having two clients, accessing separate directories. Have client A go unresponsive, and see that it is not evicted while client B continues to do work in its own directory. Then, have Client B try and touch the files in client A's directory, and see that client A gets evicted at that point.
#1 Updated by Patrick Donnelly about 1 year ago
- Subject changed from Only evict an unresponsive client when another client wants its caps to mds: only evict an unresponsive client when another client wants its caps
- Target version changed from v12.0.0 to v14.0.0
- Source changed from other to Development
- Tags set to intern
- Component(FS) MDS added
Rishabh Dave wrote:
I am planning to start working on this feature. How can I get a client to be unresponsive without evicting it?
check Server::find_idle_sessions(). the function checks if clients have renewed their sessions recently. A client is unresponsive if it hasn't renewed its session for session_timeout seconds. Once found unresponsive client, you can check Locker::revoking_caps_by_client to find if mds wants to revoke caps from the unresponsive client.
#6 Updated by Rishabh Dave 9 months ago
Unresponsive/stale clients do not hold any caps1. Therefore, deferring their eviction would mean keeping them infinitely. Instead, Zheng suggested to avoid marking open sessions holding no caps stale and evict them directly at session_autoclose1.