Skip to content

Commit d79be3d

Browse files
pdillingerfacebook-github-bot
authored andcommitted
Changes and enhancements to compression stats, thresholds (facebook#11388)
Summary: ## Option API updates * Add new CompressionOptions::max_compressed_bytes_per_kb, which corresponds to 1024.0 / min allowable compression ratio. This avoids the hard-coded minimum ratio of 8/7. * Remove unnecessary constructor for CompressionOptions. * Document undocumented CompressionOptions. Use idiom for default values shown clearly in one place (not precariously repeated). ## Stat API updates * Deprecate the BYTES_COMPRESSED, BYTES_DECOMPRESSED histograms. Histograms incur substantial extra space & time costs compared to tickers, and the distribution of uncompressed data block sizes tends to be uninteresting. If we're interested in that distribution, I don't see why it should be limited to blocks stored as compressed. * Deprecate the NUMBER_BLOCK_NOT_COMPRESSED ticker, because the name is very confusing. * New or existing tickers relevant to compression: * BYTES_COMPRESSED_FROM * BYTES_COMPRESSED_TO * BYTES_COMPRESSION_BYPASSED * BYTES_COMPRESSION_REJECTED * COMPACT_WRITE_BYTES + FLUSH_WRITE_BYTES (both existing) * NUMBER_BLOCK_COMPRESSED (existing) * NUMBER_BLOCK_COMPRESSION_BYPASSED * NUMBER_BLOCK_COMPRESSION_REJECTED * BYTES_DECOMPRESSED_FROM * BYTES_DECOMPRESSED_TO We can compute a number of things with these stats: * "Successful" compression ratio: BYTES_COMPRESSED_FROM / BYTES_COMPRESSED_TO * Compression ratio of data on which compression was attempted: (BYTES_COMPRESSED_FROM + BYTES_COMPRESSION_REJECTED) / (BYTES_COMPRESSED_TO + BYTES_COMPRESSION_REJECTED) * Compression ratio of data that could be eligible for compression: (BYTES_COMPRESSED_FROM + X) / (BYTES_COMPRESSED_TO + X) where X = BYTES_COMPRESSION_REJECTED + NUMBER_BLOCK_COMPRESSION_REJECTED * Overall SST compression ratio (compression disabled vs. actual): (Y - BYTES_COMPRESSED_TO + BYTES_COMPRESSED_FROM) / Y where Y = COMPACT_WRITE_BYTES + FLUSH_WRITE_BYTES Keeping _REJECTED separate from _BYPASSED helps us to understand "wasted" CPU time in compression. ## BlockBasedTableBuilder Various small refactorings, optimizations, and name clean-ups. Pull Request resolved: facebook#11388 Test Plan: unit tests added * `options_settable_test.cc`: use non-deprecated idiom for configuring CompressionOptions from string. The old idiom is tested elsewhere and does not need to be updated to support the new field. Reviewed By: ajkr Differential Revision: D45128202 Pulled By: pdillinger fbshipit-source-id: 5a652bf5c022b7ec340cf79018cccf0686962803
1 parent adc9001 commit d79be3d

14 files changed

+305
-126
lines changed

HISTORY.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Public API Changes
44
* `SstFileWriter::DeleteRange()` now returns `Status::InvalidArgument` if the range's end key comes before its start key according to the user comparator. Previously the behavior was undefined.
55
* Add `multi_get_for_update` to C API.
6+
* Remove unnecessary constructor for CompressionOptions.
67

78
### Behavior changes
89
* Changed default block cache size from an 8MB to 32MB LRUCache, which increases the default number of cache shards from 16 to 64. This change is intended to minimize cache mutex contention under stress conditions. See https://github.com/facebook/rocksdb/wiki/Block-Cache for more information.
@@ -17,6 +18,7 @@
1718
### New Features
1819
* Add experimental `PerfContext` counters `iter_{next|prev|seek}_count` for db iterator, each counting the times of corresponding API being called.
1920
* Allow runtime changes to whether `WriteBufferManager` allows stall or not by calling `SetAllowStall()`
21+
* Added statistics tickers BYTES_COMPRESSED_FROM, BYTES_COMPRESSED_TO, BYTES_COMPRESSION_BYPASSED, BYTES_COMPRESSION_REJECTED, NUMBER_BLOCK_COMPRESSION_BYPASSED, and NUMBER_BLOCK_COMPRESSION_REJECTED. Disabled/deprecated histograms BYTES_COMPRESSED and BYTES_DECOMPRESSED, and ticker NUMBER_BLOCK_NOT_COMPRESSED. The new tickers offer more inight into compression ratios, rejected vs. disabled compression, etc. (#11388)
2022
* New statistics `rocksdb.file.read.{flush|compaction}.micros` that measure read time of block-based SST tables or blob files during flush or compaction.
2123

2224
### Bug Fixes

db/blob/blob_file_builder.cc

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ Status BlobFileBuilder::CompressBlobIfNeeded(
259259
return Status::OK();
260260
}
261261

262+
// TODO: allow user CompressionOptions, including max_compressed_bytes_per_kb
262263
CompressionOptions opts;
263264
CompressionContext context(blob_compression_type_);
264265
constexpr uint64_t sample_for_compression = 0;

db/db_statistics_test.cc

+75-20
Original file line numberDiff line numberDiff line change
@@ -49,47 +49,102 @@ TEST_F(DBStatisticsTest, CompressionStatsTest) {
4949
options.compression = type;
5050
options.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics();
5151
options.statistics->set_stats_level(StatsLevel::kExceptTimeForMutex);
52+
BlockBasedTableOptions bbto;
53+
bbto.enable_index_compression = false;
54+
options.table_factory.reset(NewBlockBasedTableFactory(bbto));
5255
DestroyAndReopen(options);
5356

54-
int kNumKeysWritten = 100000;
57+
auto PopStat = [&](Tickers t) -> uint64_t {
58+
return options.statistics->getAndResetTickerCount(t);
59+
};
60+
61+
int kNumKeysWritten = 100;
62+
double compress_to = 0.5;
63+
// About three KVs per block
64+
int len = static_cast<int>(BlockBasedTableOptions().block_size / 3);
65+
int uncomp_est = kNumKeysWritten * (len + 20);
5566

56-
// Check that compressions occur and are counted when compression is turned on
5767
Random rnd(301);
68+
std::string buf;
69+
70+
// Check that compressions occur and are counted when compression is turned on
5871
for (int i = 0; i < kNumKeysWritten; ++i) {
59-
// compressible string
60-
ASSERT_OK(Put(Key(i), rnd.RandomString(128) + std::string(128, 'a')));
72+
ASSERT_OK(
73+
Put(Key(i), test::CompressibleString(&rnd, compress_to, len, &buf)));
6174
}
6275
ASSERT_OK(Flush());
63-
ASSERT_GT(options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED), 0);
76+
EXPECT_EQ(34, PopStat(NUMBER_BLOCK_COMPRESSED));
77+
EXPECT_NEAR2(uncomp_est, PopStat(BYTES_COMPRESSED_FROM), uncomp_est / 10);
78+
EXPECT_NEAR2(uncomp_est * compress_to, PopStat(BYTES_COMPRESSED_TO),
79+
uncomp_est / 10);
80+
81+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_DECOMPRESSED));
82+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_FROM));
83+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_TO));
6484

