]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/osd/object_context_loader: Fix obc cache existence usage
authorMatan Breizman <mbreizma@redhat.com>
Mon, 27 May 2024 13:21:41 +0000 (13:21 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 27 May 2024 15:24:46 +0000 (15:24 +0000)
commit0b90ee74e06cc5a3a30088fa39fde5634148bda1
treeca273928c319efe511ac68ecd02d1e07dc644f35
parente03f7be26d51f6541150ae6fa111d9c6dd52cf20
crimson/osd/object_context_loader: Fix obc cache existence usage

with_head_obc() uses get_cached_obc() to get_or_create obc instances.

If the obc exists in cache, get_or_load_obc is called with `existed`=true.
The assumption above is wrong.
Cache existence (`existed`) only guarantees that the obc instance was created (and inserted) in the obc_registery.
However, it does **not** assure that the obc was actually loaded.

As obc-loading is now concurrent, it's possible for the first user to only create the obc in
cache (without loading yet) and the second concurrent user to assume it was already loaded.

With this patch, we verify that the obc was loaded in get_or_load_obc.

* make loading-obc concurrent PR: https://github.com/ceph/ceph/pull/55488

Fixes: https://tracker.ceph.com/issues/64206
Fixes: https://tracker.ceph.com/issues/66214
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/object_context.h
src/crimson/osd/object_context_loader.cc