You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

There are two types of events to account for:

  1. Events on the RDMA device itself
  2. Events on the cm_id

Both events should be monitored because they provide information on the health of the device and connection respectively.

ib_register_event_handler() can be used to register a handler to handle events of type 1.

a cm_callback can be register with the cm_id to handle RMDA_CM events.

There is a group of events which indicate a fatal error

RDMA Device Events

Below are the events that could occur on the RDMA device. Highlighted in BOLD RED are the events that should be handled for health purposes.

  • IB_EVENT_CQ_ERR
  • IB_EVENT_QP_FATAL
  • IB_EVENT_QP_REQ_ERR
  • IB_EVENT_QP_ACCESS_ERR
  • IB_EVENT_COMM_EST
  • IB_EVENT_SQ_DRAINED
  • IB_EVENT_PATH_MIG
  • IB_EVENT_PATH_MIG_ERR
  • IB_EVENT_DEVICE_FATAL
  • IB_EVENT_PORT_ACTIVE
  • IB_EVENT_PORT_ERR
  • IB_EVENT_LID_CHANGE
  • IB_EVENT_PKEY_CHANGE
  • IB_EVENT_SM_CHANGE
  • IB_EVENT_SRQ_ERR
  • IB_EVENT_SRQ_LIMIT_REACHED
  • IB_EVENT_QP_LAST_WQE_REACHED
  • IB_EVENT_CLIENT_REREGISTER
  • IB_EVENT_GID_CHANGE

Communication Events

Below are the events that could occur on a connection. Highlighted in BOLD RED are the events that should be handled for health purposes.

  • RDMA_CM_EVENT_ADDR_RESOLVED: Address resolution (rdma_resolve_addr) completed successfully.

  • RDMA_CM_EVENT_ADDR_ERROR: Address resolution (rdma_resolve_addr) failed.

  • RDMA_CM_EVENT_ROUTE_RESOLVED: Route resolution (rdma_resolve_route) completed successfully.

  • RDMA_CM_EVENT_ROUTE_ERROR: Route resolution (rdma_resolve_route) failed.

  • RDMA_CM_EVENT_CONNECT_REQUEST: Generated on the passive side to notify the user of a new connection request.

  • RDMA_CM_EVENT_CONNECT_RESPONSE: Generated on the active side to notify the user of a successful response to a connection request. It is only generated on rdma_cm_id's that do not have a QP associated with them.

  • RDMA_CM_EVENT_CONNECT_ERROR: Indicates that an error has occurred trying to establish or a connection. May be generated on the active or passive side of a connection.

  • RDMA_CM_EVENT_UNREACHABLE: Generated on the active side to notify the user that the remote server is not reachable or unable to respond to a connection request. If this event is generated in response to a UD QP resolution request over InfiniBand, the event status field will contain an errno, if negative, or the status result carried in the IB CM SIDR REP message.

  • RDMA_CM_EVENT_REJECTED: Indicates that a connection request or response was rejected by the remote end point. The event status field will contain the transport specific reject reason if available. Under InfiniBand, this is the reject reason carried in the IB CM REJ message.

  • RDMA_CM_EVENT_ESTABLISHED: Indicates that a connection has been established with the remote end point.

  • RDMA_CM_EVENT_DISCONNECTED: The connection has been disconnected.

  • RDMA_CM_EVENT_DEVICE_REMOVAL: The local RDMA device associated with the rdma_cm_id has been removed. Upon receiving this event, the user must destroy the related rdma_cm_id.

  • RDMA_CM_EVENT_MULTICAST_JOIN: The multicast join operation (rdma_join_multicast) completed successfully.

  • RDMA_CM_EVENT_MULTICAST_ERROR: An error either occurred joining a multicast group, or, if the group had already been joined, on an existing group. The specified multicast group is no longer accessible and should be rejoined, if desired.

  • RDMA_CM_EVENT_ADDR_CHANGE: The network device associated with this ID through address resolution changed its HW address, eg following of bonding failover. This event can serve as a hint for applications who want the links used for their RDMA sessions to align with the network stack.

  • RDMA_CM_EVENT_TIMEWAIT_EXIT: The QP associated with a connection has exited its timewait state and is now ready to be re-used. After a QP has been disconnected, it is maintained in a timewait state to allow any in flight packets to exit the network. After the timewait state has completed, the rdma_cm will report this event.

Health Handling

Handling Asynchronous Events

  • A callback mechanism should be provided by LNet to the LND to report failure events
  • Some translation matrix from LND specific errors to LNet specific errors should be created
    • Each LND would create the mapping
  • Whenever an event occurs the indicates a fatal error on the device the LNet callback should be called.
  • LNet should transition the local NI or remote NI appropriately and take measures to close the connections on that specific device.

