Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
rgw_sal_motr: [CORTX-33148] fix init_metadata_cache bug
Browse files Browse the repository at this point in the history
We are bound to create MotrMetaCache objects as we are directly using
class methods during CRUD operations without checking if metadata caching
is enabled or not.
Earlier I was trying to not create meta cache objects which was breaking
the CRUD, so now reverting it to create those objects again.

NOTE: Ideally we should create MetaCache objects only if caching is enabled.

Signed-off-by: Sumedh A. Kulkarni <sumedh.a.kulkarni@seagate.com>
  • Loading branch information
sumedhak27 committed Jul 25, 2022
1 parent cbc95ae commit 384ba60
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1472,17 +1472,16 @@ MotrStore& MotrStore::set_use_cache(bool _use_cache) {
}

int MotrStore::initialize(CephContext *cct, const DoutPrefixProvider *dpp) {
int rc = 0;
if (use_cache) {
int rc = init_metadata_cache(dpp, cct);
if (rc != 0) {
ldpp_dout(dpp, 0) << __func__ << ": Metadata cache init failed " <<
"with rc = " << rc << dendl;
return rc;
}
// Create metadata objects and set enabled=use_cache value
int rc = init_metadata_cache(dpp, cct);
if (rc != 0) {
ldpp_dout(dpp, 0) << __func__ << ": Metadata cache init failed " <<
"with rc = " << rc << dendl;
return rc;
}

if (use_gc_thread) {
// Create MotrGC object and start GCWorker threads
int rc = create_gc();
if (rc != 0)
ldpp_dout(dpp, 0) << __func__ << ": Failed to Create MotrGC " <<
Expand Down

0 comments on commit 384ba60

Please sign in to comment.