Project

General

Profile

Actions

Bug #80439

closed
SM SM

[rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operate

Bug #80439: [rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operate

Added by Shilpa MJ 3 months ago. Updated 7 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle,umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-4305-g21ba3d6d9b
Released In:
Upkeep Timestamp:
2026-11-26T01:08:54+00:00

Description

QE reproducer: one radosgw per site, secondary read-only.
Failover: promote secondary to master with read-only=false, I/O on secondary.
Failback: restore primary as master, secondary made read-only, period update --commit.

after the failback period is pushed to the secondary, that radosgw reloads and aborts in the meta-sync thread.
primary then shows metadata sync 2200.

Logs on secondary after failback shows as below followed by a crash:

Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: ====== starting new request req=0x7f53b4a2f330 request_id=tx00000529bf10fad6ff84f-006aa16fdb-25106-secondary =====
Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: rgw realm reloader: Pausing frontends for realm update...
Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: ====== req done req=0x7f53b4a2f330 op=post_period bucket= status=0 http_status=200 latency=0.051999852s request_id=tx0
0000529bf10fad6ff84f-006aa16fdb-25106-secondary ======
Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: beast: 0x7f53b4a2f330: 10.0.64.3 - repuser [09/Sep/2026:14:40:27.579 +0000] "POST /admin/realm/period?period=65e811c3-d6d2-4013-a4ee-111730311281&epoch=1&rgwx-zonegroup=c9edb949-6921-48b8-9811-ed03fa8721c0 HTTP/1.1" 200 2339 - - - latency=0.051999852s
Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: rgw realm reloader: Frontends paused
Sep 09 14:40:27 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: rgw rados thread: ERROR: failed to run sync
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: rgw realm reloader: driver closed
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: rgw realm reloader: Creating new driver
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: RGW-SYNC:meta: start
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 radosgw[39849]: RGW-SYNC:meta: realm epoch=2 period id=d952afb1-2535-451b-a0a2-cbb580414dca
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 ceph-6998717a-ac54-11f1-bfab-fa163ee84ee2-rgw-shared-sec-ceph-sec-tj1-l6voyp-node5-hrszbf[39845]: /usr/include/c++/14/bits/stl_vector.h:1162: constexpr std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Sep 09 14:40:43 ceph-sec-tj1-l6voyp-node5 ceph-6998717a-ac54-11f1-bfab-fa163ee84ee2-rgw-shared-sec-ceph-sec-tj1-l6voyp-node5-hrszbf[39845]: *** Caught signal (Aborted) **

from the logs above, it appears that " POST /admin/realm/period?period=65e811c3 " is a period push of the period after failback (primary is master again), not a local commit. and " RGW-SYNC:meta: realm epoch=2 period id=d952afb1-2535-451b-a0a2-cbb580414dca " points to the older failover period in mdlog.sync-status.

so, secondary zone's sync is not on the current period.

(gdb) bt
#0  0x00007f54f321581c in __pthread_kill_implementation ()
   from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libc.so.6
#1  0x00007f54f31bf116 in raise () from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libc.so.6
#2  0x000055683b1e9935 in handle_oneshot_fatal_signal(int) ()
#3  <signal handler called>
#4  0x00007f54f321581c in __pthread_kill_implementation ()
   from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libc.so.6
#5  0x00007f54f31bf116 in raise () from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libc.so.6
#6  0x00007f54f31a68fa in abort () from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libc.so.6
#7  0x00007f54f3512d30 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) ()
   from /var/lib/containers/storage/overlay/03739d286714988cb7bc55064030cd11cfb5a032772348a04722776cc05052c2/merged/lib64/libstdc++.so.6
#8  0x000055683aaed8af in RGWMetaSyncCR::operate(DoutPrefixProvider const*) ()
#9  0x000055683abca1ab in RGWCoroutinesStack::operate(DoutPrefixProvider const*, RGWCoroutinesEnv*) ()
#10 0x000055683abccd72 in RGWCoroutinesManager::run(DoutPrefixProvider const*, std::__cxx11::list<RGWCoroutinesStack*, std::allocator<RGWCoroutinesStack*> >&) ()
#11 0x000055683abcda18 in RGWCoroutinesManager::run(DoutPrefixProvider const*, RGWCoroutine*) ()
#12 0x000055683aafa0fd in RGWRemoteMetaLog::run_sync(DoutPrefixProvider const*, optional_yield, rgw::sal::ConfigStore*) ()
#13 0x000055683a99fa6a in RGWMetaSyncProcessorThread::process(DoutPrefixProvider const*) ()
#14 0x000055683a9a14b9 in RGWRadosThread::Worker::entry() ()
#15 0x00007f54f32138bf in start_thread ()

RGWPeriod::sync_status, a vector<string> is mostly where the assertion happened.

"/usr/include/c++/14/bits/stl_vector.h:1162: constexpr std::vector<_Tp, Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::_cxx11::basic_string<char>; Alloc = std::allocator<std::_cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed."

period_marker = next.get_period().get_sync_status()[shard_id];

but its unclear why sync_status was empty or sized incorrectly. according to https://github.com/ceph/ceph/blob/main/src/rgw/rgw_zone.cc#L1414, if the master changed (like a failover/failback), commit_period() calls RGWPeriod::update_sync_status() to store the current metadata sync status in the period. since the secondary (which is still the master) during failback received a period POST, the commit must have happened on the primary (which is the non-master, currently in the process of being promoted) and somehow resized it empty/incorrectly. one place where we might entirely skip updating the sync_status in update_sync_status() and return empty is during the call to read_sync_status():

  if (store->svc()->zone->is_meta_master()) {
    return 0;
  }

https://github.com/ceph/ceph/blob/main/src/rgw/driver/rados/rgw_sync.cc#L2196, but the primary is still non-master when the commit ran. I am planning to add debug log messages for that.

to stop the crash, we could bounds-check before indexing period's sync_status as an immediate fix, but it doesn't resolve the rootcause.


Related issues 2 (0 open — 2 closed)

Copied to rgw - Backport #81774: tentacle: [rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operateResolvedLumir Sliva

Actions
Copied to rgw - Backport #82614: umbrella: [rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operateResolvedLumir Sliva

Actions

JI Updated by J. Eric Ivancich 3 months ago Actions #1

  • Assignee set to Shilpa MJ

CB Updated by Casey Bodley 2 months ago Actions #2

  • Status changed from New to Fix Under Review
  • Pull request ID set to 71707

UB Updated by Upkeep Bot about 2 months ago Actions #3

  • Status changed from Fix Under Review to Resolved
  • Merge Commit set to 21ba3d6d9b82b6cd4cbd5b878fc41adb904761bb
  • Fixed In set to v21.3.0-4305-g21ba3d6d9b
  • Upkeep Timestamp set to 2026-10-13T05:01:09+00:00

LS Updated by Lumir Sliva about 2 months ago Actions #4

  • Copied to Backport #81774: tentacle: [rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operate added

LS Updated by Lumir Sliva about 2 months ago Actions #5

  • Status changed from Resolved to Pending Backport
  • Backport set to tentacle

I set Backport to tentacle and opened the backport by hand, the field was empty at merge so the bot didn't create it: #81774, https://github.com/ceph/ceph/pull/72687.

Squid isn't affected, so no squid backport. On squid the zonegroup in RGWSI_Zone still comes from the current period, so during the promoting commit the new master zone isn't meta master yet and read_sync_status() reads the real status (64 entries in my run of test_failover_failback on squid without the fix, and the test passes). Tentacle got 203aa43fa09 in v20.2.2 (backport of 17805489404, #71291): the zonegroup now comes from the local config that zone modify --master just changed, is_meta_master() is already true during the commit, and the period gets an empty sync_status. So on tentacle this is a regression since v20.2.2.

UB Updated by Upkeep Bot about 2 months ago Actions #6

  • Status changed from Pending Backport to Backporting
  • Upkeep Timestamp changed from 2026-10-13T05:01:09+00:00 to 2026-10-14T14:04:03+00:00

LS Updated by Lumir Sliva 29 days ago Actions #7

  • Copied to Backport #82614: umbrella: [rgw-multisite]: vector out-of-bounds assert in RGWMetaSyncCR::operate added

LS Updated by Lumir Sliva 29 days ago Actions #8

  • Backport changed from tentacle to tentacle,umbrella

LS Updated by Lumir Sliva 29 days ago Actions #9

Umbrella needs this as well: it was branched before https://github.com/ceph/ceph/pull/71707 merged. On umbrella test_multi_period_incremental_sync fails 4 of 4 at the master zone change:

ERROR: This zone is 2 period(s) behind the current master zone in metadata sync. If this zone is promoted to master, any metadata changes during that time are likely to be lost.
failed to commit period: (22) Invalid argument

Both commits pick cleanly onto umbrella (no hand port needed, unlike tentacle). I added umbrella to the Backport field, filed #82614 and opened https://github.com/ceph/ceph/pull/73448.

Tested on a 3-zone vstart, 1 gateway per zone:
  • with the backport: test_multi_period_incremental_sync 4 of 4 pass, test_failover_failback 2 of 2 pass, no radosgw crash
  • test_failover_failback with the src/rgw part reverted: 2 of 2 fail at the meta checkpoint for the third zone, whose gateway aborts twice per run in RGWMetaSyncCR::operate (meta-sync thread)

UB Updated by Upkeep Bot 7 days ago Actions #10

  • Status changed from Backporting to Resolved
  • Upkeep Timestamp changed from 2026-10-14T14:04:03+00:00 to 2026-11-26T01:08:54+00:00
Actions

Also available in: PDF Atom