Skip to content

tentacle: RGW: prevent shutdown hang by reconciling race between async processor and multisite sync threads - #67437

Open
BBoozmen wants to merge 5 commits into
ceph:tentaclefrom
BBoozmen:wip-74737-tentacle
Open

BBoozmen wants to merge 5 commits into
ceph:tentaclefrom
BBoozmen:wip-74737-tentacle

Conversation

@BBoozmen

@BBoozmen BBoozmen commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

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


backport of #66369
parent tracker: https://tracker.ceph.com/issues/66100

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

--

Ideally this should ber merged to tentacle before the other pending tentacle backport PR #67923. Both backport PRs change some common functions found in the test file src/test/rgw/rgw_multi/tests.py. Merge conflict expected either way.

@BBoozmen BBoozmen added this to the tentacle milestone Feb 19, 2026
@BBoozmen BBoozmen added the rgw label Feb 19, 2026
@github-actions github-actions Bot added the tests label Feb 19, 2026
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@BBoozmen
BBoozmen force-pushed the wip-74737-tentacle branch from 681c146 to 88d17db Compare March 4, 2026 16:11
@BBoozmen
BBoozmen requested a review from a team as a code owner March 4, 2026 16:11
@BBoozmen
BBoozmen force-pushed the wip-74737-tentacle branch from 88d17db to 528cfc7 Compare March 5, 2026 20:41
@BBoozmen

BBoozmen commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

I think make check failure was introduced by this PR:

tasks/rgw_multi/tests_es.py:15: Name "datetime" already defined (by an import) [no-redef]

Line 15 is

from .tests import *

Added the change to "import datetime" instead of "from datetime ...".

@BBoozmen BBoozmen added needs-qa wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh and removed wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Apr 22, 2026
@batrick

batrick commented May 9, 2026

Copy link
Copy Markdown
Member

needs rebase

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@anrao19

anrao19 commented May 11, 2026

Copy link
Copy Markdown
Contributor

pr testing complete, got approval from @ivancich . Pr details : https://tracker.ceph.com/issues/76267
@BBoozmen , pr can be merged if no further testing is needed

@BBoozmen

Copy link
Copy Markdown
Contributor Author

pr testing complete, got approval from @ivancich . Pr details : https://tracker.ceph.com/issues/76267
@BBoozmen , pr can be merged if no further testing is needed

Thank you @anrao19 - the PR comes with the integration test so we should be good wrt testing but looks like I need to address a merge-conflict in the tests.py file. Let me take a look into it.

@BBoozmen

Copy link
Copy Markdown
Contributor Author

Addressed the merge-conflicts in tests.py file. This PR has quite a bit of overlap with the earlier tentacle backport (#67923) that was merged into tentacle a couple of days ago; hence the conflicts.

Tested locally after the rebase & conflict resolution and 2 relevant testcases passed:

$ python3.9 -m pytest test_multi.py -s -v -k "test_bucket_full_sync_when_the_bucket_is_deleted_in_the_meantime or test_period_update_commit"
...
==================================================================================== 2 passed, 126 deselected, 4 warnings in 744.52s (0:12:24) ====================================================================================

@smanjara
smanjara self-requested a review May 11, 2026 19:34
@BBoozmen
BBoozmen force-pushed the wip-74737-tentacle branch from b273844 to 3d0e72a Compare May 12, 2026 16:22
@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 11, 2026
@github-actions github-actions Bot removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-fail Release engineering: failed backport verification audit. labels Jul 13, 2026
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 Jul 13, 2026
@BBoozmen

Copy link
Copy Markdown
Contributor Author

@adamemerson -- the "MISSING IN BACKPORT" commits were due to an earlier PR that went into tentacle. Both this one and the earlier PR were updating the same helper functions in tests.py.

@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 Jul 13, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 49627a2)
Set down_flag on all sync-related threads (meta sync, data sync,
and log trimmer) before draining or joining them in RGWRados::finalize().

This early flagging ensures that any in-progress data sync operations
can detect shutdown sooner and stop issuing new async processor requests,
reducing the chance of deadlock during realm reload.

Fixes: https://tracker.ceph.com/issues/66100
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 5301549)
…down

Add a guard in RGWAsyncRadosProcessor::queue() to avoid queuing new
requests once the processor is shutting down. When the going_down flag
is set, any incoming request is immediately completed with -ECANCELED.

Also introduce RGWAsyncRadosRequest::complete_immediate() to safely
signal completion for requests that are skipped during shutdown.

Fixes: https://tracker.ceph.com/issues/66100
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit e777558)
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.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ Audit Override Removed

New commits were pushed to this PR, so the previous override has been removed.

View workflow run

@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

Automated Backport Parity Review

Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.


Commit Parity Visualizer

BACKPORT PR #67437 SOURCE PR SOURCE STATUS
15f7625 RGW: add RGWRadosThread::set_down_flag() helper PR #66369 49627a2 RGW: add RGWRadosThread::set_down_flag() helper
f46d8ad RGW: set down_flag early on sync processor threads during shutdown 5301549 RGW: set down_flag early on sync processor threads during shutdown
38e389d RGW: prevent RGWAsyncRadosProcessor from queuing requests during shutdown e777558 RGW: prevent RGWAsyncRadosProcessor from queuing requests during shutdown
541fcd1 RGW/datalog: do not try to add entry if changeslog is shutting down 97501cb RGW/datalog: do not try to add entry if changeslog is shutting down
<<<< MISSING IN BACKPORT >>>> 8ab91a4 RGW/test_multi: add a helper function to get data sync oldest incremental change
<<<< MISSING IN BACKPORT >>>> 002463f RGW/test_multi: add a helper function to check whether data-sync is making progress
31477b2 RGW/test_multi: testcase for rgw instance hang/crash during realm reload 5e6a9c8 RGW/test_multi: testcase for rgw instance hang/crash during realm reload

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 31477b2 (cherry-pick of 5e6a9c8)

