Skip to content

rgw/multisite:multisite secondary local sync race - #71779

Merged
ivancich merged 2 commits into
ceph:mainfrom
SaravananPalanisamyRWTH:wip-80389-multisite-secondary-local-sync-race
Sep 24, 2026
Merged

ivancich merged 2 commits into
ceph:mainfrom
SaravananPalanisamyRWTH:wip-80389-multisite-secondary-local-sync-race

Conversation

@SaravananPalanisamyRWTH

@SaravananPalanisamyRWTH SaravananPalanisamyRWTH commented Sep 14, 2026 •

Copy link
Copy Markdown

RGW keeps a version number on every metadata objects (user, bucket, groups ..). In general this version increases monotonically for every update.

In multisite setup, on secondary cluster,, the version is updated as follow

  • secondary PUT is forwarded to remote
  • secondary PUT is applied locally incrementing its version
  • same PUT is later received back through metadata sync. Apply the update as master's state and set version number equal to master's version number.

Since the two number do not come from the same counter, in race conditions between local PUT and remote PUT, lower version from metadata sync can updated in secondary cluster momentarily.

A cache guard introduced by #69748 detected the version going backward and rejected it as stale. This left the cache with a version that no longer matched RADOS. Subsequent retries kept using the same cached value, causing writes to the object to fail for up to 15 minutes and blocking metadata sync.

Fixed by letting secondary cluster independently increase it version counter. It does not use master version anymore.
Now the version number is strictly monotonic, making cache guard's assumption true.

Bug introduced by: ff056da

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

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

Copy link
Copy Markdown

Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR ci-approved to allow Jenkins CI jobs to run.

@SaravananPalanisamyRWTH SaravananPalanisamyRWTH changed the title Wip 80389 multisite secondary local sync race rgw-80389 multisite secondary local sync race Sep 14, 2026
@SaravananPalanisamyRWTH
SaravananPalanisamyRWTH force-pushed the wip-80389-multisite-secondary-local-sync-race branch 2 times, most recently from b90cd7a to b20f169 Compare September 14, 2026 20:57
@SaravananPalanisamyRWTH SaravananPalanisamyRWTH changed the title rgw-80389 multisite secondary local sync race rgw/multisite:80389 multisite secondary local sync race Sep 14, 2026
Comment thread src/rgw/rgw_metadata.cc Resolved
Comment thread src/rgw/rgw_metadata.cc Resolved
Comment thread src/test/rgw/rgw_multi/tests.py Resolved
Comment thread src/test/rgw/rgw_multi/tests.py Resolved
@BBoozmen

Copy link
Copy Markdown
Contributor

I think we can also remove 80389 from the title.

@SaravananPalanisamyRWTH SaravananPalanisamyRWTH changed the title rgw/multisite:80389 multisite secondary local sync race rgw/multisite:multisite secondary local sync race Sep 16, 2026
@SaravananPalanisamyRWTH
SaravananPalanisamyRWTH force-pushed the wip-80389-multisite-secondary-local-sync-race branch from b20f169 to a21c406 Compare September 17, 2026 19:41
saravanan-hetzner and others added 2 commits September 17, 2026 19:54
RGWMetadataManager::put() decode incoming "ver" field "write_version"
causing sync PUT to use cls_version_set() to set master's ver into
local.

On a secondary with race condition, cls_version_set() can overwrite
a "ver" with lower number.

cache guard introduced in #77554, can reject the lower version as stale,
leaving the cache ahead of RADOS and cause repeated -ECANCELLED (#80389).

keeps "write_version" unchanged allowing sync PUT to use
cls_version_inc(), ensure "ver" in secondary/local clusters strictly
monotonic and cache protection from #77554 continues to work correctly

This also affects `radosgw-admin metadata put` and PUT /admin/metadata/.../key.
When metadata is dumped as JSON using these methods, RGW ingores the
ver in the JSON field and directly increments the local version instead.

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

Signed-off-by: Saravanan Palanisamy <[email protected]>
@SaravananPalanisamyRWTH
SaravananPalanisamyRWTH force-pushed the wip-80389-multisite-secondary-local-sync-race branch from a21c406 to 5c57e94 Compare September 17, 2026 19:59
@anrao19

anrao19 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:10.

@anrao19

anrao19 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:10.

Testing completed and got approval from @ivancich, morr details in https://tracker.ceph.com/issues/80712.
@SaravananPalanisamyRWTH , if no further testing is needed then this pr can be merged

@anrao19 anrao19 added TESTED ready-to-merge and removed wip-anrao6-testing wip-anrao6-testing labels Sep 23, 2026
@ivancich
ivancich merged commit a9e3451 into ceph:main Sep 24, 2026
20 checks passed
@ivancich

Copy link
Copy Markdown
Member

The tracker does not list any backports. If this is incorrect, please update the tracker accordingly.

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