85+
// And decompressions
6586
for (int i = 0; i < kNumKeysWritten; ++i) {
6687
auto r = Get(Key(i));
6788
}
68-
ASSERT_GT(options.statistics->getTickerCount(NUMBER_BLOCK_DECOMPRESSED), 0);
89+
EXPECT_EQ(34, PopStat(NUMBER_BLOCK_DECOMPRESSED));
90+
EXPECT_NEAR2(uncomp_est, PopStat(BYTES_DECOMPRESSED_TO), uncomp_est / 10);
91+
EXPECT_NEAR2(uncomp_est * compress_to, PopStat(BYTES_DECOMPRESSED_FROM),
92+
uncomp_est / 10);
6993

70-
options.compression = kNoCompression;
94+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSION_BYPASSED));
95+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSION_REJECTED));
96+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSION_BYPASSED));
97+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSION_REJECTED));
98+
99+
// Check when compression is rejected.
100+
compress_to = 0.95;
71101
DestroyAndReopen(options);
72-
uint64_t currentCompressions =
73-
options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED);
74-
uint64_t currentDecompressions =
75-
options.statistics->getTickerCount(NUMBER_BLOCK_DECOMPRESSED);
76102

77-
// Check that compressions do not occur when turned off
78103
for (int i = 0; i < kNumKeysWritten; ++i) {
79-
// compressible string
80-
ASSERT_OK(Put(Key(i), rnd.RandomString(128) + std::string(128, 'a')));
104+
ASSERT_OK(
105+
Put(Key(i), test::CompressibleString(&rnd, compress_to, len, &buf)));
81106
}
82107
ASSERT_OK(Flush());
83-
ASSERT_EQ(options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED) -
84-
currentCompressions,
85-
0);
108+
for (int i = 0; i < kNumKeysWritten; ++i) {
109+
auto r = Get(Key(i));
110+
}
111+
EXPECT_EQ(34, PopStat(NUMBER_BLOCK_COMPRESSION_REJECTED));
112+
EXPECT_NEAR2(uncomp_est, PopStat(BYTES_COMPRESSION_REJECTED),
113+
uncomp_est / 10);
114+
115+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSED));
116+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSION_BYPASSED));
117+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_DECOMPRESSED));
118+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSED_FROM));
119+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSED_TO));
120+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSION_BYPASSED));
121+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_FROM));
122+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_TO));
123+
124+
// Check when compression is disabled.
125+
options.compression = kNoCompression;
126+
DestroyAndReopen(options);
86127

