zchuango opened a new pull request, #3535: URL: https://github.com/apache/brpc/pull/3535
### What problem does this PR solve? Issue Number: N/A Related Discussion: https://github.com/apache/brpc/discussions/3432 Problem Summary: RDMA, UBSHM, and URMA use similar connection setup flows: establish a TCP control connection, exchange handshake messages, prepare transport-specific resources, negotiate whether the high-speed transport can be used, and fall back to TCP when necessary. These handshake flows were previously implemented separately in individual transports, resulting in duplicated framing, TCP handshake I/O, state transitions, fallback handling, and connection orchestration. As discussed in the related Discussion, the handshake orchestration should be moved above individual high-speed transports, while transport-specific resource management and data-plane operations remain inside each transport. This PR introduces the common transport-level handshake framework and migrates both RDMA and UBSHM to it. URMA can be migrated to the same framework in a follow-up change. ### What is changed and the side effects? Changed: - Add `AdapterTransport` as the top-level transport for TCP, RDMA, and UBSHM sockets. - Add common handshake session, framing, I/O, and adapter abstractions. - Centralize handshake orchestration, state transitions, upgrade selection, and TCP fallback in the common transport layer. - Move RDMA handshake orchestration out of `RdmaEndpoint`. - Move UBSHM handshake orchestration out of `UBShmEndpoint`. - Keep transport-specific resource allocation, negotiation, activation, and data-plane operations inside their respective transports and endpoints. - Preserve the existing RDMA protocol ID and registered `rdma_handshake` protocol name. - Preserve the existing RDMA v2/v3 wire formats. - Preserve the existing UBSHM handshake wire format. - Preserve TCP fallback when the requested high-speed transport is unavailable or negotiation fails. - Add common handshake tests and transport-specific compatibility/fallback coverage for RDMA and UBSHM. Side effects: - Performance effects: - No intended data-plane performance change. - The common handshake framework only affects connection setup and transport negotiation. - Breaking backward compatibility: - No intended breaking change. - Existing RDMA v2/v3 wire formats are preserved. - Existing UBSHM wire format is preserved. - Existing TCP fallback behavior is preserved. --- ### Check List: - Please make sure your changes are compilable. - When providing us with a new feature, it is best to add related tests. - Please follow [[Contributor Covenant Code of Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md)](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
