Skip to content

Commit a65b2ea

Browse files
committed
UCP: Route failover replay through protocol selection
Use owned UCT operation descriptors and internal replay requests so failover resend can reuse UCP protocol selection while remaining scoped to failover recovery.
1 parent 9ec88ff commit a65b2ea

12 files changed

Lines changed: 397 additions & 268 deletions

src/ucp/core/ucp_ep_failover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static ucs_status_t ucp_ep_failover_replay_lane(ucp_ep_failover_lane_ctx_t *lane
534534
return UCS_OK;
535535
} else if (status != UCS_OK) {
536536
ucs_debug("ep %p: lane %u failed to replay extracted op %d: %s",
537-
lane->ep, lane->lane, (int)op->operation,
537+
lane->ep, lane->lane, (int)op->info.operation,
538538
ucs_status_string(status));
539539
lane->discard_status = status;
540540
ucp_ep_failover_replay_purge(lane);

src/ucp/core/ucp_request.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <ucp/wireup/wireup.h>
2525
#include <ucp/core/ucp_am.h>
2626
#include <ucp/core/ucp_worker.h>
27+
#include <uct/api/v2/uct_v2.h>
2728

2829

2930
#define ucp_trace_req(_sreq, _message, ...) \
@@ -403,6 +404,11 @@ struct ucp_request {
403404
ucs_ptr_map_key_t remote_req_id;
404405
} get_reply;
405406

407+
struct {
408+
const uct_ep_op_info_t *op_info;
409+
ucp_lane_index_t failed_lane;
410+
} failover;
411+
406412
struct {
407413
/* Remote request ID received from a peer */
408414
ucs_ptr_map_key_t remote_req_id;

src/ucp/core/ucp_types.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,14 @@ typedef enum {
157157
UCP_OP_ID_RNDV_RECV_DROP,
158158
UCP_OP_ID_RNDV_LAST,
159159

160-
UCP_OP_ID_LAST = UCP_OP_ID_RNDV_LAST
160+
/* Internal failover replay operations */
161+
UCP_OP_ID_FAILOVER_FIRST = UCP_OP_ID_RNDV_LAST,
162+
UCP_OP_ID_FAILOVER_AM_BCOPY = UCP_OP_ID_FAILOVER_FIRST,
163+
UCP_OP_ID_FAILOVER_PUT_SHORT,
164+
UCP_OP_ID_FAILOVER_PUT_BCOPY,
165+
UCP_OP_ID_FAILOVER_LAST,
166+
167+
UCP_OP_ID_LAST = UCP_OP_ID_FAILOVER_LAST
161168
} ucp_operation_id_t;
162169

163170

src/ucp/proto/proto.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
_macro(ucp_am_rndv_proto) \
7272
_macro(ucp_stream_multi_bcopy_proto) \
7373
_macro(ucp_stream_multi_zcopy_proto) \
74+
_macro(ucp_failover_replay_proto) \
7475
UCP_PROTO_AMO_FOR_EACH(_macro, post) \
7576
UCP_PROTO_AMO_FOR_EACH(_macro, fetch) \
7677
UCP_PROTO_AMO_FOR_EACH(_macro, cswap)
@@ -87,20 +88,23 @@ const ucp_proto_t *ucp_protocols[] = {
8788
};
8889

8990
const char *ucp_operation_names[] = {
90-
[UCP_OP_ID_TAG_SEND] = "tag_send",
91-
[UCP_OP_ID_TAG_SEND_SYNC] = "tag_send_sync",
92-
[UCP_OP_ID_AM_SEND] = "am_send",
93-
[UCP_OP_ID_AM_SEND_REPLY] = "am_send_reply",
94-
[UCP_OP_ID_STREAM_SEND] = "stream",
95-
[UCP_OP_ID_PUT] = "put",
96-
[UCP_OP_ID_GET] = "get",
97-
[UCP_OP_ID_AMO_POST] = "amo_post",
98-
[UCP_OP_ID_AMO_FETCH] = "amo_fetch",
99-
[UCP_OP_ID_AMO_CSWAP] = "amo_cswap",
100-
[UCP_OP_ID_RNDV_SEND] = "rndv_send",
101-
[UCP_OP_ID_RNDV_RECV] = "rndv_recv",
102-
[UCP_OP_ID_RNDV_RECV_DROP] = "rndv_recv_drop",
103-
[UCP_OP_ID_LAST] = NULL
91+
[UCP_OP_ID_TAG_SEND] = "tag_send",
92+
[UCP_OP_ID_TAG_SEND_SYNC] = "tag_send_sync",
93+
[UCP_OP_ID_AM_SEND] = "am_send",
94+
[UCP_OP_ID_AM_SEND_REPLY] = "am_send_reply",
95+
[UCP_OP_ID_STREAM_SEND] = "stream",
96+
[UCP_OP_ID_PUT] = "put",
97+
[UCP_OP_ID_GET] = "get",
98+
[UCP_OP_ID_AMO_POST] = "amo_post",
99+
[UCP_OP_ID_AMO_FETCH] = "amo_fetch",
100+
[UCP_OP_ID_AMO_CSWAP] = "amo_cswap",
101+
[UCP_OP_ID_RNDV_SEND] = "rndv_send",
102+
[UCP_OP_ID_RNDV_RECV] = "rndv_recv",
103+
[UCP_OP_ID_RNDV_RECV_DROP] = "rndv_recv_drop",
104+
[UCP_OP_ID_FAILOVER_AM_BCOPY] = "failover_am_bcopy",
105+
[UCP_OP_ID_FAILOVER_PUT_SHORT] = "failover_put_short",
106+
[UCP_OP_ID_FAILOVER_PUT_BCOPY] = "failover_put_bcopy",
107+
[UCP_OP_ID_LAST] = NULL
104108
};
105109

106110
const char *ucp_operation_descs[] = {
@@ -118,7 +122,10 @@ const char *ucp_operation_descs[] = {
118122
[UCP_OP_ID_RNDV_SEND] = "rendezvous data send",
119123
[UCP_OP_ID_RNDV_RECV] = "rendezvous data fetch",
120124
[UCP_OP_ID_RNDV_RECV_DROP] = "rendezvous data drop",
121-
[UCP_OP_ID_LAST] = NULL
125+
[UCP_OP_ID_FAILOVER_AM_BCOPY] = "failover replay active message",
126+
[UCP_OP_ID_FAILOVER_PUT_SHORT] = "failover replay short put",
127+
[UCP_OP_ID_FAILOVER_PUT_BCOPY] = "failover replay buffered put",
128+
[UCP_OP_ID_LAST] = NULL
122129
};
123130

124131
unsigned ucp_protocols_count(void)

src/ucp/proto/proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
/* Maximal number of protocols in total */
26-
#define UCP_PROTO_MAX_COUNT 65
26+
#define UCP_PROTO_MAX_COUNT 66
2727

2828

2929
/* Special value for non-existent protocol */

0 commit comments

Comments
 (0)