Whamcloud - gitweb
LUDOC-297 protocol: Update protocol document
[doc/protocol.git] / ost_connect.txt
1 RPC 8: OST CONNECT - Client connection to an OST
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 [[ost-connect-rpc]]
4
5 When a client initiates a connection to a specific target on an OSS,
6 it does so via an OST_CONNECT RPC ('pb_opc' = 8).
7
8 .OST_CONNECT Request Packet Structure
9 image::ost-connect-request.png["OST_CONNECT Request Packet Structure",height=50]
10
11 //////////////////////////////////////////////////////////////////////
12 The ost-connect-request.png diagram resembles this text art:
13
14        OST_CONNECT:
15       --request--------------------------------------------------
16       | ptlrpc_body | target_uuid | client_uuid | lustre_handle |
17       -----------------------------------------------------------
18       | obd_connect_data |
19       --------------------
20 //////////////////////////////////////////////////////////////////////
21
22 'ptlrpc_body'::
23 RPC descriptor. See <<struct-ptlrpc-body>>. In a connect message the
24 'ptlrpc_body' field 'pb_handle', which is a <<struct-lustre-handle>>,
25 is 0. That 'lustre_handle' is distinct from the one mentioned
26 below.
27
28 'target_uuid'::
29 A string identifying the target. See <<struct-obd-uuid>>. The client
30 learns the UUID strings for the targets via an interaction with the
31 MGS.
32
33 'client_uuid'::
34 A string with the client's own UUID. This is also a
35 <<struct-obd-uuid>>. The target sets the 'exp_client_uuid' field of
36 its 'eport' structure to this value.
37
38 'lustre_handle'::
39 See <<struct-lustre-handle>>. This 'lustre_handle' is distinct from
40 the 'pb_handle' field in the 'ptlrpc_body'.  This 'lustre_handle'
41 provied a unique 'cookie' to identify this client for this connection
42 attempt. After a disconnect, a subsequent connect RPC will have a
43 different value. The target preserves this cookie in the 'exp_handle'
44 field of its 'obd_export' structure for this client. In that way it
45 can distinguish between a resent connection request and an entirely
46 new connection request.
47
48 'obd_connect_data'::
49 See <<struct-obd-connect-data>>.
50
51 .OST_CONNECT Reply Packet Structure
52 image::ost-connect-reply.png["OST_CONNECT Reply Packet Structure",height=50]
53
54 //////////////////////////////////////////////////////////////////////
55 The ost-connect-reply.png diagram resembles this text art:
56
57        OST_CONNECT:
58       --reply---------------------------
59       | ptlrpc_body | obd_connect_data |
60       ----------------------------------
61 //////////////////////////////////////////////////////////////////////
62
63 'ptlrpc_body'::
64 RPC descriptor. See <<struct-ptlrpc-body>>. The 'pb_handle' field has
65 the value, $C_t$, uniquely identifying that target. The value $C_t$ is
66 preserved in the 'imp_remote_handle' field of the client's import
67 structure for this target. See <<struct-obd-import>>.
68
69 'obd_connect_data'::
70 See <<struct-obd-connect-data>>.