]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/osd: Fix event loop context violations in test fixtures 68939/head
authorAlex Ainscow <aainscow@uk.ibm.com>
Fri, 15 May 2026 13:33:17 +0000 (14:33 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Mon, 29 Jun 2026 15:20:13 +0000 (16:20 +0100)
commitbcc26ce6f26a49a6a809a35c687660cc37cf7e1b
tree419d57a7109059c444a60edec47ae5476989e9af
parent7163b736cd645c2b93ca446e6beb5905f14319d0
test/osd: Fix event loop context violations in test fixtures

Refactored test fixture code to properly execute object context operations
within event loop context, fixing ceph_assert(osd != -1) failures.

Key changes:
- Split functions calling get_object_context() into implementation and
  wrapper functions that schedule work on the primary OSD via event loop
- Added accessor functions (set_object_context, clear_object_contexts)
  to encapsulate per-OSD object_contexts map access
- Fixed lambda capture bug in PGBackendTestFixture::update_osdmap()
- Refactored run_parallel_recovery_and_verify_callbacks() to execute
  within proper event loop context

All object context operations now execute within the correct OSD context,
with get_object_context() as the single point querying the current OSD.

Added test ZeroSizeObjectWithAttributesRecovery to verify recovery of
zero-size objects with attributes after primary failover, ensuring
attributes are properly recovered on the failed shard.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
Assisted-by: IBM-Bob:Claude-Sonnet
# Conflicts:
# src/test/osd/ECPeeringTestFixture.cc
src/test/osd/ECPeeringTestFixture.cc
src/test/osd/ECPeeringTestFixture.h
src/test/osd/MockPGBackendListener.h
src/test/osd/PGBackendTestFixture.cc
src/test/osd/PGBackendTestFixture.h
src/test/osd/TestECFailoverWithPeering.cc