]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson/seastore: tolerate enoent in concurrent remap/overwrite helpers 69454/head
authorShai Fultheim <shai.fultheim@gmail.com>
Sun, 14 Jun 2026 06:45:43 +0000 (09:45 +0300)
committerShai Fultheim <shai.fultheim@gmail.com>
Sun, 14 Jun 2026 06:45:43 +0000 (09:45 +0300)
test_remap_pin_concurrent races 32 transactions to remap or overwrite the
same extent; exactly one is expected to commit while the rest detect the
conflict and back out. The harness helpers try_get_pin() and try_get_extent()
treated only ct_error::eagain as a tolerable racing outcome -- returning an
empty result so the caller's is_conflicted()/null check counts the
transaction as conflicted -- and routed every other error to
ct_error::assert_all(), aborting the test.

When a competing transaction retires or remaps a mapping mid-race, a
subsequent get_pin()/read_extent() of that laddr legitimately resolves to
ct_error::enoent (ENOENT from BtreeLBAManager::get_cursor) rather than
eagain. The helpers then aborted with "get_extent got invalid error" instead
of treating it as a lost-the-race back-out. The failure is intermittent and
pre-existing: a gap in the test harness, not a fault in the store.

Handle enoent exactly like eagain in try_get_pin() and both try_get_extent()
overloads: return an empty result so the existing conflict/back-out path runs.

Reproduction:

  ninja -C build unittest-transaction-manager
  ./bin/unittest-transaction-manager \
      --gtest_filter='*test_remap_pin_concurrent*' --smp 1 --gtest_repeat=30

Before this change the run aborts within a few iterations with
"get_extent got invalid error"; with it, all 30 iterations across the four
device variants pass.

Signed-off-by: Shai Fultheim <shai.fultheim@gmail.com>
src/test/crimson/seastore/test_transaction_manager.cc

index 59105ae842efc13c7e99910df3c240a341fce7f1..52a734ceec169881f6f1646e4a3393cb6d6d8203 100644 (file)
@@ -602,6 +602,9 @@ struct transaction_manager_test_t :
       [](const crimson::ct_error::eagain &e) {
        return seastar::make_ready_future<TestBlockRef>();
       },
+      [](const crimson::ct_error::enoent &e) {
+       return seastar::make_ready_future<TestBlockRef>();
+      },
       crimson::ct_error::assert_all(
        "get_extent got invalid error"
       )
@@ -632,6 +635,9 @@ struct transaction_manager_test_t :
       [](const crimson::ct_error::eagain &e) {
        return seastar::make_ready_future<TestBlockRef>();
       },
+      [](const crimson::ct_error::enoent &e) {
+       return seastar::make_ready_future<TestBlockRef>();
+      },
       crimson::ct_error::assert_all(
        "get_extent got invalid error"
       )
@@ -760,6 +766,9 @@ struct transaction_manager_test_t :
       [](const crimson::ct_error::eagain &e) {
        return seastar::make_ready_future<std::optional<LBAMapping>>();
       },
+      [](const crimson::ct_error::enoent &e) {
+       return seastar::make_ready_future<std::optional<LBAMapping>>();
+      },
       crimson::ct_error::assert_all(
        "get_extent got invalid error"
       )