From b82edffc7b48145f1a9818a69d04e23228002896 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Tue, 3 May 2022 16:21:31 -0700 Subject: [PATCH] Improve comments to options.allow_mmap_reads (#9936) Summary: It confused users and use that with options.allow_mmap_reads = true, CPU is high with checksum verification. Add a comment to explain it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9936 Reviewed By: anand1976 Differential Revision: D36106529 fbshipit-source-id: 3d723bd686f96a84c694c8b2d91ad28d9ccfd979 --- include/rocksdb/options.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index b9bc15753..a554fc737 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -767,6 +767,14 @@ struct DBOptions { // Allow the OS to mmap file for reading sst tables. // Not recommended for 32-bit OS. + // When the option is set to true and compression is disabled, the blocks + // will not be copied and will be read directly from the mmap-ed memory + // area, and the block will not be inserted into the block cache. However, + // checksums will still be checked if ReadOptions.verify_checksums is set + // to be true. It means a checksum check every time a block is read, more + // than the setup where the option is set to false and the block cache is + // used. The common use of the options is to run RocksDB on ramfs, where + // checksum verification is usually not needed. // Default: false bool allow_mmap_reads = false;