Repository navigation
pool: take firefly flow-id of client transfers from the data connection - #8308
Open
ShawnMcKee wants to merge 1 commit into
Open
ShawnMcKee wants to merge 1 commit into
ShawnMcKee wants to merge 1 commit into
Conversation
Motivation: A firefly ties a network flow to an experiment and an activity. The flow-id must therefore name the TCP connection that carries the data. For xrootd and http(s) transfers that a door redirects to a pool, it does not (dCache#8307). NettyTransferService sends the start marker when the mover is created, before the client has connected to the pool, and takes the remote endpoint from the protocol info. That is the client's connection to the door. The client then connects to the pool from a different port, so the marker carries one port from each connection and matches no flow. The end marker repeats the same endpoint. On a production pool the client port was wrong in 54 of 55 transfers and right in none. Modification: The start marker is no longer sent from executeMover. NettyMoverChannel gains connected(remote, local), which the protocol handlers call with the addresses of the Netty channel once a client has attached to the mover: HttpPoolRequestHandler for GET and PUT, XrootdPoolRequestHandler when a file is opened for reading or writing. The first such connection is recorded on the mover and announced with the start marker. Mover gains getRemoteEndpoint() (as in dCache#8306) and isPassive(). DefaultPostTransferService uses the recorded remote endpoint for the end marker, so both markers of a transfer carry the same flow-id. For a passive mover that no client connected to, no end marker is sent, as there was no flow and no start marker. Not covered: when a pool is the destination of an xrootd third-party copy, the file arrives over a connection that the pool's third-party client (TpcWriteDescriptor) opens to the source. The requesting client's connection carries no file data and is not reported, so no marker is sent for such transfers until the third-party client reports its own connection. Result: Fireflies for xrootd and http(s) client transfers name the connection that carries the data. The start marker is sent when the client has connected to the pool instead of before. Movers that no client connects to emit no markers. Testing: - New NettyTransferServiceFlowMarkerTest. - PR pipeline unit-test job run locally in maven:3.9.12-eclipse-temurin-21 (mvn -P code-coverage clean verify -DskipTests=false -Drun.slow.tests): 5178 tests, 0 failures. - Backported to 11.2.10 and run on a production pool. TCP connections to the mover ports were captured for 10 minutes and compared with the endpoints the pool logged. Before: client port right in 0 of 55 transfers. After: right in 65 of 65 (64 xrootd, 1 https). Start and end markers carried the same flow-id in 67 of 67 transfers. Fixes: dCache#8307 Acked-by: Target: master Require-book: no Require-notes: yes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn McKee <smckee@umich.edu>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8307.
Problem
A firefly ties a network flow to an experiment and an activity. Its
flow-idmust therefore name the TCP connection that carries the data.For xrootd and http(s) transfers that a door redirects to a pool, it does not.
NettyTransferService.executeMover()sends thestartmarker when the mover is created, before the client has connected to the pool, and takes the remote endpoint from the protocol info. That is the client's connection to the door. The client then connects to the pool from a different port:The marker carries one port from each connection and matches no flow. The
endmarker repeats the same endpoint. Details and measurements are in #8307.Fix
NettyTransferService: thestartmarker is no longer sent fromexecuteMover().NettyMoverChannelgainsconnected(remote, local). The first connection reported is recorded on the mover and announced with thestartmarker.HttpPoolRequestHandlercalls it forGETandPUT, andXrootdPoolRequestHandlerwhen a file is opened for reading or writing, with the addresses of the Netty channel.Mover#getRemoteEndpointis added, andDefaultPostTransferServiceuses it for theendmarker, so both markers of a transfer carry the same flow-id. This hunk is identical to the one in pool: report the data connection in firefly markers of HTTP-TPC transfers #8306, so the two changes merge in either order.Mover#isPassiveis added and is true forNettyMover. For a passive mover that no client connected to, noendmarker is sent: there was no flow and nostartmarker.Behaviour changes to be aware of
startmarker is sent when the client has connected to the pool, not before. The first packets of the connection therefore precede it. The client's port cannot be known earlier.startmarker for a flow that never came into existence.TpcWriteDescriptor) opens to the source. The requesting client's connection carries no file data, so it is not reported. Before this change thestartmarker named the requesting client's connection to the door and theendmarker named the source host from the request, neither of which is the data connection. I intend to follow up by having the third-party client report its own connection through the sameconnected()call.Testing
New
NettyTransferServiceFlowMarkerTest(6 tests): the marker carries the endpoints of the reported connection, is sent once, is not sent before a connection is reported, and non-IP channels are ignored.Ran the PR pipeline's unit-test job locally in
maven:3.9.12-eclipse-temurin-21(mvn -P code-coverage clean verify -DskipTests=false -Drun.slow.tests): 5178 tests, 0 failures, 0 errors.Tested on a production pool. The commit cherry-picks cleanly onto 11.2.10. That build ran on an AGLT2 pool node (two pools). TCP connections arriving at the mover ports were captured for 10 minutes and compared with the endpoints the pools logged for each transfer:
After the change, 64 of the transfers were xrootd and 1 https. Start-side and end-side log lines carried the same flow-id in 67 of 67 transfers. Two external transfers (one xrootd read, one https write) sent fireflies; all four were captured on the wire and named a connection seen in the capture. Most transfers in both runs were on-site, for which the marker is suppressed but its endpoints are logged.
Not exercised on the pool: a mover that no client connects to, xrootd third-party copy, and an xrootd client reconnecting to a mover. The
DefaultPostTransferServicechange for unconnected movers is covered only by compilation.Signed-off-by: Shawn McKee smckee@umich.edu
🤖 Generated with Claude Code