Skip to content

fix: refresh radosgw.conf mon host from UpdateConfig#772

Open
sabaini wants to merge 1 commit into
canonical:mainfrom
sabaini:bug/766
Open

fix: refresh radosgw.conf mon host from UpdateConfig#772
sabaini wants to merge 1 commit into
canonical:mainfrom
sabaini:bug/766

Conversation

@sabaini

@sabaini sabaini commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Description

radosgw.conf's "mon host" line was written once at RGW enable time by EnableRGW() and never refreshed, while ceph.conf is re-rendered every minute by the Start() goroutine via UpdateConfig(). As monitors join the cluster, radosgw.conf's mon host list goes permanently stale (e.g. only 2 of 3 monitors), so radosgw can fail to bootstrap when every listed monitor is down at startup while an unlisted one is up. (Downstream: LP snap-openstack bug 2095567.)

Keep radosgw.conf's mon host in sync from the same refresh path that updates ceph.conf: add updateRadosGWMonHost(), which reuses the existing atomic in-place line rewriter fixConfigLine (sibling to fixRadosGWRunDir) to rewrite only the "mon host =" line. This preserves the unpersisted RGW frontend port/SSL settings, which cannot be re-rendered from scratch. UpdateConfig() invokes it right after formatting the monitor addresses, so both files share one source of truth, and warns-and-continues on error so a radosgw.conf write failure cannot block the ceph.conf refresh. A missing file (RGW disabled) is a no-op; an already-current line is left untouched (idempotent).

Also switch UpdateConfig() to the injectable fetchConfigDb seam (already used by backwardCompatPubnet) so the refresh path is testable without a real database.

Fixes #766

Assisted-by: pi:z-ai/glm-5.2

Type of change

Delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

included tests

Contributor checklist

Please check that you have:

  • self-reviewed the code in this PR
  • added code comments, particularly in less straightforward areas
  • added tests to verify effectiveness of this change

radosgw.conf's "mon host" line was written once at RGW enable time by
EnableRGW() and never refreshed, while ceph.conf is re-rendered every
minute by the Start() goroutine via UpdateConfig(). As monitors join the
cluster, radosgw.conf's mon host list goes permanently stale (e.g. only
2 of 3 monitors), so radosgw can fail to bootstrap when every listed
monitor is down at startup while an unlisted one is up. (Downstream:
LP snap-openstack bug 2095567.)

Keep radosgw.conf's mon host in sync from the same refresh path that
updates ceph.conf: add updateRadosGWMonHost(), which reuses the existing
atomic in-place line rewriter fixConfigLine (sibling to fixRadosGWRunDir)
to rewrite only the "mon host =" line. This preserves the unpersisted RGW
frontend port/SSL settings, which cannot be re-rendered from scratch.
UpdateConfig() invokes it right after formatting the monitor addresses,
so both files share one source of truth, and warns-and-continues on error
so a radosgw.conf write failure cannot block the ceph.conf refresh. A
missing file (RGW disabled) is a no-op; an already-current line is left
untouched (idempotent).

Also switch UpdateConfig() to the injectable fetchConfigDb seam (already
used by backwardCompatPubnet) so the refresh path is testable without a
real database.

Fixes canonical#766

Assisted-by: pi:z-ai/glm-5.2
Signed-off-by: Peter Sabaini <peter.sabaini@canonical.com>
@sabaini sabaini changed the title ceph: refresh radosgw.conf mon host from UpdateConfig fix: refresh radosgw.conf mon host from UpdateConfig Jun 24, 2026
@sabaini sabaini requested a review from johnramsden June 24, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

radosgw.conf mon host list is never refreshed (can be permanently stale)

1 participant