Skip to content

umbrella: rgw/multisite: Balance sync traffic across DNS-resolved backends using CURLOPT_CONNECT_TO - #69553

Merged
batrick merged 20 commits into
ceph:umbrellafrom
BBoozmen:wip-77473-umbrella
Jul 20, 2026
Merged

batrick merged 20 commits into
ceph:umbrellafrom
BBoozmen:wip-77473-umbrella

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

BBoozmen added 20 commits June 17, 2026 16:22
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)
@BBoozmen
BBoozmen requested a review from a team as a code owner June 17, 2026 16:24
@BBoozmen BBoozmen added this to the umbrella milestone Jun 17, 2026
@BBoozmen
BBoozmen requested a review from a team as a code owner June 17, 2026 16:24
@github-actions

github-actions Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

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.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Jun 17, 2026
@BBoozmen BBoozmen changed the title umbrella: null umbrella: rgw/multisite: Balance sync traffic across DNS-resolved backends using CURLOPT_CONNECT_TO Jun 17, 2026
@yuriw

yuriw commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri7-testing-20260625.174245-umbrella.

@adamemerson

Copy link
Copy Markdown
Contributor

jenkins test make check

@anrao19

anrao19 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich, more details : https://tracker.ceph.com/issues/78048.
@BBoozmen, if no further testing is needed this pr can be merged

@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Jul 20, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-pass Release engineering: passed backport verification audit. labels Jul 20, 2026
@batrick
batrick merged commit 27c3fda into ceph:umbrella Jul 20, 2026
14 of 18 checks passed
@batrick batrick modified the milestones: umbrella, v21.1.1 Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants