Repository navigation
umbrella: rgw/multisite: Balance sync traffic across DNS-resolved backends using CURLOPT_CONNECT_TO - #69553
Merged
Conversation
This commit is meant to be non-functional. Replace the "URL as plain string" plumbing with an RGWEndpoint value type that carries: - the URL string, and - optional per-request connect_to data for libcurl, - it also encapsulates related functions/methods This commit is intended to be non-functional: behavior should remain unchanged until callers populate connect_to. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 2690e2a)
Introduce an advanced boolean config option (default: false) to enable resolving multisite endpoint hostnames into all A/AAAA records. When enabled, RGW can distribute outgoing inter-zone traffic across DNS-provided backends even without an external load balancer. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit d989ef7)
When rgw_resolve_endpoints_into_all_addresses=true, parse each configured endpoint URL, extract host/port, and resolve the host into all IP addresses. Store resolution results (including a round-robin index) alongside the original endpoint URL for later selection. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit af7abee)
Add logic to select an IP for a given endpoint URL (RR over resolved addresses) and build a host:port:ip:port mapping. Store the mapping in the RGWEndpoint so the HTTP layer can apply it per request. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 510e9ab)
If endpoint.connect_to is non-empty, populate and attach a curl slist to CURLOPT_CONNECT_TO for this request. Ensure the slist is freed with the request lifetime to avoid leaks across retries/requests. Fixes: https://tracker.ceph.com/issues/74677 Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 6aca73a)
Refactor RGWRESTConn to eliminate the separate endpoints_status map by moving the connection status (std::atomic<ceph::real_time>) directly into the ResolvedEndpoint struct. This reduces redundancy and simplifies endpoint state management. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 030e62b)
Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit e468f0f)
… (refactor) Refactor endpoint tracking by adding original_url to RGWEndpoint struct instead of maintaining a separate endpoint_orig member in RGWHTTPClient. This simplifies the code by having each endpoint self-track its original URL, which is needed for connection status lookups after URL modifications. No functional changes intended. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit b8d8c40)
Add ostream operator<< to RGWEndpoint struct for convenient logging of endpoint details (url, original_url when different, and connect_to). Update log statements across rgw_http_client.cc, rgw_rest_client.cc, and rgw_rest_conn.cc to use the new operator for cleaner, more consistent output. Add unittest_rgw_http_client to test RGWEndpoint functionality. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 71af1fc)
…e vector Previously RGWRESTConn stored endpoints in two data structures: - endpoint_urls: vector<string> for ordered round-robin iteration - resolved_endpoints: unordered_map<string, ResolvedEndpoint> for lookup This was redundant since the URL was stored in both places. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 3e310e0)
Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit afab77c)
Previously, when a connection to a zone endpoint failed, the entire endpoint was marked as unavailable for a timeout period. Since we now resolve endpoints to all their IP addresses (via DNS A/AAAA records), we can be more granular: track failures at the individual IP level. Introduce ResolvedIP struct that pairs each IP's connect_to string with its own failure timestamp. When selecting an IP for a request, round-robin skips IPs that have recently failed, allowing traffic to continue flowing to healthy nodes even when some are down. An endpoint-level last_failure_time is maintained as a fast-path optimization to avoid scanning all IPs when none have failed recently. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 2d7bc78)
Introduce a new radosgw option 'rgw_rest_conn_ip_fail_timeout_secs' to be able to set the constant CONN_STATUS_EXPIRE_SECS dynamically. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 2d8061c)
Adds a new admin socket command to dump zone connection details including endpoints, resolved IPs, and health status. Useful for debugging multisite connectivity issues. Usage: ceph daemon <radosgw.asok> zone connections Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 11aa2c8)
Rename endpoint_round_robin_counter to endpoint_rr_index and endpoint_ips_round_robin_counter to ip_rr_index for shorter, cleaner variable names while maintaining clarity. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 9f0c109)
…t_conn_ip_fail_timeout_secs Expose the confval information for the confval "rgw_rest_conn_connect_to_resolved_ips" and "rgw_rest_conn_ip_fail_timeout_secs" so that they can be seen in the "Ceph Object Gateway Config Reference" as these are meant to be client-facing configs. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 9eda207)
Replace raw string manipulation in RGWEndpoint with boost::urls::url. URL path/query/host changes now use set_path(), set_query(), set_host() instead of string concatenation. Rename original_url to endpoint_url_lookup_id to clarify its role as a health-tracking key for ResolvedEndpoint lookup in set_endpoint_unconnectable(). Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 3513cd8)
… paths The checks that decide whether to call set_endpoint_unconnectable() were comparing against -EIO, but the actual error codes returned on connection failure changed after commit 37352a9 ("rgw: change rgw_http_error_to_errno default to -ERR_INTERNAL_ERROR"). - complete_request() -> wait() returns req_data->ret which is set to rgw_http_error_to_errno(0) = -ERR_INTERNAL_ERROR when http_status is 0 (TCP connect failed). Fix the six call sites to check -ERR_INTERNAL_ERROR. - forward_request() returns tl::unexpected(-ERR_SERVICE_UNAVAILABLE) when http_status == 0 (no HTTP response received at all). Fix the two forward/forward_iam conditionals to check -ERR_SERVICE_UNAVAILABLE. Without this fix, connection failures are never detected in the sync paths, so set_endpoint_unconnectable() is never called and the IP failover / retry logic is effectively dead. The .h coroutine paths were already fixed by dbb409e ("rgw: fix endpoint detection in RGWRESTConn") but that commit missed all .cc sync paths. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 28f2a5e)
Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 7d62871)
…olution Documents the new rgw_rest_conn_connect_to_resolved_ips feature that enables RGW to resolve HTTP endpoints for RGW services such as multisite, into all IP addresses and distribute requests across them using round-robin with per-IP health tracking, supporting DNS service discovery deployments without external load balancers. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit fe6af7f)
Config Diff Tool Output+ added: rgw_rest_conn_ip_fail_timeout_secs (rgw.yaml.in)
+ added: rgw_rest_conn_connect_to_resolved_ips (rgw.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
Contributor
|
This PR has been added to wip-yuri7-testing-20260625.174245-umbrella. |
adamemerson
approved these changes
Jun 26, 2026
Contributor
|
jenkins test make check |
Contributor
|
pr testing completed and approved by @ivancich, more details : https://tracker.ceph.com/issues/78048. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/77473
backport of #67141
parent tracker: https://tracker.ceph.com/issues/74677
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh