Skip to content

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

Merged
BBoozmen merged 20 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-74677
Jun 17, 2026
Merged

BBoozmen merged 20 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-74677

Conversation

@BBoozmen

@BBoozmen BBoozmen commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes https://tracker.ceph.com/issues/74677.

Added /config check ok comment as the config items are added to the related release doc.

Testing

  • Initial test results - which shows how the changes lead to better load distribution of ingress replication traffic when DNS endpoint is used - can be found at #74677::note-2.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions

github-actions Bot commented Jan 30, 2026 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_rest_conn_connect_to_resolved_ips (rgw.yaml.in)
+ added: rgw_rest_conn_ip_fail_timeout_secs (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

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@BBoozmen
BBoozmen force-pushed the wip-oozmen-74677 branch 4 times, most recently from 387c55f to be20d73 Compare March 4, 2026 17:21
@BBoozmen
BBoozmen marked this pull request as ready for review March 11, 2026 13:29
@BBoozmen
BBoozmen requested a review from a team as a code owner March 11, 2026 13:29
@BBoozmen BBoozmen changed the title [WIP] rgw/multisite: Balance sync traffic across DNS-resolved backends using CURLOPT_CONNECT_TO rgw/multisite: Balance sync traffic across DNS-resolved backends using CURLOPT_CONNECT_TO Mar 11, 2026
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@BBoozmen
BBoozmen requested a review from a team as a code owner March 24, 2026 17:16
@BBoozmen

Copy link
Copy Markdown
Contributor Author

Although there's some on-going issues in teuthology due to centos->rocky migration, I submitted the changes to tuethology to see how the changes pan out:

Due to on-going teuthology issues, I'll need to run these again but at least these runs show no immediate issues with this change:

Run Total Passed Failed URL
BASELINE 71 49 22 pulpito
ENABLE_RESOLVING 71 43 28 pulpito

At the fist sight, one may think enabling_resolving might be causing some issues but they are all accoutanable and due to centos->rocky migration:

Suite BASELINE Failures ENABLE_RESOLVING Failures Delta Status
rgw/multisite 2 2 0 ✓ Consistent (usual suspects)
rgw/notifications 5 5 0 ✓ Consistent (known depedency issues)
rgw/upgrade 4 4 0 ✓ Consistent (known dependency issues)
rgw/d4n 1 0 -1 Passed with Resolver [*]
rgw/verify 10 17 +7 ❌ ?REGRESSED?

[*] The other run (BASELINE) also passed I believe, it just failed at cleanup and I had seen this issue before:

2026-03-25T05:51:05.301 DEBUG:teuthology.run_tasks:Exception was not quenched, exiting: CommandFailedError: Command failed on trial177 with status 1: 'find /home/ubuntu/cephtest -ls ; rmdir -- /home/ubuntu/cephtest'

rgw/verify

This difference was sort of alarming but comparing both runs show that it's due to known Rocky 10 issue with ragweed [*].

Run Total Ubuntu PASS Ubuntu FAIL Rocky PASS Rocky FAIL
BASELINE 24 14 0 0 10
ENABLE_RESOLVING 24 7 0 0 17
Change - -7 0 0 +7

[*]:

collected 0 items / 1 error
ModuleNotFoundError: No module named 'boto.vendored.six.moves' 

Comment thread src/rgw/rgw_resolve.cc Resolved
Comment thread src/rgw/rgw_http_client.h Resolved
@BBoozmen BBoozmen added wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh and removed wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Apr 15, 2026
BBoozmen added 7 commits June 2, 2026 22:16
…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]>
Signed-off-by: Oguzhan Ozmen <[email protected]>
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]>
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]>
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]>
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]>
…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]>
@BBoozmen
BBoozmen force-pushed the wip-oozmen-74677 branch from 507ecf3 to da3813e Compare June 3, 2026 13:32
@BBoozmen BBoozmen added wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh and removed TESTED labels Jun 3, 2026
@BBoozmen

BBoozmen commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley I believe pending review comments have been addressed. Please have a look.

If it looks good; let me start another round of teuthology testing; I think this will be the 10th time for this PR incl reruns :)

Merge branch 'main' into wip-oozmen-74677
this pr includes a merge commit, please rebase the commits on main instead

I had to a couple rebases as this one is getting older and the last time I said what-the-heck let me use the github's "resolve conflicts" button/UI down there. Somehow, it added this commit then. I think I need to stick with the good-old manual-rebase and vim to resolve-conflicts; doing it via a UI seems to be confusing.

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look great, thank you

Comment thread src/rgw/rgw_rest_conn.cc Resolved
@cbodley

cbodley commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

@smanjara any specific testing you'd like to see here? we do have the qa/tasks/dnsmasq.py task if we want to set up a special dns configuration for this in the rgw/multisite suite, though it might not be easy to verify that sync uses all of the configured endpoints

BBoozmen added 3 commits June 4, 2026 19:32
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]>
… 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]>
@BBoozmen
BBoozmen force-pushed the wip-oozmen-74677 branch from 12fa9cd to 69616b2 Compare June 4, 2026 19:55
@BBoozmen

Copy link
Copy Markdown
Contributor Author