128+
for (int i = 0; i < kNumKeysWritten; ++i) {
129+
ASSERT_OK(
130+
Put(Key(i), test::CompressibleString(&rnd, compress_to, len, &buf)));
131+
}
132+
ASSERT_OK(Flush());
87133
for (int i = 0; i < kNumKeysWritten; ++i) {
88134
auto r = Get(Key(i));
89135
}
90-
ASSERT_EQ(options.statistics->getTickerCount(NUMBER_BLOCK_DECOMPRESSED) -
91-
currentDecompressions,
92-
0);
136+
EXPECT_EQ(34, PopStat(NUMBER_BLOCK_COMPRESSION_BYPASSED));
137+
EXPECT_NEAR2(uncomp_est, PopStat(BYTES_COMPRESSION_BYPASSED),
138+
uncomp_est / 10);
139+
140+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSED));
141+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_COMPRESSION_REJECTED));
142+
EXPECT_EQ(0, PopStat(NUMBER_BLOCK_DECOMPRESSED));
143+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSED_FROM));
144+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSED_TO));
145+
EXPECT_EQ(0, PopStat(BYTES_COMPRESSION_REJECTED));
146+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_FROM));
147+
EXPECT_EQ(0, PopStat(BYTES_DECOMPRESSED_TO));
93148
}
94149

