rgw: add negative cache to the system object#35777
Merged
cbodley merged 1 commit intoceph:masterfrom Jul 16, 2020
Merged
Conversation
mattbenjamin
approved these changes
Jul 2, 2020
Contributor
mattbenjamin
left a comment
There was a problem hiding this comment.
this looks potentially good--can you do a teuthology run?
cbodley
reviewed
Jul 2, 2020
src/rgw/rgw_cache.h
Outdated
| int status = 0; | ||
| uint32_t flags = 0; | ||
| uint64_t epoch = 0; | ||
| bool noentry = false; |
Contributor
There was a problem hiding this comment.
doesn't this just duplicate the int status field?
src/rgw/rgw_cache.cc
Outdated
| if(perfcounter) perfcounter->inc(l_rgw_cache_miss); | ||
| if(src.noentry) { | ||
| ldout(cct, 20) << "negative cache entry" << dendl; | ||
| return -ENODATA; |
Contributor
There was a problem hiding this comment.
this shouldn't be counted or logged as a cache miss - it's a hit on a negative entry. i think we should move this check above of this 'flags' block, ie:
ObjectCacheInfo& src = iter->second.info;
+ if (src.status == -ENOENT) {
+ ldout(cct, 10) << "cache get: name=" << name << " : hit (negative entry)" << dendl;
+ if (perfcounter) perfcounter->inc(l_rgw_cache_hit);
+ return -ENODATA;
+ }
if ((src.flags & mask) != mask) {we shouldn't treat any status other than ENOENT as a negative entry - if we got any other error trying to read it, that shouldn't prevent us from trying again
add negative cache to the system object Signed-off-by: Or Friedmann <ofriedma@redhat.com> Fixes: https://tracker.ceph.com/issues/45816
f73586e to
0900bd8
Compare
cbodley
approved these changes
Jul 13, 2020
Contributor
Author
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add negative cache to the system object
Signed-off-by: Or Friedmann ofriedma@redhat.com
Fixes: https://tracker.ceph.com/issues/45816