From 0a5b5d88b2da594ed94b714f415d1059ad0fc07b Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Thu, 28 Jun 2018 08:31:19 -0700 Subject: [PATCH] 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 --- db/db_test2.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/db_test2.cc b/db/db_test2.cc index cda3cbf47..a698caaa4 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -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