Repository navigation
Add business QoS configuration for URMA - #3712
Spicy-cream wants to merge 43 commits into
Conversation
|
Thanks for the review. I’ll move the mock SEND completion fix and its CI wiring to #3708, then rebase this PR after #3708 lands so the diff contains only the QoS changes. The use case is a single process with both latency-sensitive RPCs and bulk traffic. Those channels need different outgoing priorities, while channels with no explicit setting can inherit the process default. I’ll document the device limits and resource cost. The selected device and path expose up to 16 effective priority/SL mappings, and unsupported settings fail initialization with the available mappings in the diagnostic. Jetty usage scales with live URMA connections and the prepared pool. Connections with non-default priorities allocate Jettys on demand. |
(cherry picked from commit 351935a)
There was a problem hiding this comment.
🟡 Changes recommended
A critical concurrency issue remains because the global mutex is held during a potentially blocking JFCE read, which can stall teardown and other mock URMA operations.
1 open issue
What changed in this PR
This PR adds configurable business-level URMA QoS for request and response traffic while extending runtime recovery, transport-path selection, connection lifecycle handling, and mock-based validation.
Changes:
- Adds priority and service-level configuration to channels, servers, sockets, accepted connections, pooled sockets, and short connections.
- Implements capability-based CTP/RTP selection, QoS validation and diagnostics, connection-signature isolation, prepared-Jetty matching, and handshake propagation.
- Adds recovery policies, TCP fallback behavior, mock-provider and lifecycle regressions, fault-injection tooling, documentation, examples, and CI coverage.
| File | Description |
|---|---|
| test/CMakeLists.txt | Registers URMA transport, recovery, QoS, churn, completion, copy, and fault-injection test variants. |
| test/brpc_urma_transport_unittest.cpp | Tests URMA transport paths, handshakes, payload exchange, and recovery behavior. |
| test/brpc_urma_runtime_unittest.cpp | Tests URMA runtime helpers, validation, copied sends, resource handling, recovery, and fallback behavior. |
| test/brpc_urma_remote_recovery_unittest.cpp | Tests client recovery and fallback after injected server SEND failures. |
| test/brpc_urma_recovery_unittest.cpp | Tests recovery policy modes, cooldowns, epochs, eviction, metrics, and concurrency. |
| test/brpc_urma_qos_unittest.cpp | Tests QoS mapping, validation, propagation, diagnostics, and prepared-Jetty behavior. |
| test/brpc_urma_qos_churn_unittest.cpp | Tests QoS preservation through short-connection churn, cooldown, and reconnection. |
| test/brpc_urma_mock_completion_unittest.cpp | Tests mock completion ordering, provider backpressure, and credit acknowledgements. |
| test/brpc_urma_copy_unittest.cpp | Tests copied-send payload and attachment handling. |
| src/brpc/urma/urma_recovery_policy.h | Declares URMA recovery modes, failure reasons, status, and policy interfaces. |
| src/brpc/urma/urma_recovery_policy.cpp | Implements recovery admission, peer cooldowns, metrics, epochs, and failure accounting. |
| src/brpc/urma/urma_qos.h | Defines public URMA priority and service-level QoS options. |
| src/brpc/urma/urma_helper.h | Declares URMA path-selection, QoS-resolution, SGE, and copied-send helpers. |
| src/brpc/urma/urma_helper.cpp | Implements capability discovery, path selection, QoS mapping, diagnostics, buffer handling, and initialization helpers. |
| src/brpc/urma/urma_handshake.cpp | Adds fallback signaling for v2 and v3 handshakes. |
| src/brpc/urma/urma_endpoint.h | Adds endpoint state for recovery, QoS diagnostics, CQ synchronization, and acknowledgement flushing. |
| src/brpc/urma/mock_urma.cpp | Extends the mock provider with QoS capabilities, synchronized operations, realistic resources, completion ordering, and backpressure. |
| src/brpc/urma_transport.cpp | Validates and resolves channel and server QoS while creating per-socket URMA connections. |
| src/brpc/socket.h | Adds QoS configuration and state to socket interfaces. |
| src/brpc/socket.cpp | Validates and propagates QoS to pooled, child, and short sockets. |
| src/brpc/server.h | Adds response-side URMA QoS configuration to ServerOptions. |
| src/brpc/server.cpp | Validates server QoS and transfers it to accepted connections. |
| src/brpc/channel.h | Adds request-side URMA QoS configuration to ChannelOptions. |
| src/brpc/channel.cpp | Includes QoS in channel signatures and propagates it to socket and naming-service options. |
| src/brpc/acceptor.h | Stores server URMA QoS settings in the acceptor. |
| src/brpc/acceptor.cpp | Applies acceptor QoS to newly accepted sockets. |
| example/urma_performance/test_send_failure_injector.c | Adds self-test coverage for the SEND failure injector. |
| example/urma_performance/test_run_recovery_injection.py | Tests recovery-runner parsing, phase validation, and readiness handling. |
| example/urma_performance/server.cpp | Adds server-side URMA priority and service-level command-line options. |
| example/urma_performance/send_failure_injector.c | Provides an LD_PRELOAD SEND failure injector. |
| example/urma_performance/run_recovery_injection.py | Runs and validates end-to-end URMA recovery injection scenarios. |
| example/urma_performance/recovery_client.cpp | Adds a configurable URMA recovery and attachment-validation client. |
| example/urma_performance/CMakeLists.txt | Builds the recovery client and optional fault-injection tools and tests. |
| example/urma_performance/client.cpp | Adds client-side URMA priority and service-level command-line options. |
| docs/en/urma.md | Documents URMA path selection, recovery, QoS configuration, diagnostics, and validation. |
| docs/cn/urma.md | Adds corresponding Chinese URMA documentation. |
| .github/workflows/ci-urma.yml | Adds Linux URMA mock-provider build and regression-test CI coverage. |
Review effort: Lite
| std::shared_lock<std::shared_mutex> lock(g_rw_mutex); | ||
| if (!jfce || !jfcs || jfc_cnt == 0 || jfce_map.count(jfce) == 0) { | ||
| errno = EINVAL; | ||
| return -1; | ||
| } |

What problem does this PR solve?
A process can serve latency-sensitive RPCs alongside bulk traffic. Channel and server options let each workload set its outgoing priority, with the process default available for other traffic.
This PR depends on PR3708. The source branch includes its recovery changes; merge PR3708 first.
What is changed and the side effects?
The selected path exposes up to 16 priority/SL mappings per device. Live URMA connections each use a Jetty at each end. Connections with the default priority and compatible queues can use a prepared Jetty. Other connections allocate Jettys on demand. The channel signature includes the configured priority and SL, so equivalent settings can use separate connections. Existing v2/v3 wire formats remain compatible.
Validation
Design discussion: URMA runtime recovery and business QoS configuration.
Check List