Below are the new teuthology run results after addressing the new comments from last week:

Test branches

QA test results

Conclusion

Both branches seem clean. All 10 failures in the option-disabled and all 9 in the option-enabled run are pre-existing infrastructure issues or known flaky tests:

  • ragweed/multifs: boto.vendored.six.moves missing — broken tox-venv on ubuntu 24.04
  • crypt/kmip: pykmip setup crash — infrastructure issue, same in both branches
  • multisite: flaky tests
  • tempest: PyYAML wheel build failure in tox venv — infrastructure
  • s3control: Virtual-host DNS s3..front.sepia.ceph.com not resolvable in Sepia — the enabled run's 1 counted "FAILED" test has the exact same socket.getaddrinfo root cause as the 581 other connection errors
  • d4n: Different distros each— rocky had yum install fail, ubuntu had radosgw-admin teardown crash after tests completed (cores found)

More details

wip-oozmen-dns-resolver-testing-2026-06-03-1802

Suite Job OS Actual Failure Classification
rgw/multifs 278279 ubuntu 24.04 ModuleNotFoundError: No module named 'boto.vendored.six.moves' (ragweed pytest collection) Infra — broken boto in tox-venv
rgw/multifs 278275 ubuntu 24.04 Same as above Infra — broken boto in tox-venv
rgw/multifs 278270 ubuntu 24.04 Same as above Infra — broken boto in tox-venv
rgw/crypt 278278 ubuntu 24.04 CommandFailedError: .pykmipenv/bin/python3 (pykmip create_secrets failed) Infra — pykmip setup failure
rgw/crypt 278273 ubuntu 24.04 Same as above Infra — pykmip setup failure
rgw/multisite 278277 ubuntu 24.04 test_bucket_sync_disable FAIL and test_bucket_log_trim_after_delete_bucket_secondary_reshard FAIL Bug#72948 Multisite: Intermittent failures in sync disable/enable and Bug# 70858 - FAIL: rgw_multi.tests.test_bucket_log_trim_after_delete_bucket_secondary_reshard
rgw/tempest 278276 ubuntu 24.04 Failed to build 'PyYAML' in tox venv setup Infra — PyYAML build failure
rgw/s3control 278272 ubuntu 22.04 181× botocore EndpointConnectionError: http://s3.trial018.front.sepia.ceph.com:80/ (s3select + sns); 949 passed Infra — virtual-host DNS not in Sepia
rgw/d4n 278269 rocky 10.1 sudo yum install ceph-radosgw ... redis failed (status 1) Infra — package install failure

wip-oozmen-dns-resolver-enabled-testing-2026-06-03-1802

Suite Job OS Actual Failure Classification
rgw/multifs 262083 ubuntu 24.04 ModuleNotFoundError: No module named 'boto.vendored.six.moves' (ragweed pytest collection) Infra — broken boto in tox-venv
rgw/multifs 262057 ubuntu 24.04 Same as above Infra — broken boto in tox-venv
rgw/multifs 262027 ubuntu 24.04 Same as above Infra — broken boto in tox-venv
rgw/crypt 262076 ubuntu 24.04 CommandFailedError: .pykmipenv/bin/python3 (pykmip create_secrets failed) Infra — pykmip setup failure
rgw/crypt 262041 ubuntu 24.04 Same as above Infra — pykmip setup failure
rgw/multisite 262069 rocky 10.1 test_bucket_sync_disable FAIL, test_copy_object_same_bucket FAIL (AssertionError: 3 != 16) Known flaky Bug#72948 Multisite: Intermittent failures in sync disable/enable and Bug#75715 - qa/rgw/multisite: test_copy_object_same_bucket flaky - object size mismatch after sync
rgw/tempest 262059 ubuntu 24.04 Failed to build 'PyYAML' in tox venv setup Infra — PyYAML build failure
rgw/s3control 262070 ubuntu 22.04 test_versioning_bucket_multipart_upload_return_version_id: socket.getaddrinfo('s3.trial188.front.sepia.ceph.com', 443) failed + 581× same DNS errors; 548 passed Infra — virtual-host DNS not in Sepia (proto/https variant)
rgw/d4n 262022 ubuntu 22.04 Coredump in radosgw-admin user list during teardown; workunit completed before crash Infra — teardown crash

@smanjara any specific testing you'd like to see here?

@cbodley / @smanjara / @mkogan1 - can you please review the test results and let me know do we need any further testing on this one?

@smanjara

Copy link
Copy Markdown
Contributor

@cbodley / @smanjara / @mkogan1 - can you please review the test results and let me know do we need any further testing on this one?

I saw your baseline comparison in the tracker. it looks promising. thank you!

@jmundack

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't need to block merge, but lets put some more thought into how we can add some regression test coverage here. since this isn't on by default, multisite tests won't tell us if we break something here in the future

Comment thread PendingReleaseNotes Resolved

@anthonyeleven anthonyeleven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion.

@BBoozmen BBoozmen added TESTED and removed wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Jun 16, 2026
…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]>
@BBoozmen
BBoozmen merged commit 7d3cb2c into ceph:main Jun 17, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/27694015081

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