Skip to content

rgw/multisite: bilog autotrim heals shards a peer is stuck on - #73830

Open
BBoozmen wants to merge 3 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-83101-bilog-autotrim-heal
Open

BBoozmen wants to merge 3 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-83101-bilog-autotrim-heal

Conversation

@BBoozmen

@BBoozmen BBoozmen commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Added /config check ok -> this is an advanced option and none of the other related configs (rgw_sync_log_*) has a confval entry in doc/radosgw/config-ref.rst

Testing

without fix the new test fails consistently

Both tests fail at the checkpoint after autotrim; the secondary stays behind on the repaired shards:

bucket fhcorv-1: 14 PUTs and 4 DELETEs timed out for the client
waiting for incremental sync to catch up:
      local status: [00000000010.23.6, 00000000010.39.6, 00000000005.10.6, 00000000008.17.6, 00000000010.23.6, 00000000007.15.6, 00000000009.41.6, 00000000013.26.6, 00000000006.15.6, 00000000011.23.6, 00000000007.15.6]
    remote markers: [00000000011.24.9, 00000000011.42.6, 00000000005.10.6, 00000000009.18.6, 00000000011.24.6, 00000000007.15.6, 00000000009.41.6, 00000000013.26.6, 00000000007.16.9, 00000000011.23.6, 00000000008.16.6]
bucket checkpoint timed out waiting for incremental sync to catch up
bucket sync checkpoint failed: (110) Connection timed out

tests.py:2197: in run_bucket_sync_after_dir_suggest_under_osd_delays
FAILED test_multi.py::test_bucket_sync_after_dir_suggest_under_osd_delays_inindex
FAILED test_multi.py::test_bucket_sync_after_dir_suggest_under_osd_delays_fifo

secondary behind on 6 of 11 shards, e.g. shard 0: 00000000010.23.6 vs 00000000011.24.9

with the fix

Autotrim heals exactly the stuck shards and both tests pass:

bucket=:ghoxzg-1[...] shard=1: a peer is stuck at marker=00000000009.20.6 since 2026-11-12T00:40:07, newest=00000000010.21.9, adding a datalog entry for the shard
bucket=:ghoxzg-1[...] shard=2: a peer is stuck at marker=00000000004.9.6 since 2026-11-12T00:39:36, newest=00000000005.10.6, adding a datalog entry for the shard
...
added datalog entries for 8 bilog shards of bucket=:ghoxzg-1[...] with unsynced entries older than 1s
added datalog entries for 5 bilog shards of bucket=:ghoxzg-2[...] with unsynced entries older than 1s

PASSED test_multi.py::test_bucket_sync_after_dir_suggest_under_osd_delays_inindex
PASSED test_multi.py::test_bucket_sync_after_dir_suggest_under_osd_delays_fifo

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.

mrgw.sh returns before radosgw is ready, so a request sent right after a
gateway restart may fail. Wait for it, like teuthology's Gateway.start().

Signed-off-by: Oguzhan Ozmen <[email protected]>
A PUT or DELETE that doesn't complete, e.g. after a gateway crash or a
request timeout with rados_osd_op_timeout, leaves a pending op in the
bucket index.

A later bucket listing repairs it with a bilog entry but
no datalog entry, so the other zone never syncs that shard until the
next write to it. Autotrim then can't trim past the entry.

The test reproduces the issue using rados_osd_op_timeout and slowing
down primary's OSDs.

Related-to: https://tracker.ceph.com/issues/63235
Tests: https://tracker.ceph.com/issues/83101
Signed-off-by: Oguzhan Ozmen <[email protected]>
A bilog entry written without a datalog entry isn't synced by the peer
zone until the next write to the same shard. One way to be in such a
state is when bucket listing's repair of a pending op which left after a
gateway crash or a timed-out request (when rados_osd_op_timeout enabled).

On an idle shard that next write never comes, so autotrim can't trim past
the entry.

Autotrim already reads each peer's sync position. If the oldest entry a
peer hasn't synced on a shard is older than the new
rgw_sync_log_trim_heal_age (1 day by default, 0 disables it), autotrim
adds a datalog entry for that shard, and the peer can now sync it. An
entry's timestamp is its object's mtime, not when it was logged, so a recent
delete of an old object may be healed sooner; that only costs the peer
an extra sync of the shard.