Handling Errors on Sends

  • If a request to send a message ends in an error: Example a connection error (as seen with the wrong device responding to ARP), then LNet should pick another local device to send from.
    • There are a class of errors which indicate a problem in Local NI
      • RDMA_CM_EVENT_DEVICE_REMOVAL - This device is no longer present. Should never be used.
    • There are a class of errors which indicate a problem in remote NI
      • RDMA_CM_EVENT_ADDR_ERROR - The remote address is errnoeous. Should not be used.
      • RDMA_CM_EVENT_ADDR_RESOLVED with an error. The remote address can not be resolved
      • RDMA_CM_EVENT_ROUTE_ERROR - No  route to remote address. Should result in the peer_ni not to be used. But a retry can be done a bit later via time.
      • RDMA_CM_EVENT_UNREACHABLE - Remote side is unreachable. Retry after a while.
      • RDMA_CM_EVENT_CONNECT_ERROR - problem with connection. Retry after a while.
      • RDMA_CM_EVENT_REJECTED - Remote side is rejecting connection. Retry after a while.
      • RDMA_CM_EVENT_DISCONNECTED - Move outstanding operations to a different pair if available.

Handling Timeout

This is probably the trickiest situation. Timeout could occur because of network congestion, or because the remote side is too busy, or because it's dead, or hung, etc.

Timeouts are being kept in the LND (o2iblnd) on the transmits. Every transmit which is queued is assigned a deadline. If it expires then the connection on which this transmit is queued, is closed.

peer_timout can be set in routed and non-routed scenario, which provides information on the peer.

Timeouts are also being kept at ptlrpc. These are rpc timeouts.

Refer to section 32.5 in the manual for a description of how RPC timeouts work.

Also refer to section 27.3.7 for LNet Peer Health information.

Given the presence of various timeouts, adding yet another timeout on the message, will further complicate the configuration, and possibly cause further hard to debug issues.

One option to consider is to use the peer_timout feature to recognize when peer_nis are down, and update the peer_ni health information via this mechanism. And let the LND and RPC timeouts take care of further resends.

High Level Design

Callback Mechanism

  • Add an LNet API: 
    • lnet_report_lnd_error(lnet_error_type type, int errno, struct lnet_ni *ni, struct lnet_peer_ni *lpni) 
      • LND will map its internal errors to lnet_error_type enum.
enum lnet_error_type {
	LNET_LOCAL_NI_DOWN, /* don't use this NI until you get an UP */
	LNET_LOCAL_NI_UP, /* start using this NI */
	LNET_LOCAL_NI_SEND_TIMOUT, /* demerit this NI so it's not selected immediately, provided there are other healthy interfaces */
	LNET_PEER_NI_ADDR_ERROR, /* The address for the peer_ni is wrong. Don't use this peer_NI */
	LNET_PEER_NI_UNREACHABLE, /* temporarily don't use the peer NI */
	LNET_PEER_NI_CONNECT_ERROR, /* temporarily don't use the peer NI */
	LNET_PEER_NI_CONNECTION_REJECTED /* temporarily don't use the peer NI */
};
  • Although some of the actions LNet will take is the same for different errors, it's still a good idea to keep them separate for statistics and logging.
  • on LNET_LOCAL_NI_DOWN set the ni_state to STATE_FAILED. In the selection algorithm this NI will not be picked.
  • on LNET_LOCAL_NI_UP set the ni_state to STATE_ACTIVE. In the selection algorithm this NI will be selected.
  • Add a state in the peer_ni. This will indicate if it usable or not. 
  • on LNET_PEER_NI_ADDR_ERROR set the peer_ni state to FAILED. This peer_ni will not be selected in the selection algorithm.
  • Add a health value (int). 0 means it's healthy and available for selection.
  • on any LNet_PEER_NI_[UNREACHABLE | CONNECT_ERROR | CONNECT_REJECTED] decrement this value.
  • That value indicates how long before we use it again.
  • A time before use in jiffies is stored. The next time we examine this peer_NI for selection, we take a look at that time. If it has been passed we select it, but we do not increment this value. The value is set to 0 only if there is a successful send to this peer_ni.
  • The net effect is that if we have a bad peer_ni, the health value will keep getting decremented, which will mean it'll take progressively longer to reuse it.
  • This algorithm is in effect only if there are multiple interfaces, and some of them are healthy. If none of them are healthy (IE the health value is negative), then select the least unhealthy peer_ni (the one with greatest health value).
  • The same algorithm can be used for local NI selection

Timeout Handling

TBD

  • No labels