For RocksDB, iterator will bypass row cache.
We don't want this to happen for get(), after row cache is enabled.
Signed-off-by: Jianjian Huo <jianjian.huo@ssi.samsung.com>
(cherry picked from commit
f6ac5579190549291f6385775070c305dc8fba8b)
Conflicts:
src/kv/RocksDBStore.cc (trivial)
assert(out && (out->length() == 0));
utime_t start = ceph_clock_now(g_ceph_context);
int r = 0;
- KeyValueDB::Iterator it = get_iterator(prefix);
- it->lower_bound(key);
- if (it->valid() && it->key() == key) {
- out->append(it->value_as_ptr());
+ string value, k;
+ rocksdb::Status s;
+ k = combine_strings(prefix, key);
+ s = db->Get(rocksdb::ReadOptions(), rocksdb::Slice(k), &value);
+ if (s.ok()) {
+ out->append(value);
} else {
r = -ENOENT;
}