Repository navigation
tentacle: rgw: fix period's sync_status during failover/failback - #72687
Conversation
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()
|
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 |
|
thanks @lumir-sliva. the changes look good. |
|
This PR has been added to tentacle integration testing by anuchaithra started 2026-10-16-04:51. |
There was a problem hiding this comment.
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
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)
src/rgw/rgw_period.cc
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.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
|
/audit override |
|
✅ Audit Override Applied by @adamemerson. |
pr testing completed and approved by @ivancich more details on : https://tracker.ceph.com/issues/81821. |
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 --masterjust changed, considers itself themetadata 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:
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