Skip to content

Commit

Permalink
MB-49040: 7/n Skip scope dataSize update for delta of 0
Browse files Browse the repository at this point in the history
Simply check the delta value and return before we do a scope
lookup.

Change-Id: I7f7b31143b52b487a66567b3e471f488fea2920d
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/164632
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
  • Loading branch information
jimwwalker committed Oct 29, 2021
1 parent 315b5c2 commit 2fbd228
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engines/ep/src/collections/vbucket_manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,11 @@ size_t Manifest::getDataSize(ScopeID sid) const {

void Manifest::updateScopeDataSize(const container::const_iterator entry,
ssize_t delta) const {
// Don't continue with a zero update, avoids scope map lookup
if (delta == 0) {
return;
}

if (entry == map.end()) {
throwException<std::invalid_argument>(__FUNCTION__,
"iterator is invalid");
Expand Down

0 comments on commit 2fbd228

Please sign in to comment.