]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/tests: fix test_remap_pin_concurrent 68489/head
authorRonen Friedman <rfriedma@redhat.com>
Mon, 20 Apr 2026 15:32:32 +0000 (15:32 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 20 Apr 2026 15:33:32 +0000 (15:33 +0000)
The test failed in the following sequence:

  1. 32 coroutines start in parallel, all calling try_get_pin(t, offset)
     with the same offset
  2. One coroutine succeeds in submit_transaction, which calls
     test_mappings.consume(delta) and modifies the shared test_mappings
  3. Other coroutines that haven't reached try_get_pin yet now hit the
     assertion because offset no longer exists in test_mappings

The fix is to add a guard before try_get_pin to check if test_mappings still
contains the offset. If it doesn't, we can safely exit early since that
means another coroutine already succeeded and modified the shared state.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/test/crimson/seastore/test_transaction_manager.cc

index dd54b77760f513b14c0f559f029e2684a617c799..c1ca8b5d3baf686a6e2cf09acdc329c2db6f241b 100644 (file)
@@ -1647,6 +1647,10 @@ struct transaction_manager_test_t :
            }
 
            auto t = create_transaction();
+           if (!test_mappings.contains(offset, t.mapping_delta)) {
+             early_exit++;
+             return;
+           }
             auto last_pin = try_get_pin(t, offset);
            if (!last_pin || last_pin->get_length() != length) {
              early_exit++;