Skip to content

tentacle: RGW/multisite: fix bucket-full-sync infinite loop caused by stale bucket_list_result reuse - #67923

Merged
batrick merged 9 commits into
ceph:tentaclefrom
BBoozmen:wip-75439-tentacle
May 9, 2026
Merged

batrick merged 9 commits into
ceph:tentaclefrom
BBoozmen:wip-75439-tentacle

Conversation

@BBoozmen

@BBoozmen BBoozmen commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

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


backport of #66203
parent tracker: https://tracker.ceph.com/issues/73799

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh


The original SSTR macro defined a local variable `std::stringstream ss`
inside its expansion. When an expression that used a variable named `ss`
is passed to this macro, it led to name shadowing and unexpected results.

  Example:
    std::stringstream ss;
    ss << "aaa";
    auto result = SSTR("this is ss=" << ss.str());

  Actual result:
    "this is ss=this is ss="
  Expected result:
    "this is ss=aaa"

This change rewrites the macro to construct an unnamed temporary to
avoid any name collision.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit c630f33)

Conflicts:
    src/test/rgw/CMakeLists.txt
- A unittest listed in CMakeLists.txt is not available in tentacle.
Introduce two developer-level configuration options for controlled delay
injection during integration testing:

  - rgw_inject_delay_sec: duration of the injected delay (in seconds)
  - rgw_inject_delay_pattern: pattern to select which delay points are
    activated

These options help reproduce timing-sensitive or race conditions in a
deterministic way during RGW integration tests.

In the future, these options may evolve to support more complex timing
scenarios by using list or map types. This would allow multiple delay
injection points to be configured simultaneously, for example: delaying
pattern A by 5 seconds, pattern B before or after a specific event, or
using different durations for each point.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 98276d9)
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit b6ecd19)
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 8109a2e)
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 3a9bf2c)
…ts entries

Add a new method `reset_entries()` to the `bucket_list_result` struct
that clears the list of entries and resets the truncated flag.

This would be used to enhance the re-use cases to avoid accessing stale
entries or truncated flag.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit ae59eac)
…to avoid stale listings

RGWBucketFullSyncCR could spin indefinitely when the source bucket was
already deleted. The coroutine reused a bucket_list_result member, and
RGWListRemoteBucketCR populated it without clearing prior state. Stale
entries/is_truncated from a previous iteration caused the loop to
continue even after the bucket no longer existed.

Fix by clearing the provided bucket_list_result at the start of
RGWListRemoteBucketCR (constructor), ensuring each listing starts from a
clean state and reflects the current remote bucket contents.

This prevents the infinite loop and returns correct results when the
bucket has been deleted.

Fixes: https://tracker.ceph.com/issues/73799
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit c8a66a9)
…e bucket is deleted in the middle

Tests: https://tracker.ceph.com/issues/73799
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 9432f0e)

Conflicts:
    src/test/rgw/rgw_multi/tests.py
- Some testcases, available in main, aren't available in tentacle
- add missing tests.py python module dependencies
Add ceph() and call_ceph() helper functions to test-rgw-common.sh
that were missed during the backport of commit 415a16c.

The test_multi.py ceph_admin() method calls test-rgw-call.sh with
'call_ceph' which requires these shell functions to exist.

Signed-off-by: Oguzhan Ozmen <[email protected]>
@github-actions

github-actions Bot commented Mar 20, 2026 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_inject_delay_pattern (rgw.yaml.in)
+ added: rgw_inject_delay_sec (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 added needs-qa wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Apr 22, 2026
@BBoozmen BBoozmen removed the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 22, 2026
@batrick batrick modified the milestones: tentacle, v20.2.2 Apr 28, 2026
@batrick batrick added releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-queue Release engineering: queued for backport verification audit. labels Apr 30, 2026

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@batrick
batrick merged commit 06ae244 into ceph:tentacle May 9, 2026
9 of 11 checks passed
BBoozmen added a commit to BBoozmen/ceph that referenced this pull request May 12, 2026
Tests: https://tracker.ceph.com/issues/66100
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 5e6a9c8)

Conflicts:
   src/test/rgw/rgw_multi/tests.py
- the testcase test_object_lock_sync is not made available in tentacle
- the testcase test_copy_obj_perm_check_between_zonegroups is added
- an earlier tentacle backport (tentacle: RGW/multisite: fix bucket-full-sync
infinite loop caused by stale bucket_list_result reuse ceph#67923) collides
with this one as both PRs introduce a new testcase sharing some common
functions and around the same location in tests.py.
BBoozmen added a commit to BBoozmen/ceph that referenced this pull request Sep 1, 2026
Tests: https://tracker.ceph.com/issues/66100
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 5e6a9c8)

Conflicts:
   src/test/rgw/rgw_multi/tests.py
- the testcase test_object_lock_sync is not made available in tentacle
- the testcase test_copy_obj_perm_check_between_zonegroups is added
- an earlier tentacle backport (tentacle: RGW/multisite: fix bucket-full-sync
infinite loop caused by stale bucket_list_result reuse ceph#67923) collides
with this one as both PRs introduce a new testcase sharing some common
functions and around the same location in tests.py.
- a new backport to Tentacle add a new function which caused hunk hit merge
conflict. Trivial merge-conflict in tests.py.
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.

3 participants