Affected File(s)

Range Diff

Click to expand
--- Original (5e6a9c8f)
+++ Backport (31477b25)
@@ -2,3 +2,15 @@
 
 Tests: https://tracker.ceph.com/issues/66100
 Signed-off-by: Oguzhan Ozmen <[email protected]>
+(cherry picked from commit 5e6a9c8f9de457406c3ef5f44bf2069c60bc6cd5)
+
+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 #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.

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

1:  5e6a9c8f9de ! 1:  31477b2511e RGW/test_multi: testcase for rgw instance hang/crash during realm reload
    @@ Commit message
     
         Tests: https://tracker.ceph.com/issues/66100
         Signed-off-by: Oguzhan Ozmen <[email protected]>
    +    (cherry picked from commit 5e6a9c8f9de457406c3ef5f44bf2069c60bc6cd5)
    +
    +    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 #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.
     
      ## src/test/rgw/rgw_multi/tests.py ##
    -@@ src/test/rgw/rgw_multi/tests.py: def test_object_lock_sync():
    -     assert(response['ObjectLockConfiguration'] == lock_config)
    +@@ src/test/rgw/rgw_multi/tests.py: import contextlib
    + import dateutil.parser
    + import re
    + import datetime
    ++import threading
      
    + from itertools import combinations
    + from itertools import zip_longest
    +@@ src/test/rgw/rgw_multi/tests.py: def test_copy_obj_perm_check_between_zonegroups(zonegroup):
    +         except ClientError as e:
    +             assert e.response['Error']['Code'] == 'AccessDenied'
      
    --    
     +def test_period_update_commit():
    -+    wkld_concurrency = 25
    -+    num_objects_to_upload = 2500
    -+    number_of_period_updates = 5
    ++    wkld_concurrency = 10
    ++    num_objects_to_upload = 1000
    ++    number_of_period_updates = 3
     +    test_passed = False
     +
    ++    # get client connection to generate s3 wkld
     +    zonegroup = realm.master_zonegroup()
     +    zonegroup_conns = ZonegroupConns(zonegroup)
    -+    primary_zone_client_conn = zonegroup_conns.rw_zones[0]
    -+    secondary_zone_cluster_conn = zonegroup.zones[1]
    ++    primary_zone_client_conn = zonegroup_conns.master_zone
    ++
    ++    # get cluster connection to another zone in the group
    ++    # to issue period update commits and verify replication
    ++    secondary_zone_cluster_conn = None
    ++    for zg in realm.current_period.zonegroups:
    ++        if zonegroup != zg:
    ++            continue
    ++        for zone in zg.zones:
    ++            if zone != zonegroup.master_zone:
    ++                secondary_zone_cluster_conn = zone
    ++                break
    ++        if secondary_zone_cluster_conn is not None:
    ++            break
    ++    else:
    ++        raise SkipTest("test_period_update_commit is skipped.")
     +
     +    bucket = primary_zone_client_conn.create_bucket(gen_bucket_name())
     +    log.info(f"created bucket={bucket.name}")
    @@ src/test/rgw/rgw_multi/tests.py: def test_object_lock_sync():
     +                        Bucket=bucket.name, Key=f"obj-{i:04d}", Body="..."
     +                    )
     +                    num_uploads += 1
    ++                    if stop_event.is_set():
    ++                        break
    ++                    time.sleep(0.01)
     +                except Exception as e:
     +                    log.debug(f"failed to upload object to bucket={bucket.name}: {e}")
     +        log.info(
    @@ src/test/rgw/rgw_multi/tests.py: def test_object_lock_sync():
     +            log.info("issue period update commit")
     +            zonegroup.period.update(secondary_zone_cluster_conn, commit=True)
     +            log.info("verify data sync is making progress")
    -+            if not data_sync_making_progress(secondary_zone_cluster_conn):
    -+                break  # the issue of realm reload freezing reproduced
    ++            with override_config(checkpoint_retries=10, checkpoint_delay=60):
    ++                if not data_sync_making_progress(secondary_zone_cluster_conn):
    ++                    break  # the issue of realm reload freezing reproduced
     +        client_write_only_wkld_thread_stop.set()  # stop client wkld
    -+        zonegroup_data_checkpoint(zonegroup_conns)
    ++        with override_config(checkpoint_retries=10, checkpoint_delay=60):
    ++            zonegroup_data_checkpoint(zonegroup_conns)
     +        test_passed = True
     +    except Exception as e:
     +        log.error(f"test_period_update_commit failed: {e}")
    @@ src/test/rgw/rgw_multi/tests.py: def test_object_lock_sync():
     +        log.info(f"delete bucket={bucket.name}")
     +        primary_zone_client_conn.s3_client.delete_bucket(Bucket=bucket.name)
     +
    + def test_bucket_full_sync_when_the_bucket_is_deleted_in_the_meantime():
    +     num_objects_to_upload = (
    +         3000  # must be more than 1000 to have pagination at full sync

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 Sep 1, 2026
@BBoozmen

BBoozmen commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Audit Override Removed

New commits were pushed to this PR, so the previous override has been removed.

View workflow run

@adamemerson / @batrick I think I'll need an override again.

A recent backport to Tentacle caused "need-rebase" on this one in tests.py and the merge-conflict was a trival one (in the import modules/header part). In fact, all merge conflicts in this PR happened in one commit (31477b2) which touches only tests.py; other 4 commits are clean.

@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 Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

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.

6 participants