Related-to: https://tracker.ceph.com/issues/63235
Fixes: https://tracker.ceph.com/issues/83101
Signed-off-by: Oguzhan Ozmen <[email protected]>
@github-actions

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_sync_log_trim_heal_age (rgw.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@BBoozmen

Copy link
Copy Markdown
Contributor Author

/config check ok

@BBoozmen BBoozmen changed the title Wip oozmen 83101 bilog autotrim heal rgw/multisite: bilog autotrim heals shards a peer is stuck on Nov 12, 2026
@BBoozmen

Copy link
Copy Markdown
Contributor Author

@smanjara / @adamemerson -> adding you in particular to the reviewers list as you had worked on a similar issue at #54086

@smanjara

smanjara commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

@smanjara / @adamemerson -> adding you in particular to the reviewers list as you had worked on a similar issue at #54086

thanks @BBoozmen! the complexity in that old PR was because we had to consider batched bilog entries before doing a datalog push, for which we have better support now. I just pushed a commit that I was working on, to add datalog updates after dir suggest entries in my bilog async PR #72221.

@BBoozmen

Copy link
Copy Markdown
Contributor Author

@smanjara / @adamemerson -> adding you in particular to the reviewers list as you had worked on a similar issue at #54086

thanks @BBoozmen! the complexity in that old PR was because we had to consider batched bilog entries before doing a datalog push, for which we have better support now. I just pushed a commit that I was working on, to add datalog updates after dir suggest entries in my bilog async PR #72221.

@smanjara - That's great, thank you! I believe I had added some comments there before (unrelated to this one). Let me take a look again.

@smanjara

Copy link
Copy Markdown
Contributor

@smanjara / @adamemerson -> adding you in particular to the reviewers list as you had worked on a similar issue at #54086

thanks @BBoozmen! the complexity in that old PR was because we had to consider batched bilog entries before doing a datalog push, for which we have better support now. I just pushed a commit that I was working on, to add datalog updates after dir suggest entries in my bilog async PR #72221.

@smanjara - That's great, thank you! I believe I had added some comments there before (unrelated to this one). Let me take a look again.

yes those are real concerns! thanks for pointing them out. i'll address them soon :)

@BBoozmen

Copy link
Copy Markdown
Contributor Author

@smanjara / @adamemerson -> adding you in particular to the reviewers list as you had worked on a similar issue at #54086

thanks @BBoozmen! the complexity in that old PR was because we had to consider batched bilog entries before doing a datalog push, for which we have better support now. I just pushed a commit that I was working on, to add datalog updates after dir suggest entries in my bilog async PR #72221.

Hi @smanjara - Just posted my reply at #72221 (review)

As I said there, ran this PR's test against it (without the autotrim heal). It passes for both InIndex and FIFO bilogs, so your change does fix the listing-repair source of the missing datalog entry on main!

I see these two PRs as complementary rather than either/or, though:

  • Already-stuck shards: [DNM]rgw/bilog: make bilog fifo push async #72221 prevents new cases, but shards that are already stuck (we have hundreds on an older cluster) stay stuck until the next write to each shard. Autotrim can heal them.
  • Other causes: a bilog entry can still end up without a datalog entry outside the listing repair, e.g. a failed datalog write (best effort in the async path), a gateway crash between the bilog and datalog writes, or the shutdown window. The heal is a generic backstop for any of these.
  • Backports: AFAICT [DNM]rgw/bilog: make bilog fifo push async #72221 isn't meant for tentacle/umbrella, since it builds on the FIFO bilog work and the async complete rework on main. This PR can be backported and help clusters running those earlier releases today. It may take several years till we get a release having [DNM]rgw/bilog: make bilog fifo push async #72221 I think.

Since the heal only acts on a shard whose oldest unsynced entry is older than rgw_sync_log_trim_heal_age (1 day by default, 0 disables it), with #72221 in place it should rarely fire on main. It just stays there as a safety net.

What do you think?

@smanjara

smanjara commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

As I said there, ran this PR's test against it (without the autotrim heal). It passes for both InIndex and FIFO bilogs, so your change does fix the listing-repair source of the missing datalog entry on main!

thanks for testing!

Since the heal only acts on a shard whose oldest unsynced entry is older than rgw_sync_log_trim_heal_age (1 day by default, 0 disables it), with #72221 in place it should rarely fire on main. It just stays there as a safety net.

What do you think?

I'm just not sure if bilog trim is the place to add datalog for these bilog entries. I am assuming that the buckets that are not very active are the ones that need the trigger? but autotrim might not even schedule those cold buckets for trimming over long periods. is that acceptable?

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.

2 participants