Skip to content

tentacle: rgw: fix period's sync_status during failover/failback - #72687

Merged
batrick merged 2 commits into
ceph:tentaclefrom
lumir-sliva:wip-81774-tentacle
Nov 25, 2026
Merged

batrick merged 2 commits into
ceph:tentaclefrom
lumir-sliva:wip-81774-tentacle

Conversation

@lumir-sliva

Copy link
Copy Markdown
Contributor

backport tracker: https://tracker.ceph.com/issues/81774


backport of #71707
parent tracker: https://tracker.ceph.com/issues/80439

this backport was staged manually

The first commit picks cleanly. The second conflicts in src/rgw/rgw_period.cc:
on tentacle RGWPeriod::update_sync_status() and read_sync_status() still live
in src/rgw/driver/rados/rgw_period.cc, so I applied the same change there
(read the status through rgw_read_local_meta_sync_status(), treat -ENOENT as an
empty status). The rgw_sync.{h,cc} and tests.py parts apply cleanly. Details in
the Conflicts: block of the commit.

On tentacle this is a regression since v20.2.2, which got 203aa43 (backport of
the RGWSI_Zone startup cleanup): the promoting zone now takes its zonegroup from
the local config that zone modify --master just changed, considers itself the
metadata master during its own commit and stores an empty sync_status. On 20.2.4
the promotion is refused with a false "N period(s) behind", and with
--yes-i-really-mean-it every gateway of the zone that didn't fail crashes in the
meta sync thread on the next failback (builds without _GLIBCXX_ASSERTIONS
segfault instead of asserting): on two 20.2.4 clusters with 4 gateways per zone
that was 16 restarts per gateway in 120 s and 502 for clients. Squid isn't
affected (it never got that change), details on the tracker.

Tested on vstart (mstart, 3 zones, 1 gateway per zone) with test_failover_failback
from this PR and test_multi_period_incremental_sync:

  • with the backport: both pass, 2 of 2 runs, no radosgw crash
  • with the src/rgw part reverted: both fail; the two --yes-i-really-mean-it
    master changes store an empty sync_status and the secondaries' radosgw abort
    4 times in RGWMetaSyncCR::operate (the crash in the tracker)

I've also been running the same two commits on a 20.2.4 two-cluster multisite
setup since late September, including a destroy-the-master-zone DR test with
failback.

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)
    • Includes unit test(s)
    • Includes integration test(s)
    • Includes bug reproducer
    • No tests

Shilpa Jagannath added 2 commits October 14, 2026 13:21
to prevent out-of-bounds access

sync_status can be empty during a failback.

Signed-off-by: Shilpa Jagannath <[email protected]>
(cherry picked from commit 63be44a)
…zone change

period update --commit after `zone modify --master` already treats this
zone as meta master, so RGWMetaSyncStatusManager does not read
mdlog.sync-status and the new period stores an empty sync_status. other
zones can incorrectly read that empty status.

read mdlog sync status from the local zone in the update_sync_status()
method which is called only when the period's master zone changes.

add a test case for failover/failback
Signed-off-by: Shilpa Jagannath <[email protected]>

(cherry picked from commit e1247bc)

Conflicts:
	src/rgw/rgw_period.cc
		- RGWPeriod::update_sync_status() and read_sync_status() live in
		  src/rgw/driver/rados/rgw_period.cc on this branch; applied the
		  same change there, without the WITH_RADOSGW_RADOS guard that
		  this branch does not have around read_sync_status()
@lumir-sliva
lumir-sliva requested a review from a team as a code owner October 14, 2026 13:59
@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.

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 14, 2026
@smanjara

Copy link
Copy Markdown
Contributor

thanks @lumir-sliva. the changes look good.
@adamemerson could you please override the audit check?

@anrao19

anrao19 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

@adamemerson adamemerson added ci-approved and removed releng-audit-fail Release engineering: failed backport verification audit. needs-ci-approval labels Oct 28, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ceph Release Engineering Audit Report

Commit Parity Visualizer

BACKPORT PR #72687 SOURCE PR SOURCE STATUS
84c043e rgw: guard sync-status shard lookup during failback PR #71707 63be44a rgw: guard sync-status shard lookup during failback
d6ba9e1 rgw/multisite: read local mdlog sync-status when committing a master zone change e1247bc rgw/multisite: read local mdlog sync-status when committing a master zone change

Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

This does not necessarily indicate an issue but a maintainer should review.

**Click to expand conflict summaries.**

Deviation in Backport d6ba9e1 (cherry-pick of e1247bc)

Affected File(s)

Range Diff

Click to expand
--- Original (e1247bce)
+++ Backport (d6ba9e10)
@@ -10,3 +10,12 @@
 
 add a test case for failover/failback
 Signed-off-by: Shilpa Jagannath <[email protected]>
+
+(cherry picked from commit e1247bce1e5db846dbba215ffd58a10c42e7b388)
+
+Conflicts:
+	src/rgw/rgw_period.cc
+		- RGWPeriod::update_sync_status() and read_sync_status() live in
+		  src/rgw/driver/rados/rgw_period.cc on this branch; applied the
+		  same change there, without the WITH_RADOSGW_RADOS guard that
+		  this branch does not have around read_sync_status()

================================================================================
RANGE DIFF
================================================================================