95150
TEST_F(DBStatisticsTest, MutexWaitStatsDisabledByDefault) {

include/rocksdb/advanced_options.h

+43-47
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,28 @@ struct CompactionOptionsFIFO {
8585

8686
// Compression options for different compression algorithms like Zlib
8787
struct CompressionOptions {
88+
// ==> BEGIN options that can be set by deprecated configuration syntax, <==
89+
// ==> e.g. compression_opts=5:6:7:8:9:10:true:11:false <==
90+
// ==> Please use compression_opts={level=6;strategy=7;} form instead. <==
91+
8892
// RocksDB's generic default compression level. Internally it'll be translated
8993
// to the default compression level specific to the library being used (see
9094
// comment above `ColumnFamilyOptions::compression`).
9195
//
9296
// The default value is the max 16-bit int as it'll be written out in OPTIONS
9397
// file, which should be portable.
94-
const static int kDefaultCompressionLevel = 32767;
98+
static constexpr int kDefaultCompressionLevel = 32767;
99+
100+
// zlib only: windowBits parameter. See https://www.zlib.net/manual.html
101+
int window_bits = -14;
102+
103+
// Compression "level" applicable to zstd, zlib, LZ4. Except for
104+
// kDefaultCompressionLevel (see above), the meaning of each value depends
105+
// on the compression algorithm.
106+
int level = kDefaultCompressionLevel;
95107

96-
int window_bits;
97-
int level;
98-
int strategy;
108+
// zlib only: strategy parameter. See https://www.zlib.net/manual.html
109+
int strategy = 0;
99110

100111
// Maximum size of dictionaries used to prime the compression library.
101112
// Enabling dictionary can improve compression ratios when there are
@@ -117,18 +128,14 @@ struct CompressionOptions {
117128
// If block cache insertion fails with `Status::MemoryLimit` (i.e., it is
118129
// full), we finalize the dictionary with whatever data we have and then stop
119130
// buffering.
120-
//
121-
// Default: 0.
122-
uint32_t max_dict_bytes;
131+
uint32_t max_dict_bytes = 0;
123132

124133
// Maximum size of training data passed to zstd's dictionary trainer. Using
125134
// zstd's dictionary trainer can achieve even better compression ratio
126135
// improvements than using `max_dict_bytes` alone.
127136
//
128137
// The training data will be used to generate a dictionary of max_dict_bytes.
129-
//
130-
// Default: 0.
131-
uint32_t zstd_max_train_bytes;
138+
uint32_t zstd_max_train_bytes = 0;
132139

133140
// Number of threads for parallel compression.
134141
// Parallel compression is enabled only if threads > 1.
@@ -141,9 +148,7 @@ struct CompressionOptions {
141148
// compressed size is in flight when compression is parallelized. To be
142149
// reasonably accurate, this inflation is also estimated by using historical
143150
// compression ratio and current bytes inflight.
144-
//
145-
// Default: 1.
146-
uint32_t parallel_threads;
151+
uint32_t parallel_threads = 1;
147152

148153
// When the compression options are set by the user, it will be set to "true".
149154
// For bottommost_compression_opts, to enable it, user must set enabled=true.
@@ -152,9 +157,7 @@ struct CompressionOptions {
152157
//
153158
// For compression_opts, if compression_opts.enabled=false, it is still
154159
// used as compression options for compression process.
155-
//
156-
// Default: false.
157-
bool enabled;
160+
bool enabled = false;
158161

159162
// Limit on data buffering when gathering samples to build a dictionary. Zero
160163
// means no limit. When dictionary is disabled (`max_dict_bytes == 0`),
@@ -173,9 +176,7 @@ struct CompressionOptions {
173176
// `zstd_max_train_bytes` (when enabled) can restrict how many samples we can
174177
// pass to the dictionary trainer. Configuring it below `max_dict_bytes` can
175178
// restrict the size of the final dictionary.
176-
//
177-
// Default: 0 (unlimited)
178-
uint64_t max_dict_buffer_bytes;
179+
uint64_t max_dict_buffer_bytes = 0;
179180

180181
// Use zstd trainer to generate dictionaries. When this option is set to true,
181182
// zstd_max_train_bytes of training data sampled from max_dict_buffer_bytes
@@ -187,34 +188,29 @@ struct CompressionOptions {
187188
// data will be passed to this API. Using this API should save CPU time on
188189
// dictionary training, but the compression ratio may not be as good as using
189190
// a dictionary trainer.
190-
//
191-
// Default: true
192-
bool use_zstd_dict_trainer;
193-
194-
CompressionOptions()
195-
: window_bits(-14),
196-
level(kDefaultCompressionLevel),
197-
strategy(0),
198-
max_dict_bytes(0),
199-
zstd_max_train_bytes(0),
200-
parallel_threads(1),
201-
enabled(false),
202-
max_dict_buffer_bytes(0),
203-
use_zstd_dict_trainer(true) {}
204-
CompressionOptions(int wbits, int _lev, int _strategy,
205-
uint32_t _max_dict_bytes, uint32_t _zstd_max_train_bytes,
206-
uint32_t _parallel_threads, bool _enabled,
207-
uint64_t _max_dict_buffer_bytes,
208-
bool _use_zstd_dict_trainer)
209-
: window_bits(wbits),
210-
level(_lev),
211-
strategy(_strategy),
212-
max_dict_bytes(_max_dict_bytes),
213-
zstd_max_train_bytes(_zstd_max_train_bytes),
214-
parallel_threads(_parallel_threads),
215-
enabled(_enabled),
216-
max_dict_buffer_bytes(_max_dict_buffer_bytes),
217-
use_zstd_dict_trainer(_use_zstd_dict_trainer) {}
191+
bool use_zstd_dict_trainer = true;
192+
193+
// ===> END options that can be set by deprecated configuration syntax <===
194+
// ===> Use compression_opts={level=6;strategy=7;} form for below opts <===
195+
196+
// Essentially specifies a minimum acceptable compression ratio. A block is
197+
// stored uncompressed if the compressed block does not achieve this ratio,
198+
// because the downstream cost of decompression is not considered worth such
199+
// a small savings (if any).
200+
// However, the ratio is specified in a way that is efficient for checking.
201+
// An integer from 1 to 1024 indicates the maximum allowable compressed bytes
202+
// per 1KB of input, so the minimum acceptable ratio is 1024.0 / this value.
203+
// For example, for a minimum ratio of 1.5:1, set to 683. See SetMinRatio().
204+
// Default: abandon use of compression for a specific block or entry if
205+
// compressed by less than 12.5% (minimum ratio of 1.143:1).
206+
int max_compressed_bytes_per_kb = 1024 * 7 / 8;
207+
208+
// A convenience function for setting max_compressed_bytes_per_kb based on a
209+
// minimum acceptable compression ratio (uncompressed size over compressed
210+
// size).
211+
void SetMinRatio(double min_ratio) {
212+
max_compressed_bytes_per_kb = static_cast<int>(1024.0 / min_ratio + 0.5);
213+
}
218214
};
219215

220216
// Temperature of a file. Used to pass to FileSystem for a different

include/rocksdb/statistics.h

+33-4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ enum Tickers : uint32_t {
201201
NUMBER_BLOCK_COMPRESSED,
202202
NUMBER_BLOCK_DECOMPRESSED,
203203

204+
// DEPRECATED / unused (see NUMBER_BLOCK_COMPRESSION_*)
204205
NUMBER_BLOCK_NOT_COMPRESSED,
205206
MERGE_OPERATION_TOTAL_TIME,
206207
FILTER_OPERATION_TOTAL_TIME,
@@ -435,6 +436,36 @@ enum Tickers : uint32_t {
435436
// # of times timestamps can successfully help skip the table access
436437
TIMESTAMP_FILTER_TABLE_FILTERED,
437438

439+
// Number of input bytes (uncompressed) to compression for SST blocks that
440+
// are stored compressed.
441+
BYTES_COMPRESSED_FROM,
442+
// Number of output bytes (compressed) from compression for SST blocks that
443+
// are stored compressed.
444+
BYTES_COMPRESSED_TO,
445+
// Number of uncompressed bytes for SST blocks that are stored uncompressed
446+
// because compression type is kNoCompression, or some error case caused
447+
// compression not to run or produce an output. Index blocks are only counted
448+
// if enable_index_compression is true.
449+
BYTES_COMPRESSION_BYPASSED,
450+
// Number of input bytes (uncompressed) to compression for SST blocks that
451+
// are stored uncompressed because the compression result was rejected,
452+
// either because the ratio was not acceptable (see
453+
// CompressionOptions::max_compressed_bytes_per_kb) or found invalid by the
454+
// `verify_compression` option.
455+
BYTES_COMPRESSION_REJECTED,
456+
457+
// Like BYTES_COMPRESSION_BYPASSED but counting number of blocks
458+
NUMBER_BLOCK_COMPRESSION_BYPASSED,
459+
// Like BYTES_COMPRESSION_REJECTED but counting number of blocks
460+
NUMBER_BLOCK_COMPRESSION_REJECTED,
461+
462+
// Number of input bytes (compressed) to decompression in reading compressed
463+
// SST blocks from storage.
464+
BYTES_DECOMPRESSED_FROM,
465+
// Number of output bytes (uncompressed) from decompression in reading
466+
// compressed SST blocks from storage.
467+
BYTES_DECOMPRESSED_TO,
468+
438469
TICKER_ENUM_MAX
439470
};
440471

@@ -486,10 +517,8 @@ enum Histograms : uint32_t {
486517
BYTES_PER_WRITE,
487518
BYTES_PER_MULTIGET,
488519

489-
// number of bytes compressed/decompressed
490-
// number of bytes is when uncompressed; i.e. before/after respectively
491-
BYTES_COMPRESSED,
492-
BYTES_DECOMPRESSED,
520+
BYTES_COMPRESSED, // DEPRECATED / unused (see BYTES_COMPRESSED_{FROM,TO})
521+
BYTES_DECOMPRESSED, // DEPRECATED / unused (see BYTES_DECOMPRESSED_{FROM,TO})
493522
COMPRESSION_TIMES_NANOS,
494523
DECOMPRESSION_TIMES_NANOS,
495524
// Number of merge operands passed to the merge operator in user read

monitoring/statistics.cc

+10
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ const std::vector<std::pair<Tickers, std::string>> TickersNameMap = {
222222
{TIMESTAMP_FILTER_TABLE_CHECKED, "rocksdb.timestamp.filter.table.checked"},
223223
{TIMESTAMP_FILTER_TABLE_FILTERED,
224224
"rocksdb.timestamp.filter.table.filtered"},
225+
{BYTES_COMPRESSED_FROM, "rocksdb.bytes.compressed.from"},
226+
{BYTES_COMPRESSED_TO, "rocksdb.bytes.compressed.to"},
227+
{BYTES_COMPRESSION_BYPASSED, "rocksdb.bytes.compression_bypassed"},
228+
{BYTES_COMPRESSION_REJECTED, "rocksdb.bytes.compression.rejected"},
229+
{NUMBER_BLOCK_COMPRESSION_BYPASSED,
230+
"rocksdb.number.block_compression_bypassed"},
231+
{NUMBER_BLOCK_COMPRESSION_REJECTED,
232+
"rocksdb.number.block_compression_rejected"},
233+
{BYTES_DECOMPRESSED_FROM, "rocksdb.bytes.decompressed.from"},
234+
{BYTES_DECOMPRESSED_TO, "rocksdb.bytes.decompressed.to"},
225235
};
226236

227237
const std::vector<std::pair<Histograms, std::string>> HistogramsNameMap = {

options/cf_options.cc

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ static std::unordered_map<std::string, OptionTypeInfo>
147147
{"strategy",
148148
{offsetof(struct CompressionOptions, strategy), OptionType::kInt,
149149
OptionVerificationType::kNormal, OptionTypeFlags::kMutable}},
150+
{"max_compressed_bytes_per_kb",
151+
{offsetof(struct CompressionOptions, max_compressed_bytes_per_kb),
152+
OptionType::kInt, OptionVerificationType::kNormal,
153+
OptionTypeFlags::kMutable}},
150154
{"max_dict_bytes",
151155
{offsetof(struct CompressionOptions, max_dict_bytes), OptionType::kInt,
152156
OptionVerificationType::kNormal, OptionTypeFlags::kMutable}},

options/options_settable_test.cc

+7-2
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,13 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) {
497497
"max_bytes_for_level_multiplier=60;"
498498
"memtable_factory=SkipListFactory;"
499499
"compression=kNoCompression;"
500-
"compression_opts=5:6:7:8:9:10:true:11:false;"
501-
"bottommost_compression_opts=4:5:6:7:8:9:true:10:true;"
500+
"compression_opts={max_dict_buffer_bytes=5;use_zstd_dict_trainer=true;"
501+
"enabled=false;parallel_threads=6;zstd_max_train_bytes=7;strategy=8;max_"
502+
"dict_bytes=9;level=10;window_bits=11;max_compressed_bytes_per_kb=987;};"
503+
"bottommost_compression_opts={max_dict_buffer_bytes=4;use_zstd_dict_"
504+
"trainer=true;enabled=true;parallel_threads=5;zstd_max_train_bytes=6;"
505+
"strategy=7;max_dict_bytes=8;level=9;window_bits=10;max_compressed_bytes_"
506+
"per_kb=876;};"
502507
"bottommost_compression=kDisableCompressionOption;"
503508
"level0_stop_writes_trigger=33;"
504509
"num_levels=99;"

0 commit comments

Comments
 (0)