Skip to content

rgw/beast: realm reload closes connections so requests drain quickly - #57640

Merged
ivancich merged 2 commits into
ceph:mainfrom
cbodley:wip-rgw-beast-realm-reload
Jul 16, 2024
Merged

ivancich merged 2 commits into
ceph:mainfrom
cbodley:wip-rgw-beast-realm-reload

Conversation

@cbodley

@cbodley cbodley commented May 22, 2024

Copy link
Copy Markdown
Contributor

outstanding requests may take arbitrarily long to complete. instead of waiting for everything to complete successfully before pause() returns, close all client connections so their requests fail quickly

this matches the behavior of stop() for radosgw shutdown/restart. this should help to minimize the downtime of realm reloads where the frontend isn't accepting connections or processing new requests

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

outstanding requests may take arbitrarily long to complete. instead of
waiting for everything to complete successfully before pause() returns,
close all client connections so their requests fail quickly

this matches the behavior of stop() for radosgw shutdown/restart. this
should help to minimize the downtime of realm reloads where the frontend
isn't accepting connections or processing new requests

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley requested a review from a team as a code owner May 22, 2024 19:24
@github-actions github-actions Bot added the rgw label May 22, 2024
@cbodley

cbodley commented May 22, 2024

Copy link
Copy Markdown
Contributor Author

this was motivated by recent discussions with @mmgaggle about shutdown/upgrade behavior, as well as @BBoozmen's discussion regarding realm reloads in https://tracker.ceph.com/issues/66100

@BBoozmen

BBoozmen commented May 23, 2024 •

Copy link
Copy Markdown
Contributor

I performed a quick test of the changes. It looks like a regression might be introduced which can be exposed by the multisite site integration test: i.e., src/test/rgw/test-rgw-multisite.sh (e.g., using 2 clusters). Secondary cluster fails to start after it sends the new period to the master: e.g.,

After c1 is created by this script:

