-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-xroot: Allow client to reattempt open on pool when I/O stalls
Motivation: This patch is proposed as a palliative for an issue we have encountered on our production systems at Fermilab. What appears to happen is that IO on read stalls (this sometimes reveals itself as a broken pipe exception after the fact). After the client waits (default 1 minute), it attempts a reconnect directly to the pool endpoint without going back to the door. Depending on the timing, the client may find, at its second open attempt, that the mover has been released (because of either the late arriving exception or channel inactivity) and is no longer available. In this case, the read then usually fails with the client receiving a "uuid no longer valid" message. In other cases, it may encounter a socket closed error, and, more rarely, it may actually succeed. While we are not entirely certain what is causing this to happen (there are some correlations with disk RAID degeneration and network TX spiking), we would nonetheless like to consistently allow the client to reconnect and finish the read when possible. Modification: The Netty Mover Channel (inner class in the Netty Transfer Service) can be shared or exclusive. In HTTP (GET) the mover can evidently be used to read concurrently at different offsets on different connections. In xroot, however, chunked reads are all done on the same socket, even though the xroot pool opens the channel in shared mode. In support of shared mode, the channel uses a reference count to determine whether it can be closed. On each open, the count is incremented, and thus will require a corresponding close. Because, as mentioned above, the release of the mover through the methods channelInactive and/or exceptionCaught is subject to timing and the order in which this occurs is not guaranteed with respect to the client requests to login, open and end the previous session, a strategy of releasing without closing the mover in those methods is not reliable. Nor can we, in general, expect the client to trigger multiple closes in the proper order. But since a reference count > 1 in xroot (as opposed to HTTP) always denotes a previous failure and successive attempt at recovery, we can safely force closure of the mover on the first close request received. To implement this new logic, three things have been done: If the mover channel IO mode is READ (and if any associated caught exception is an IOException), we do not release the mover as before, but allow it to remain in the map, available for a reconnect attempt. On doOnClose (in response to the client's kXR_close request), a new Mover Channel releaseAll() method is called instead of release(). This forces close on the Mover Channel (a small method has also been added to the Mover Channel Sync class in support of this). In order not to rely on the JTM to clean up (release) orphaned movers, we have also implemented a timer. When a the channel goes inactive but we do not release the mover, a timer is started. If a reconnect occurs before the timeout, the timer is canceled. Otherwise, at the timeout, the mover is released as on close(). We have added debug logging to track the cases where timers are started and stopped. Result: No observable change to the normal semantics of read or write. On I/O stall on the pool, with the client attempting reconnect, the read succeeds and the client disconnects cleanly. Target: master Request: 7.0 Request: 6.2 Request: 6.1 Request: 6.0 Request: 5.2 Patch: https://rb.dcache.org/r/12917/ Acked-by: Dmitry
- Loading branch information
Showing
6 changed files
with
205 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.