DBIter::FindNextUserEntryInternal: do not PrepareValue for `Delete` (#11211)

Summary:
`kTypeDeletion/kTypeDeletionWithTimestamp/kTypeSingleDeletion` does not need access iter value, so omit `PrepareValue`.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11211

Reviewed By: ajkr

Differential Revision: D43253068

Pulled By: cbi42

fbshipit-source-id: 1945c7f8a90b6909128a0553b62d9fd1078b0a08
oxigraph-8.1.1
leipeng 2 years ago committed by Facebook GitHub Bot
parent ebfca2cf00
commit ea85148b78
  1. 15
      db/db_iter.cc

@ -341,11 +341,6 @@ bool DBIter::FindNextUserEntryInternal(bool skipping_saved_key,
} else { } else {
assert(!skipping_saved_key || assert(!skipping_saved_key ||
CompareKeyForSkip(ikey_.user_key, saved_key_.GetUserKey()) > 0); CompareKeyForSkip(ikey_.user_key, saved_key_.GetUserKey()) > 0);
if (!iter_.PrepareValue()) {
assert(!iter_.status().ok());
valid_ = false;
return false;
}
num_skipped = 0; num_skipped = 0;
reseek_done = false; reseek_done = false;
switch (ikey_.type) { switch (ikey_.type) {
@ -369,6 +364,11 @@ bool DBIter::FindNextUserEntryInternal(bool skipping_saved_key,
case kTypeValue: case kTypeValue:
case kTypeBlobIndex: case kTypeBlobIndex:
case kTypeWideColumnEntity: case kTypeWideColumnEntity:
if (!iter_.PrepareValue()) {
assert(!iter_.status().ok());
valid_ = false;
return false;
}
if (timestamp_lb_) { if (timestamp_lb_) {
saved_key_.SetInternalKey(ikey_); saved_key_.SetInternalKey(ikey_);
} else { } else {
@ -397,6 +397,11 @@ bool DBIter::FindNextUserEntryInternal(bool skipping_saved_key,
return true; return true;
break; break;
case kTypeMerge: case kTypeMerge:
if (!iter_.PrepareValue()) {
assert(!iter_.status().ok());
valid_ = false;
return false;
}
saved_key_.SetUserKey( saved_key_.SetUserKey(
ikey_.user_key, ikey_.user_key,
!pin_thru_lifetime_ || !iter_.iter()->IsKeyPinned() /* copy */); !pin_thru_lifetime_ || !iter_.iter()->IsKeyPinned() /* copy */);

Loading…
Cancel
Save