]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/ReplicatedBackend: assert non-trivial obc existence
authorMatan Breizman <mbreizma@redhat.com>
Tue, 23 Jul 2024 13:12:50 +0000 (13:12 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 18 Feb 2025 10:15:31 +0000 (12:15 +0200)
Added to help debug: https://tracker.ceph.com/issues/50608

More information: https://gist.github.com/Matan-B/24b49e9b734259f06edf17fdfea5d24d

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/osd/ReplicatedBackend.cc

index 7ce8fbcd2102bc805e215b9772ee165fdff36099..cf13e1143e06f03c4654389c6d1bc87fa2558d67 100644 (file)
@@ -917,6 +917,7 @@ struct C_ReplicatedBackend_OnPullComplete : GenContext<ThreadPool::TPHandle&> {
       ceph_assert(j != bc->pulling.end());
       ObjectContextRef obc = j->second.obc;
       bc->clear_pull(j, false /* already did it */);
+      ceph_assert(obc);
       int started = bc->start_pushes(i.hoid, obc, h);
       if (started < 0) {
        bc->pushing[i.hoid].clear();
@@ -1932,7 +1933,9 @@ bool ReplicatedBackend::handle_pull_response(
       pull_info.lock_manager);
   }
 
-
+  // if `first` is true, obc was just set above. Otherwise, we should be
+  // able to reuse it.
+  ceph_assert(pull_info.obc);
   interval_set<uint64_t> usable_intervals;
   bufferlist usable_data;
   trim_pushed_data(pull_info.recovery_info.copy_subset,