|
|
|
@ -1455,10 +1455,10 @@ extern "C" bool RocksDbIOUringEnable() { return true; } |
|
|
|
|
namespace { |
|
|
|
|
#ifndef ROCKSDB_LITE |
|
|
|
|
#ifdef GFLAGS |
|
|
|
|
const int kMaxArgCount = 100; |
|
|
|
|
const size_t kArgBufferSize = 100000; |
|
|
|
|
const int kMaxArgCount = 100; |
|
|
|
|
const size_t kArgBufferSize = 100000; |
|
|
|
|
|
|
|
|
|
void RunIOTracerParserTool(std::string trace_file) { |
|
|
|
|
void RunIOTracerParserTool(std::string trace_file) { |
|
|
|
|
std::vector<std::string> params = {"./io_tracer_parser", |
|
|
|
|
"-io_trace_file=" + trace_file}; |
|
|
|
|
|
|
|
|
@ -1476,13 +1476,13 @@ namespace { |
|
|
|
|
cursor += static_cast<int>(arg.size()) + 1; |
|
|
|
|
} |
|
|
|
|
ASSERT_EQ(0, ROCKSDB_NAMESPACE::io_tracer_parser(argc, argv)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif // GFLAGS
|
|
|
|
|
#endif // ROCKSDB_LITE
|
|
|
|
|
} // namespace
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
// Tests the default implementation of ReadAsync API with PosixFileSystem.
|
|
|
|
|
TEST_P(PrefetchTest, ReadAsyncWithPosixFS) { |
|
|
|
|
TEST_P(PrefetchTest, ReadAsyncWithPosixFS) { |
|
|
|
|
if (mem_env_ || encrypted_env_) { |
|
|
|
|
ROCKSDB_GTEST_SKIP("Test requires non-mem or non-encrypted environment"); |
|
|
|
|
return; |
|
|
|
@ -1619,8 +1619,7 @@ namespace { |
|
|
|
|
// Check stats to make sure async prefetch is done.
|
|
|
|
|
{ |
|
|
|
|
HistogramData async_read_bytes; |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, |
|
|
|
|
&async_read_bytes); |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, &async_read_bytes); |
|
|
|
|
HistogramData prefetched_bytes_discarded; |
|
|
|
|
options.statistics->histogramData(PREFETCHED_BYTES_DISCARDED, |
|
|
|
|
&prefetched_bytes_discarded); |
|
|
|
@ -1643,9 +1642,9 @@ namespace { |
|
|
|
|
SyncPoint::GetInstance()->ClearAllCallBacks(); |
|
|
|
|
|
|
|
|
|
Close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST_P(PrefetchTest, MultipleSeekWithPosixFS) { |
|
|
|
|
TEST_P(PrefetchTest, MultipleSeekWithPosixFS) { |
|
|
|
|
if (mem_env_ || encrypted_env_) { |
|
|
|
|
ROCKSDB_GTEST_SKIP("Test requires non-mem or non-encrypted environment"); |
|
|
|
|
return; |
|
|
|
@ -1761,8 +1760,7 @@ namespace { |
|
|
|
|
// Check stats to make sure async prefetch is done.
|
|
|
|
|
{ |
|
|
|
|
HistogramData async_read_bytes; |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, |
|
|
|
|
&async_read_bytes); |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, &async_read_bytes); |
|
|
|
|
|
|
|
|
|
// Not all platforms support iouring. In that case, ReadAsync in posix
|
|
|
|
|
// won't submit async requests.
|
|
|
|
@ -1796,8 +1794,7 @@ namespace { |
|
|
|
|
// Check stats to make sure async prefetch is done.
|
|
|
|
|
{ |
|
|
|
|
HistogramData async_read_bytes; |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, |
|
|
|
|
&async_read_bytes); |
|
|
|
|
options.statistics->histogramData(ASYNC_READ_BYTES, &async_read_bytes); |
|
|
|
|
HistogramData prefetched_bytes_discarded; |
|
|
|
|
options.statistics->histogramData(PREFETCHED_BYTES_DISCARDED, |
|
|
|
|
&prefetched_bytes_discarded); |
|
|
|
@ -1819,9 +1816,9 @@ namespace { |
|
|
|
|
SyncPoint::GetInstance()->DisableProcessing(); |
|
|
|
|
SyncPoint::GetInstance()->ClearAllCallBacks(); |
|
|
|
|
Close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST_P(PrefetchTest, SeekParallelizationTest1) { |
|
|
|
|
TEST_P(PrefetchTest, SeekParallelizationTest1) { |
|
|
|
|
if (mem_env_ || encrypted_env_) { |
|
|
|
|
ROCKSDB_GTEST_SKIP("Test requires non-mem or non-encrypted environment"); |
|
|
|
|
return; |
|
|
|
@ -1899,8 +1896,7 @@ namespace { |
|
|
|
|
ASSERT_OK(options.statistics->Reset()); |
|
|
|
|
// Each block contains around 4 keys.
|
|
|
|
|
auto iter = std::unique_ptr<Iterator>(db_->NewIterator(ro)); |
|
|
|
|
iter->Seek( |
|
|
|
|
BuildKey(0)); // Prefetch data because of seek parallelization.
|
|
|
|
|
iter->Seek(BuildKey(0)); // Prefetch data because of seek parallelization.
|
|
|
|
|
ASSERT_TRUE(iter->Valid()); |
|
|
|
|
iter->Next(); |
|
|
|
|
ASSERT_TRUE(iter->Valid()); |
|
|
|
@ -1948,11 +1944,11 @@ namespace { |
|
|
|
|
buff_prefetch_count = 0; |
|
|
|
|
} |
|
|
|
|
Close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef ROCKSDB_LITE |
|
|
|
|
#ifdef GFLAGS |
|
|
|
|
TEST_P(PrefetchTest, TraceReadAsyncWithCallbackWrapper) { |
|
|
|
|
TEST_P(PrefetchTest, TraceReadAsyncWithCallbackWrapper) { |
|
|
|
|
if (mem_env_ || encrypted_env_) { |
|
|
|
|
ROCKSDB_GTEST_SKIP("Test requires non-mem or non-encrypted environment"); |
|
|
|
|
return; |
|
|
|
@ -2033,8 +2029,8 @@ namespace { |
|
|
|
|
std::unique_ptr<TraceWriter> trace_writer; |
|
|
|
|
std::string trace_file_path = dbname_ + "/io_trace_file"; |
|
|
|
|
|
|
|
|
|
ASSERT_OK(NewFileTraceWriter(env_, EnvOptions(), trace_file_path, |
|
|
|
|
&trace_writer)); |
|
|
|
|
ASSERT_OK( |
|
|
|
|
NewFileTraceWriter(env_, EnvOptions(), trace_file_path, &trace_writer)); |
|
|
|
|
ASSERT_OK(db_->StartIOTrace(trace_opt, std::move(trace_writer))); |
|
|
|
|
ASSERT_OK(options.statistics->Reset()); |
|
|
|
|
|
|
|
|
@ -2073,7 +2069,7 @@ namespace { |
|
|
|
|
SyncPoint::GetInstance()->ClearAllCallBacks(); |
|
|
|
|
|
|
|
|
|
Close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif // GFLAGS
|
|
|
|
|
#endif // ROCKSDB_LITE
|
|
|
|
|
} // namespace ROCKSDB_NAMESPACE
|
|
|
|
|