Skip to content

rgw/notify: make persistent topic ownership timeout configurable - #70956

Merged
yuvalif merged 1 commit into
ceph:mainfrom
akkki007:wip-rgw-notify-ownership-timeout
Aug 14, 2026
Merged

yuvalif merged 1 commit into
ceph:mainfrom
akkki007:wip-rgw-notify-ownership-timeout

Conversation

@akkki007

@akkki007 akkki007 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Problem

In rgw_notify.cc the queue list refresh period was a hardcoded 30s constant, and the ownership timeout of a persistent topic queue was derived from it as 30 * 3 = 90s. Neither could be changed, so failover of a persistent topic between gateways always took up to ~90s, and there was no way to shorten it for testing.

Fix

Expose the period as a new config option, rgw_topic_ownership_update_period, and keep the ownership timeout at three times that value. Per the tracker discussion this is option (a): a single option, with the other value computed as before.

The option is read once per iteration of the ownership loop rather than at startup, so next_check_time and the lock duration always come from the same read. That keeps the renewal cadence shorter than the lock duration regardless of what the option does between iterations.

On the concern about lowering the value moving ownership unnecessarily:

  • A challenger cannot steal early. cls_lock.cc:85 trims lockers by comparing the stored expiration against the OSD clock; the caller's duration is only used to compute a new expiration. An RGW that computes 9*3=27 simply gets EBUSY until the stored expiry passes.
  • The owner cannot shorten an interval already in flight. next_check_time is only recomputed in the branch that does the work, so the owner keeps its longer expiry until its next scheduled check and then writes both new values together. The tradeoff is that a lowered value takes effect after up to one old period.

max is 3600 because the value is multiplied by three into a std::chrono::seconds, so an unbounded option would overflow int64.

Testing

Manual test on vstart with 2 RGWs and one persistent topic (11 queue shards):

Case Result
default, option unset refresh stayed at 30s, no behaviour change
set to 5 at runtime cadence became 5s, no gateway restart needed
lowered while one gateway owned all queues 0 ownership takeovers by the other gateway
kill -9 of the owning gateway other gateway took all 11 queues in 13s, inside the 15s lock duration (about 90s at the default)
0, 3601 both rejected by the config layer

Added test_persistent_topic_ownership_period_change_http, which lowers the option at runtime and checks that delivery on an already-owned queue is not interrupted. It runs with a single gateway, so it covers the config change and not failover itself.

The automated failover test is left for a separate PR as agreed on the tracker. test_persistent_gateways_recovery and test_persistent_multiple_gateways are currently not_implemented stubs and are where it belongs.

Open for review

  • min is 1, which allows a 3s lock duration against a 1s poll interval, so a higher floor may be safer.
  • max: 3600 and the option name are both suggestions.

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
  • 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 test ceph-volume all
  • jenkins test windows
  • jenkins test rook e2e

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

@github-actions

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_topic_ownership_update_period (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.

@akkki007
akkki007 force-pushed the wip-rgw-notify-ownership-timeout branch from faf7d01 to 5968e36 Compare August 11, 2026 03:49
Comment thread src/common/options/rgw.yaml.in Resolved
The queue list refresh period was hardcoded to 30s, which also fixed the
topic ownership timeout at 90s. Read the period from a new config option
on each iteration of the ownership loop so it can be lowered for faster
failover and for testing. The ownership timeout is still computed as three
times the period, and both values are taken from the same read so the
renewal cadence always stays shorter than the lock duration.

Ownership of an existing persistent topic queue is only affected on its
next renewal.

Fixes: https://tracker.ceph.com/issues/78727
Signed-off-by: Akshay Nazare <[email protected]>
@akkki007
akkki007 force-pushed the wip-rgw-notify-ownership-timeout branch from 5968e36 to 1450cfb Compare August 11, 2026 07:19
@yuvalif

yuvalif commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

/config check ok

@yuvalif
yuvalif self-requested a review August 11, 2026 08:50
@yuvalif

yuvalif commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@yuvalif

yuvalif commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@yuvalif

yuvalif commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test signed

@yuvalif

yuvalif commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test submodules

@anrao19

anrao19 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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

@yuvalif
yuvalif merged commit 9bf2331 into ceph:main Aug 14, 2026
7 of 8 checks passed
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.

3 participants