1:  e1247bce1e5 ! 1:  d6ba9e10c8a rgw/multisite: read local mdlog sync-status when committing a master zone change
    @@ Commit message
         add a test case for failover/failback
         Signed-off-by: Shilpa Jagannath <[email protected]>
     
    +    (cherry picked from commit e1247bce1e5db846dbba215ffd58a10c42e7b388)
    +
    +    Conflicts:
    +            src/rgw/rgw_period.cc
    +                    - RGWPeriod::update_sync_status() and read_sync_status() live in
    +                      src/rgw/driver/rados/rgw_period.cc on this branch; applied the
    +                      same change there, without the WITH_RADOSGW_RADOS guard that
    +                      this branch does not have around read_sync_status()
    +
    + ## src/rgw/driver/rados/rgw_period.cc ##
    +@@ src/rgw/driver/rados/rgw_period.cc: void RGWPeriod::fork()
    + 
    + static int read_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver, rgw_meta_sync_status *sync_status)
    + {
    +-  rgw::sal::RadosStore* rados_store = static_cast<rgw::sal::RadosStore*>(driver);
    +-  // initialize a sync status manager to read the status
    +-  RGWMetaSyncStatusManager mgr(rados_store, rados_store->svc()->async_processor);
    +-  int r = mgr.init(dpp);
    +-  if (r < 0) {
    +-    return r;
    +-  }
    +-  r = mgr.read_sync_status(dpp, sync_status);
    +-  mgr.stop();
    +-  return r;
    ++  auto *store = static_cast<rgw::sal::RadosStore*>(driver);
    ++  return rgw_read_local_meta_sync_status(dpp, store, sync_status);
    + }
    + 
    + int RGWPeriod::update_sync_status(const DoutPrefixProvider *dpp,
    +@@ src/rgw/driver/rados/rgw_period.cc: int RGWPeriod::update_sync_status(const DoutPrefixProvider *dpp,
    + {
    +   rgw_meta_sync_status status;
    +   int r = read_sync_status(dpp, driver, &status);
    ++  if (r == -ENOENT) {
    ++    // new zone joining might not have mdlog.sync-status created yet.
    ++    r = 0;
    ++  }
    +   if (r < 0) {
    +     ldpp_dout(dpp, 0) << "period failed to read sync status: "
    +         << cpp_strerror(-r) << dendl;
    +
      ## src/rgw/driver/rados/rgw_sync.cc ##
     @@ src/rgw/driver/rados/rgw_sync.cc: int RGWReadSyncStatusCoroutine::operate(const DoutPrefixProvider *dpp)
        return 0;
    @@ src/rgw/driver/rados/rgw_sync.h: struct RGWMetaSyncEnv {
        const DoutPrefixProvider *dpp;
        rgw::sal::RadosStore* store;
     
    - ## src/rgw/rgw_period.cc ##
    -@@ src/rgw/rgw_period.cc: static int read_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Driver* dri
    - {
    -   int r = -ENOTSUP;
    - #ifdef WITH_RADOSGW_RADOS
    --  rgw::sal::RadosStore* rados_store = static_cast<rgw::sal::RadosStore*>(driver);
    --  // initialize a sync status manager to read the status
    --  RGWMetaSyncStatusManager mgr(rados_store, rados_store->svc()->async_processor);
    --  r = mgr.init(dpp);
    --  if (r < 0) {
    --    return r;
    --  }
    --  r = mgr.read_sync_status(dpp, sync_status);
    --  mgr.stop();
    -+  auto *store = static_cast<rgw::sal::RadosStore*>(driver);
    -+  r = rgw_read_local_meta_sync_status(dpp, store, sync_status);
    - #endif
    -   return r;
    - }
    -@@ src/rgw/rgw_period.cc: int RGWPeriod::update_sync_status(const DoutPrefixProvider *dpp,
    - {
    -   rgw_meta_sync_status status;
    -   int r = read_sync_status(dpp, driver, &status);
    -+  if (r == -ENOENT) {
    -+    // new zone joining might not have mdlog.sync-status created yet.
    -+    r = 0;
    -+  }
    -   if (r < 0) {
    -     ldpp_dout(dpp, 0) << "period failed to read sync status: "
    -                       << cpp_strerror(-r) << dendl;
    -
      ## src/test/rgw/rgw_multi/tests.py ##
    -@@ src/test/rgw/rgw_multi/tests.py: def data_sync_making_progress(zone):
    -         time.sleep(config.checkpoint_delay)
    +@@ src/test/rgw/rgw_multi/tests.py: def data_sync_making_progress(zone, time_window_sec=180, check_interval_sec=30):
    +         time.sleep(check_interval_sec)
          return result or oldest_inc_change is None
      
     -def set_master_zone(zone):

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.


🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 28, 2026
@adamemerson

Copy link
Copy Markdown
Contributor

/audit override

@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

@anrao19

anrao19 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to tentacle integration testing by anuchaithra started 2026-10-16-04:51.

pr testing completed and approved by @ivancich more details on : https://tracker.ceph.com/issues/81821.
@lumir-sliva , if no further testing is needed then this pr can be merged

@batrick batrick modified the milestones: tentacle, v20.2.6 Nov 25, 2026
@batrick
batrick merged commit beb32ea into ceph:tentacle Nov 25, 2026
24 of 26 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.

5 participants