提交 0a5b5d88 编写于 作者: M Maysam Yabandeh 提交者: Facebook Github Bot

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
上级 b557499e
......@@ -2526,10 +2526,11 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) {
// compaction. It crashes if it does.
ASSERT_EQ(pinned_value.ToString(), "bar");
#ifndef ROCKSDB_LITE
pinned_value.Reset();
// Unsafe to pin mmap files when they could be kicked out of table cache
Close();
ReadOnlyReopen(options);
ASSERT_OK(ReadOnlyReopen(options));
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
ASSERT_FALSE(pinned_value.IsPinned());
ASSERT_EQ(pinned_value.ToString(), "bar");
......@@ -2539,10 +2540,11 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) {
// value and avoid the memcpy
Close();
options.max_open_files = -1;
ReadOnlyReopen(options);
ASSERT_OK(ReadOnlyReopen(options));
ASSERT_EQ(Get("foo", &pinned_value), Status::OK());
ASSERT_TRUE(pinned_value.IsPinned());
ASSERT_EQ(pinned_value.ToString(), "bar");
#endif
}
} // namespace rocksdb
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册