Remove ReadOnly part of PinnableSliceAndMmapReads from Lite (#4070)
Summary: Lite does not support readonly DBs. Closes https://github.com/facebook/rocksdb/pull/4070 Differential Revision: D8677858 Pulled By: maysamyabandeh fbshipit-source-id: 536887d2363ee2f5d8e1ea9f1a511e643a1707fa
This commit is contained in:
parent
b557499eee
commit
0a5b5d88b2
@ -2526,10 +2526,11 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) {
|
|||||||
// compaction. It crashes if it does.
|
// compaction. It crashes if it does.
|
||||||
ASSERT_EQ(pinned_value.ToString(), "bar");
|
ASSERT_EQ(pinned_value.ToString(), "bar");
|
||||||
|
|
||||||
|
#ifndef ROCKSDB_LITE
|
||||||
pinned_value.Reset();
|
pinned_value.Reset();
|
||||||
// Unsafe to pin mmap files when they could be kicked out of table cache
|
// Unsafe to pin mmap files when they could be kicked out of table cache
|
||||||
Close();
|
Close();
|
||||||
ReadOnlyReopen(options);
|
ASSERT_OK(ReadOnlyReopen(options));
|
||||||
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
|
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
|
||||||
ASSERT_FALSE(pinned_value.IsPinned());
|
ASSERT_FALSE(pinned_value.IsPinned());
|
||||||
ASSERT_EQ(pinned_value.ToString(), "bar");
|
ASSERT_EQ(pinned_value.ToString(), "bar");
|
||||||
@ -2539,10 +2540,11 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) {
|
|||||||
// value and avoid the memcpy
|
// value and avoid the memcpy
|
||||||
Close();
|
Close();
|
||||||
options.max_open_files = -1;
|
options.max_open_files = -1;
|
||||||
ReadOnlyReopen(options);
|
ASSERT_OK(ReadOnlyReopen(options));
|
||||||
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
|
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
|
||||||
ASSERT_TRUE(pinned_value.IsPinned());
|
ASSERT_TRUE(pinned_value.IsPinned());
|
||||||
ASSERT_EQ(pinned_value.ToString(), "bar");
|
ASSERT_EQ(pinned_value.ToString(), "bar");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user