...
vstart cluster complete. Use stop.sh to stop. See out/* (e.g. 'tail -f out/????') for debug output.
...
2024-05-23T17:16:38.529-0400 7f85539cc700  1 Set the period's master zonegroup zg1 as the default
...
2024-05-23T17:16:39.026-0400 7fdbeaaff700  0 period (8ee4ef10-80df-49e7-9de2-e187261d9a6e does not have zone 4bd190d9-25c9-4033-a705-6c2ef991392c configured
Sending period to new master zone e0da6296-727b-49a3-82a7-e1d71d3afbef
request failed: (2200) Unknown error 2200
failed to commit period: (2200) Unknown error 2200

I think c1 prematurely closes the connection to c2 before sending a request? Relevant events:

2024-05-23T17:50:53.738-0400 7f9856153700  4 rgw period pusher: Zone master pushing period d11deef0-e06a-4050-b3e6-556520f0b5ff epoch 2 to 1 other zones
2024-05-23T17:50:53.738-0400 7f985214b700 20 reqs_thread_entry: start
2024-05-23T17:50:53.738-0400 7f9856153700  4 rgw realm reloader: Notification on realm, reconfiguration scheduled
2024-05-23T17:50:53.738-0400 7f9856954700  1 rgw realm reloader: Pausing frontends for realm update...
2024-05-23T17:50:53.738-0400 7f9856954700  4 frontend pausing, closing connections...
2024-05-23T17:50:53.738-0400 7f985194a700 20 rgw period pusher CR thread: cr:s=0x55f9ad9fd540:op=0x55f9ad9a5600:9PushAllCR: operate()
2024-05-23T17:50:53.738-0400 7f985194a700  4 rgw period pusher CR thread: sending 1 periods
2024-05-23T17:50:53.738-0400 7f9856954700  0 - right before closeSuccess <<< <<<< WE CLOSE HERE!!!!
2024-05-23T17:50:53.738-0400 7f985194a700 20 rgw period pusher CR thread: cr:s=0x55f9ad9fd680:op=0x55f9ada30700:14PushAndRetryCR: operate()
2024-05-23T17:50:53.738-0400 7f985194a700 10 rgw period pusher CR thread: pushing period d11deef0-e06a-4050-b3e6-556520f0b5ff to 7bc18c9e-9543-4f53-8995-c76fc9aafb1d
2024-05-23T17:50:53.738-0400 7f99845c2700  1 -- 10.34.23.179:0/791829791 <== osd.0 v2:10.34.23.179:6802/2212896118 6 ==== osd_op_reply(13 realms.692366da-2962-4d9d-812c-f8aa97dac52d.control [notify-ack] v0'0 uv3 ondisk = 0) ==== 195+0+0 (crc 0 0 0) 0x55f9a6468500 con 0x55f9ad9b8000
2024-05-23T17:50:53.738-0400 7f99855c4700  1 -- 10.34.23.179:0/2623592215 <== osd.0 v2:10.34.23.179:6802/2212896118 105 ==== watch-notify(notify_complete (2) cookie 94530847876096 notify 137438953481 ret 0) ==== 42+0+68 (crc 0 0 0) 0x55f9ab4a4780 con 0x55f9ab252400
2024-05-23T17:50:53.738-0400 7f985194a700 20 rgw period pusher CR thread: cr:s=0x55f9ad9fd540:op=0x55f9ad9a5600:9PushAllCR: operate()
2024-05-23T17:50:53.738-0400 7f985194a700 20 run: stack=0x55f9ad9fd540 is_blocked_by_stack()=0 is_sleeping=0 waiting_for_child()=1
2024-05-23T17:50:53.738-0400 7f985194a700 20 rgw period pusher CR thread: cr:s=0x55f9ad9fd680:op=0x55f9ada30e00:21RGWPostRESTResourceCRI9RGWPeriodiiE: operate()
2024-05-23T17:50:53.739-0400 7f985194a700 20 rgw period pusher CR thread: cr:s=0x55f9ad9fd680:op=0x55f9ada30e00:21RGWPostRESTResourceCRI9RGWPeriodiiE: operate()
2024-05-23T17:50:53.739-0400 7f985194a700 20 get_url picked endpoint=http://localhost:8202
2024-05-23T17:50:53.739-0400 7f9971d9d700  2 req 6898906188255433906 0.054000307s :post_period completing
2024-05-23T17:50:53.739-0400 7f985194a700 20 http_client[POST/http://localhost:8202/admin/realm/period?period=d11deef0-e06a-4050-b3e6-556520f0b5ff&epoch=2&rgwx-zonegroup=64ebdd06-f826-46f7-8ad0-5de0435e2916]sign_request_v4():> HTTP_DATE -> Thu, 23 May 2024 21:50:53 +0000
2024-05-23T17:50:53.739-0400 7f985194a700 20 http_client[POST/http://localhost:8202/admin/realm/period?period=d11deef0-e06a-4050-b3e6-556520f0b5ff&epoch=2&rgwx-zonegroup=64ebdd06-f826-46f7-8ad0-5de0435e2916]sign_request_v4():> HTTP_HOST -> localhost:8202
2024-05-23T17:50:53.739-0400 7f9971d9d700  4 write_data failed: Bad file descriptor
2024-05-23T17:50:53.739-0400 7f9971d9d700  0 req 6898906188255433906 0.054000307s ERROR: RESTFUL_IO(s)->complete_header() returned err=Bad file descriptor
2024-05-23T17:50:53.739-0400 7f9971d9d700  4 write_data failed: Bad file descriptor <<<< HENCE THIS FAILURE?

require the callers to trigger the realm notify manually.
RGWOp_Period_Post takes advantage of this to delay the realm notify
until after it's sent its response to the client. this avoids racing
with realm reload which will close the connection

commit returns EEXIST errors directly so the caller can avoid the
realm notify

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented May 29, 2024

Copy link
Copy Markdown
Contributor Author

thanks @BBoozmen, that post_period op triggers realm reload, so couldn't send its response. i added another commit to delay that realm notification until after the response is sent

@BBoozmen BBoozmen 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.

LGTM - our test which could reproduce https://tracker.ceph.com/issues/66100 (reloading new realm getting stuck while closing the underlying store/driver) is now passing with these changes.

@ivancich ivancich added the wip-eric-testing-2 for ivancich testing label Jul 12, 2024
@cbodley cbodley removed the needs-qa label Jul 16, 2024
@ivancich
ivancich merged commit 94abd9a into ceph:main Jul 16, 2024
@BBoozmen

Copy link
Copy Markdown
Contributor

@cbodley - is this something that can be backported to Squid branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rgw wip-eric-testing-2 for ivancich testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants