Skip to content

Commit

Permalink
rgw/cache: this commit removes indexing from ssd and redis
Browse files Browse the repository at this point in the history
driver and squashes the following commits.

rgw/cache: modifications to the ssd cache driver after removing
indexing from the cache backend.
rgw/cache: modifications to redis cache driver, after
removing indexing from cache backend.
rgw/cache: modifications to policy driver code, commenting out
some pieces which refer to cache apis. Those apis have been
removed as part of modification to remove indexing from the
cache backend. These need to appropriately re-instated, once
we finalize which module will contain the data structures
related to cache policy.

Signed-off-by: Pritha Srivastava <[email protected]>
  • Loading branch information
pritha-srivastava committed Apr 2, 2024
1 parent afdb08d commit 318dc19
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 279 deletions.
10 changes: 7 additions & 3 deletions src/rgw/driver/d4n/d4n_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ int LFUDAPolicy::get_min_avg_weight() {
}

CacheBlock LFUDAPolicy::find_victim(const DoutPrefixProvider* dpp, rgw::cache::CacheDriver* cacheNode) {
#if 0
std::vector<rgw::cache::Entry> entries = cacheNode->list_entries(dpp);
std::string victimName;
int minWeight = INT_MAX;
Expand Down Expand Up @@ -243,7 +244,8 @@ CacheBlock LFUDAPolicy::find_victim(const DoutPrefixProvider* dpp, rgw::cache::C

if (ret < 0)
return {};

#endif
CacheBlock victimBlock;
return victimBlock;
}

Expand All @@ -267,7 +269,8 @@ int LFUDAPolicy::get_block(const DoutPrefixProvider* dpp, CacheBlock* block, rgw

int age = get_age();

if (cacheNode->key_exists(dpp, block->cacheObj.objName)) { /* Local copy */
bool key_exists = true; //cacheNode->key_exists(dpp, block->cacheObj.objName) //TODO- correct this
if (key_exists) { /* Local copy */
localWeight += age;
} else {
std::string hosts;
Expand Down Expand Up @@ -371,7 +374,8 @@ uint64_t LFUDAPolicy::eviction(const DoutPrefixProvider* dpp, rgw::cache::CacheD
int ret = cacheNode->delete_data(dpp, victim.cacheObj.objName);

if (!ret) {
ret = set_min_avg_weight(avgWeight - (localWeight/cacheNode->get_num_entries(dpp)), ""/*local cache location*/); // Where else must this be set? -Sam
uint64_t num_entries = 100; //cacheNode->get_num_entries(dpp) TODO - correct this
ret = set_min_avg_weight(avgWeight - (localWeight/num_entries), ""/*local cache location*/); // Where else must this be set? -Sam

if (!ret) {
int age = get_age();
Expand Down
Loading

0 comments on commit 318dc19

Please sign in to comment.