db_options.cc 42.8 KB
Newer Older
1
// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
S
Siying Dong 已提交
2 3 4
//  This source code is licensed under both the GPLv2 (found in the
//  COPYING file in the root directory) and Apache 2.0 License
//  (found in the LICENSE.Apache file in the root directory).
5

6
#include "options/db_options.h"
7

8
#include <cinttypes>
9

10
#include "logging/logging.h"
11
#include "options/configurable_helper.h"
12
#include "options/options_helper.h"
13
#include "options/options_parser.h"
14
#include "port/port.h"
15
#include "rocksdb/configurable.h"
16
#include "rocksdb/env.h"
17
#include "rocksdb/file_system.h"
18
#include "rocksdb/rate_limiter.h"
19
#include "rocksdb/sst_file_manager.h"
20
#include "rocksdb/system_clock.h"
21
#include "rocksdb/utilities/options_type.h"
22
#include "rocksdb/wal_filter.h"
23
#include "util/string_util.h"
24

25
namespace ROCKSDB_NAMESPACE {
26
#ifndef ROCKSDB_LITE
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
static std::unordered_map<std::string, WALRecoveryMode>
    wal_recovery_mode_string_map = {
        {"kTolerateCorruptedTailRecords",
         WALRecoveryMode::kTolerateCorruptedTailRecords},
        {"kAbsoluteConsistency", WALRecoveryMode::kAbsoluteConsistency},
        {"kPointInTimeRecovery", WALRecoveryMode::kPointInTimeRecovery},
        {"kSkipAnyCorruptedRecords",
         WALRecoveryMode::kSkipAnyCorruptedRecords}};

static std::unordered_map<std::string, DBOptions::AccessHint>
    access_hint_string_map = {{"NONE", DBOptions::AccessHint::NONE},
                              {"NORMAL", DBOptions::AccessHint::NORMAL},
                              {"SEQUENTIAL", DBOptions::AccessHint::SEQUENTIAL},
                              {"WILLNEED", DBOptions::AccessHint::WILLNEED}};

static std::unordered_map<std::string, InfoLogLevel> info_log_level_string_map =
    {{"DEBUG_LEVEL", InfoLogLevel::DEBUG_LEVEL},
     {"INFO_LEVEL", InfoLogLevel::INFO_LEVEL},
     {"WARN_LEVEL", InfoLogLevel::WARN_LEVEL},
     {"ERROR_LEVEL", InfoLogLevel::ERROR_LEVEL},
     {"FATAL_LEVEL", InfoLogLevel::FATAL_LEVEL},
     {"HEADER_LEVEL", InfoLogLevel::HEADER_LEVEL}};

50 51 52 53 54
static std::unordered_map<std::string, MemPurgePolicy>
    experimental_mempurge_policy_string_map = {
        {"kAlternate", MemPurgePolicy::kAlternate},
        {"kAlways", MemPurgePolicy::kAlways}};

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
static std::unordered_map<std::string, OptionTypeInfo>
    db_mutable_options_type_info = {
        {"allow_os_buffer",
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
          OptionTypeFlags::kMutable}},
        {"max_background_jobs",
         {offsetof(struct MutableDBOptions, max_background_jobs),
          OptionType::kInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"max_background_compactions",
         {offsetof(struct MutableDBOptions, max_background_compactions),
          OptionType::kInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"base_background_compactions",
         {offsetof(struct MutableDBOptions, base_background_compactions),
          OptionType::kInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"max_subcompactions",
         {offsetof(struct MutableDBOptions, max_subcompactions),
          OptionType::kUInt32T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"avoid_flush_during_shutdown",
         {offsetof(struct MutableDBOptions, avoid_flush_during_shutdown),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"writable_file_max_buffer_size",
         {offsetof(struct MutableDBOptions, writable_file_max_buffer_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"delayed_write_rate",
         {offsetof(struct MutableDBOptions, delayed_write_rate),
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"max_total_wal_size",
         {offsetof(struct MutableDBOptions, max_total_wal_size),
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"delete_obsolete_files_period_micros",
         {offsetof(struct MutableDBOptions,
                   delete_obsolete_files_period_micros),
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"stats_dump_period_sec",
         {offsetof(struct MutableDBOptions, stats_dump_period_sec),
          OptionType::kUInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"stats_persist_period_sec",
         {offsetof(struct MutableDBOptions, stats_persist_period_sec),
          OptionType::kUInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"stats_history_buffer_size",
         {offsetof(struct MutableDBOptions, stats_history_buffer_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"max_open_files",
         {offsetof(struct MutableDBOptions, max_open_files), OptionType::kInt,
          OptionVerificationType::kNormal, OptionTypeFlags::kMutable}},
        {"bytes_per_sync",
         {offsetof(struct MutableDBOptions, bytes_per_sync),
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"wal_bytes_per_sync",
         {offsetof(struct MutableDBOptions, wal_bytes_per_sync),
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"strict_bytes_per_sync",
         {offsetof(struct MutableDBOptions, strict_bytes_per_sync),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"compaction_readahead_size",
         {offsetof(struct MutableDBOptions, compaction_readahead_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
        {"max_background_flushes",
         {offsetof(struct MutableDBOptions, max_background_flushes),
          OptionType::kInt, OptionVerificationType::kNormal,
          OptionTypeFlags::kMutable}},
};

static std::unordered_map<std::string, OptionTypeInfo>
    db_immutable_options_type_info = {
136 137 138 139 140 141 142 143 144
        /*
         // not yet supported
          std::shared_ptr<Cache> row_cache;
          std::shared_ptr<DeleteScheduler> delete_scheduler;
          std::shared_ptr<Logger> info_log;
          std::shared_ptr<RateLimiter> rate_limiter;
          std::shared_ptr<Statistics> statistics;
          std::vector<DbPath> db_paths;
          std::vector<std::shared_ptr<EventListener>> listeners;
145
          FileTypeSet checksum_handoff_file_types;
146 147
         */
        {"advise_random_on_open",
148
         {offsetof(struct ImmutableDBOptions, advise_random_on_open),
149
          OptionType::kBoolean, OptionVerificationType::kNormal,
150
          OptionTypeFlags::kNone}},
151
        {"allow_mmap_reads",
152 153 154
         {offsetof(struct ImmutableDBOptions, allow_mmap_reads),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
155
        {"allow_fallocate",
156 157 158
         {offsetof(struct ImmutableDBOptions, allow_fallocate),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
159
        {"allow_mmap_writes",
160 161 162
         {offsetof(struct ImmutableDBOptions, allow_mmap_writes),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
163
        {"use_direct_reads",
164 165 166
         {offsetof(struct ImmutableDBOptions, use_direct_reads),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
167 168
        {"use_direct_writes",
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
169
          OptionTypeFlags::kNone}},
170
        {"use_direct_io_for_flush_and_compaction",
171 172
         {offsetof(struct ImmutableDBOptions,
                   use_direct_io_for_flush_and_compaction),
173
          OptionType::kBoolean, OptionVerificationType::kNormal,
174
          OptionTypeFlags::kNone}},
175
        {"allow_2pc",
176 177
         {offsetof(struct ImmutableDBOptions, allow_2pc), OptionType::kBoolean,
          OptionVerificationType::kNormal, OptionTypeFlags::kNone}},
178
        {"create_if_missing",
179 180 181
         {offsetof(struct ImmutableDBOptions, create_if_missing),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
182
        {"create_missing_column_families",
183
         {offsetof(struct ImmutableDBOptions, create_missing_column_families),
184
          OptionType::kBoolean, OptionVerificationType::kNormal,
185
          OptionTypeFlags::kNone}},
186 187
        {"disableDataSync",
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
188
          OptionTypeFlags::kNone}},
189 190
        {"disable_data_sync",  // for compatibility
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
191
          OptionTypeFlags::kNone}},
192
        {"enable_thread_tracking",
193
         {offsetof(struct ImmutableDBOptions, enable_thread_tracking),
194
          OptionType::kBoolean, OptionVerificationType::kNormal,
195
          OptionTypeFlags::kNone}},
196
        {"error_if_exists",
197 198 199
         {offsetof(struct ImmutableDBOptions, error_if_exists),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
200 201 202 203
        {"experimental_allow_mempurge",
         {offsetof(struct ImmutableDBOptions, experimental_allow_mempurge),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
204 205 206 207
        {"experimental_mempurge_policy",
         OptionTypeInfo::Enum<MemPurgePolicy>(
             offsetof(struct ImmutableDBOptions, experimental_mempurge_policy),
             &experimental_mempurge_policy_string_map)},
208
        {"is_fd_close_on_exec",
209 210 211
         {offsetof(struct ImmutableDBOptions, is_fd_close_on_exec),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
212
        {"paranoid_checks",
213
         {offsetof(struct ImmutableDBOptions, paranoid_checks),
214
          OptionType::kBoolean, OptionVerificationType::kNormal,
215
          OptionTypeFlags::kNone}},
216 217 218 219
        {"flush_verify_memtable_count",
         {offsetof(struct ImmutableDBOptions, flush_verify_memtable_count),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
220 221 222 223 224
        {"track_and_verify_wals_in_manifest",
         {offsetof(struct ImmutableDBOptions,
                   track_and_verify_wals_in_manifest),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
225 226 227
        {"skip_log_error_on_recovery",
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
          OptionTypeFlags::kNone}},
228
        {"skip_stats_update_on_db_open",
229
         {offsetof(struct ImmutableDBOptions, skip_stats_update_on_db_open),
230
          OptionType::kBoolean, OptionVerificationType::kNormal,
231
          OptionTypeFlags::kNone}},
232
        {"skip_checking_sst_file_sizes_on_db_open",
233 234
         {offsetof(struct ImmutableDBOptions,
                   skip_checking_sst_file_sizes_on_db_open),
235
          OptionType::kBoolean, OptionVerificationType::kNormal,
236
          OptionTypeFlags::kNone}},
237
        {"new_table_reader_for_compaction_inputs",
238 239
         {offsetof(struct ImmutableDBOptions,
                   new_table_reader_for_compaction_inputs),
240
          OptionType::kBoolean, OptionVerificationType::kNormal,
241
          OptionTypeFlags::kNone}},
242
        {"random_access_max_buffer_size",
243
         {offsetof(struct ImmutableDBOptions, random_access_max_buffer_size),
244
          OptionType::kSizeT, OptionVerificationType::kNormal,
245
          OptionTypeFlags::kNone}},
246
        {"use_adaptive_mutex",
247 248 249
         {offsetof(struct ImmutableDBOptions, use_adaptive_mutex),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
250
        {"use_fsync",
251 252
         {offsetof(struct ImmutableDBOptions, use_fsync), OptionType::kBoolean,
          OptionVerificationType::kNormal, OptionTypeFlags::kNone}},
253
        {"max_file_opening_threads",
254
         {offsetof(struct ImmutableDBOptions, max_file_opening_threads),
255
          OptionType::kInt, OptionVerificationType::kNormal,
256
          OptionTypeFlags::kNone}},
257
        {"table_cache_numshardbits",
258
         {offsetof(struct ImmutableDBOptions, table_cache_numshardbits),
259
          OptionType::kInt, OptionVerificationType::kNormal,
260
          OptionTypeFlags::kNone}},
261
        {"db_write_buffer_size",
262 263 264
         {offsetof(struct ImmutableDBOptions, db_write_buffer_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
265
        {"keep_log_file_num",
266 267 268
         {offsetof(struct ImmutableDBOptions, keep_log_file_num),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
269
        {"recycle_log_file_num",
270 271 272
         {offsetof(struct ImmutableDBOptions, recycle_log_file_num),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
273
        {"log_file_time_to_roll",
274 275 276
         {offsetof(struct ImmutableDBOptions, log_file_time_to_roll),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
277
        {"manifest_preallocation_size",
278
         {offsetof(struct ImmutableDBOptions, manifest_preallocation_size),
279
          OptionType::kSizeT, OptionVerificationType::kNormal,
280
          OptionTypeFlags::kNone}},
281
        {"max_log_file_size",
282 283 284
         {offsetof(struct ImmutableDBOptions, max_log_file_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
285
        {"db_log_dir",
286 287
         {offsetof(struct ImmutableDBOptions, db_log_dir), OptionType::kString,
          OptionVerificationType::kNormal, OptionTypeFlags::kNone}},
288
        {"wal_dir",
289 290
         {offsetof(struct ImmutableDBOptions, wal_dir), OptionType::kString,
          OptionVerificationType::kNormal, OptionTypeFlags::kNone}},
291
        {"WAL_size_limit_MB",
292
         {offsetof(struct ImmutableDBOptions, WAL_size_limit_MB),
293 294
          OptionType::kUInt64T, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
295
        {"WAL_ttl_seconds",
296
         {offsetof(struct ImmutableDBOptions, WAL_ttl_seconds),
297
          OptionType::kUInt64T, OptionVerificationType::kNormal,
298
          OptionTypeFlags::kNone}},
299
        {"max_manifest_file_size",
300
         {offsetof(struct ImmutableDBOptions, max_manifest_file_size),
301
          OptionType::kUInt64T, OptionVerificationType::kNormal,
302
          OptionTypeFlags::kNone}},
303
        {"persist_stats_to_disk",
304
         {offsetof(struct ImmutableDBOptions, persist_stats_to_disk),
305
          OptionType::kBoolean, OptionVerificationType::kNormal,
306
          OptionTypeFlags::kNone}},
307
        {"fail_if_options_file_error",
308
         {offsetof(struct ImmutableDBOptions, fail_if_options_file_error),
309
          OptionType::kBoolean, OptionVerificationType::kNormal,
310
          OptionTypeFlags::kNone}},
311
        {"enable_pipelined_write",
312
         {offsetof(struct ImmutableDBOptions, enable_pipelined_write),
313
          OptionType::kBoolean, OptionVerificationType::kNormal,
314
          OptionTypeFlags::kNone}},
315
        {"unordered_write",
316 317 318
         {offsetof(struct ImmutableDBOptions, unordered_write),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
319
        {"allow_concurrent_memtable_write",
320
         {offsetof(struct ImmutableDBOptions, allow_concurrent_memtable_write),
321
          OptionType::kBoolean, OptionVerificationType::kNormal,
322 323 324 325 326
          OptionTypeFlags::kNone}},
        {"wal_recovery_mode",
         OptionTypeInfo::Enum<WALRecoveryMode>(
             offsetof(struct ImmutableDBOptions, wal_recovery_mode),
             &wal_recovery_mode_string_map)},
327
        {"enable_write_thread_adaptive_yield",
328 329
         {offsetof(struct ImmutableDBOptions,
                   enable_write_thread_adaptive_yield),
330
          OptionType::kBoolean, OptionVerificationType::kNormal,
331
          OptionTypeFlags::kNone}},
332
        {"write_thread_slow_yield_usec",
333
         {offsetof(struct ImmutableDBOptions, write_thread_slow_yield_usec),
334
          OptionType::kUInt64T, OptionVerificationType::kNormal,
335
          OptionTypeFlags::kNone}},
336
        {"max_write_batch_group_size_bytes",
337
         {offsetof(struct ImmutableDBOptions, max_write_batch_group_size_bytes),
338
          OptionType::kUInt64T, OptionVerificationType::kNormal,
339
          OptionTypeFlags::kNone}},
340
        {"write_thread_max_yield_usec",
341
         {offsetof(struct ImmutableDBOptions, write_thread_max_yield_usec),
342
          OptionType::kUInt64T, OptionVerificationType::kNormal,
343
          OptionTypeFlags::kNone}},
344
        {"access_hint_on_compaction_start",
345
         OptionTypeInfo::Enum<DBOptions::AccessHint>(
346 347
             offsetof(struct ImmutableDBOptions,
                      access_hint_on_compaction_start),
348
             &access_hint_string_map)},
349 350 351 352
        {"info_log_level",
         OptionTypeInfo::Enum<InfoLogLevel>(
             offsetof(struct ImmutableDBOptions, info_log_level),
             &info_log_level_string_map)},
353
        {"dump_malloc_stats",
354
         {offsetof(struct ImmutableDBOptions, dump_malloc_stats),
355
          OptionType::kBoolean, OptionVerificationType::kNormal,
356 357 358
          OptionTypeFlags::kNone}},
        {"avoid_flush_during_recovery",
         {offsetof(struct ImmutableDBOptions, avoid_flush_during_recovery),
359
          OptionType::kBoolean, OptionVerificationType::kNormal,
360
          OptionTypeFlags::kNone}},
361
        {"allow_ingest_behind",
362 363 364
         {offsetof(struct ImmutableDBOptions, allow_ingest_behind),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
365
        {"preserve_deletes",
366 367 368
         {offsetof(struct ImmutableDBOptions, preserve_deletes),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
369 370
        {"concurrent_prepare",  // Deprecated by two_write_queues
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
371
          OptionTypeFlags::kNone}},
372
        {"two_write_queues",
373 374 375
         {offsetof(struct ImmutableDBOptions, two_write_queues),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
376
        {"manual_wal_flush",
377 378 379
         {offsetof(struct ImmutableDBOptions, manual_wal_flush),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
380 381
        {"seq_per_batch",
         {0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
382
          OptionTypeFlags::kNone}},
383
        {"atomic_flush",
384 385 386
         {offsetof(struct ImmutableDBOptions, atomic_flush),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
387
        {"avoid_unnecessary_blocking_io",
388
         {offsetof(struct ImmutableDBOptions, avoid_unnecessary_blocking_io),
389
          OptionType::kBoolean, OptionVerificationType::kNormal,
390
          OptionTypeFlags::kNone}},
391
        {"write_dbid_to_manifest",
392
         {offsetof(struct ImmutableDBOptions, write_dbid_to_manifest),
393
          OptionType::kBoolean, OptionVerificationType::kNormal,
394
          OptionTypeFlags::kNone}},
395
        {"log_readahead_size",
396 397 398
         {offsetof(struct ImmutableDBOptions, log_readahead_size),
          OptionType::kSizeT, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
399
        {"best_efforts_recovery",
400
         {offsetof(struct ImmutableDBOptions, best_efforts_recovery),
401
          OptionType::kBoolean, OptionVerificationType::kNormal,
402
          OptionTypeFlags::kNone}},
403
        {"max_bgerror_resume_count",
404
         {offsetof(struct ImmutableDBOptions, max_bgerror_resume_count),
405
          OptionType::kInt, OptionVerificationType::kNormal,
406
          OptionTypeFlags::kNone}},
407
        {"bgerror_resume_retry_interval",
408
         {offsetof(struct ImmutableDBOptions, bgerror_resume_retry_interval),
409
          OptionType::kUInt64T, OptionVerificationType::kNormal,
410
          OptionTypeFlags::kNone}},
411 412 413
        {"db_host_id",
         {offsetof(struct ImmutableDBOptions, db_host_id), OptionType::kString,
          OptionVerificationType::kNormal, OptionTypeFlags::kCompareNever}},
414 415 416 417
        // The following properties were handled as special cases in ParseOption
        // This means that the properties could be read from the options file
        // but never written to the file or compared to each other.
        {"rate_limiter_bytes_per_sec",
418 419 420
         {offsetof(struct ImmutableDBOptions, rate_limiter),
          OptionType::kUnknown, OptionVerificationType::kNormal,
          (OptionTypeFlags::kDontSerialize | OptionTypeFlags::kCompareNever),
421 422
          // Parse the input value as a RateLimiter
          [](const ConfigOptions& /*opts*/, const std::string& /*name*/,
423 424
             const std::string& value, void* addr) {
            auto limiter = static_cast<std::shared_ptr<RateLimiter>*>(addr);
425 426 427 428 429
            limiter->reset(NewGenericRateLimiter(
                static_cast<int64_t>(ParseUint64(value))));
            return Status::OK();
          }}},
        {"env",
430
         {offsetof(struct ImmutableDBOptions, env), OptionType::kUnknown,
431
          OptionVerificationType::kNormal,
432
          (OptionTypeFlags::kDontSerialize | OptionTypeFlags::kCompareNever),
433
          // Parse the input value as an Env
434
          [](const ConfigOptions& opts, const std::string& /*name*/,
435 436
             const std::string& value, void* addr) {
            auto old_env = static_cast<Env**>(addr);       // Get the old value
437
            Env* new_env = *old_env;                       // Set new to old
438 439
            Status s = Env::CreateFromString(opts, value,
                                             &new_env);    // Update new value
440 441 442 443 444
            if (s.ok()) {                                  // It worked
              *old_env = new_env;                          // Update the old one
            }
            return s;
          }}},
445 446 447 448
        {"allow_data_in_errors",
         {offsetof(struct ImmutableDBOptions, allow_data_in_errors),
          OptionType::kBoolean, OptionVerificationType::kNormal,
          OptionTypeFlags::kNone}},
449
};
450 451 452 453 454

const std::string OptionsHelper::kDBOptionsName = "DBOptions";

class MutableDBConfigurable : public Configurable {
 public:
455
  explicit MutableDBConfigurable(const MutableDBOptions& mdb) {
456
    mutable_ = mdb;
457
    RegisterOptions(&mutable_, &db_mutable_options_type_info);
458 459 460 461 462 463 464 465
  }

 protected:
  MutableDBOptions mutable_;
};

class DBOptionsConfigurable : public MutableDBConfigurable {
 public:
466
  explicit DBOptionsConfigurable(const DBOptions& opts)
467 468 469 470 471 472 473 474 475 476
      : MutableDBConfigurable(MutableDBOptions(opts)), db_options_(opts) {
    // The ImmutableDBOptions currently requires the env to be non-null.  Make
    // sure it is
    if (opts.env != nullptr) {
      immutable_ = ImmutableDBOptions(opts);
    } else {
      DBOptions copy = opts;
      copy.env = Env::Default();
      immutable_ = ImmutableDBOptions(copy);
    }
477
    RegisterOptions(&immutable_, &db_immutable_options_type_info);
478 479 480 481 482 483 484
  }

 protected:
  Status ConfigureOptions(
      const ConfigOptions& config_options,
      const std::unordered_map<std::string, std::string>& opts_map,
      std::unordered_map<std::string, std::string>* unused) override {
485
    Status s = Configurable::ConfigureOptions(config_options, opts_map, unused);
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
    if (s.ok()) {
      db_options_ = BuildDBOptions(immutable_, mutable_);
      s = PrepareOptions(config_options);
    }
    return s;
  }

  const void* GetOptionsPtr(const std::string& name) const override {
    if (name == OptionsHelper::kDBOptionsName) {
      return &db_options_;
    } else {
      return MutableDBConfigurable::GetOptionsPtr(name);
    }
  }

 private:
  ImmutableDBOptions immutable_;
  DBOptions db_options_;
};

std::unique_ptr<Configurable> DBOptionsAsConfigurable(
    const MutableDBOptions& opts) {
  std::unique_ptr<Configurable> ptr(new MutableDBConfigurable(opts));
  return ptr;
}
std::unique_ptr<Configurable> DBOptionsAsConfigurable(const DBOptions& opts) {
  std::unique_ptr<Configurable> ptr(new DBOptionsConfigurable(opts));
  return ptr;
}
515
#endif  // ROCKSDB_LITE
516 517 518 519 520 521 522 523

ImmutableDBOptions::ImmutableDBOptions() : ImmutableDBOptions(Options()) {}

ImmutableDBOptions::ImmutableDBOptions(const DBOptions& options)
    : create_if_missing(options.create_if_missing),
      create_missing_column_families(options.create_missing_column_families),
      error_if_exists(options.error_if_exists),
      paranoid_checks(options.paranoid_checks),
524
      flush_verify_memtable_count(options.flush_verify_memtable_count),
525 526
      track_and_verify_wals_in_manifest(
          options.track_and_verify_wals_in_manifest),
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
      env(options.env),
      rate_limiter(options.rate_limiter),
      sst_file_manager(options.sst_file_manager),
      info_log(options.info_log),
      info_log_level(options.info_log_level),
      max_file_opening_threads(options.max_file_opening_threads),
      statistics(options.statistics),
      use_fsync(options.use_fsync),
      db_paths(options.db_paths),
      db_log_dir(options.db_log_dir),
      wal_dir(options.wal_dir),
      max_log_file_size(options.max_log_file_size),
      log_file_time_to_roll(options.log_file_time_to_roll),
      keep_log_file_num(options.keep_log_file_num),
      recycle_log_file_num(options.recycle_log_file_num),
      max_manifest_file_size(options.max_manifest_file_size),
      table_cache_numshardbits(options.table_cache_numshardbits),
544 545
      WAL_ttl_seconds(options.WAL_ttl_seconds),
      WAL_size_limit_MB(options.WAL_size_limit_MB),
546 547
      max_write_batch_group_size_bytes(
          options.max_write_batch_group_size_bytes),
548 549 550
      manifest_preallocation_size(options.manifest_preallocation_size),
      allow_mmap_reads(options.allow_mmap_reads),
      allow_mmap_writes(options.allow_mmap_writes),
551
      use_direct_reads(options.use_direct_reads),
552 553
      use_direct_io_for_flush_and_compaction(
          options.use_direct_io_for_flush_and_compaction),
554 555 556
      allow_fallocate(options.allow_fallocate),
      is_fd_close_on_exec(options.is_fd_close_on_exec),
      advise_random_on_open(options.advise_random_on_open),
557
      experimental_allow_mempurge(options.experimental_allow_mempurge),
558
      experimental_mempurge_policy(options.experimental_mempurge_policy),
559 560 561 562 563 564 565 566 567
      db_write_buffer_size(options.db_write_buffer_size),
      write_buffer_manager(options.write_buffer_manager),
      access_hint_on_compaction_start(options.access_hint_on_compaction_start),
      new_table_reader_for_compaction_inputs(
          options.new_table_reader_for_compaction_inputs),
      random_access_max_buffer_size(options.random_access_max_buffer_size),
      use_adaptive_mutex(options.use_adaptive_mutex),
      listeners(options.listeners),
      enable_thread_tracking(options.enable_thread_tracking),
568
      enable_pipelined_write(options.enable_pipelined_write),
M
Maysam Yabandeh 已提交
569
      unordered_write(options.unordered_write),
570 571 572 573 574 575
      allow_concurrent_memtable_write(options.allow_concurrent_memtable_write),
      enable_write_thread_adaptive_yield(
          options.enable_write_thread_adaptive_yield),
      write_thread_max_yield_usec(options.write_thread_max_yield_usec),
      write_thread_slow_yield_usec(options.write_thread_slow_yield_usec),
      skip_stats_update_on_db_open(options.skip_stats_update_on_db_open),
576 577
      skip_checking_sst_file_sizes_on_db_open(
          options.skip_checking_sst_file_sizes_on_db_open),
578 579 580 581 582 583 584 585
      wal_recovery_mode(options.wal_recovery_mode),
      allow_2pc(options.allow_2pc),
      row_cache(options.row_cache),
#ifndef ROCKSDB_LITE
      wal_filter(options.wal_filter),
#endif  // ROCKSDB_LITE
      fail_if_options_file_error(options.fail_if_options_file_error),
      dump_malloc_stats(options.dump_malloc_stats),
586
      avoid_flush_during_recovery(options.avoid_flush_during_recovery),
587
      allow_ingest_behind(options.allow_ingest_behind),
588
      preserve_deletes(options.preserve_deletes),
589
      two_write_queues(options.two_write_queues),
590
      manual_wal_flush(options.manual_wal_flush),
591
      atomic_flush(options.atomic_flush),
592
      avoid_unnecessary_blocking_io(options.avoid_unnecessary_blocking_io),
593
      persist_stats_to_disk(options.persist_stats_to_disk),
594
      write_dbid_to_manifest(options.write_dbid_to_manifest),
595
      log_readahead_size(options.log_readahead_size),
596
      file_checksum_gen_factory(options.file_checksum_gen_factory),
597 598
      best_efforts_recovery(options.best_efforts_recovery),
      max_bgerror_resume_count(options.max_bgerror_resume_count),
599
      bgerror_resume_retry_interval(options.bgerror_resume_retry_interval),
600
      allow_data_in_errors(options.allow_data_in_errors),
601
      db_host_id(options.db_host_id),
602 603
      checksum_handoff_file_types(options.checksum_handoff_file_types),
      compaction_service(options.compaction_service) {
604
  stats = statistics.get();
605
  fs = env->GetFileSystem();
606 607 608 609 610
  if (env != nullptr) {
    clock = env->GetSystemClock().get();
  } else {
    clock = SystemClock::Default().get();
  }
611 612
  logger = info_log.get();
  stats = statistics.get();
613 614 615
}

void ImmutableDBOptions::Dump(Logger* log) const {
616 617 618 619 620 621
  ROCKS_LOG_HEADER(log, "                        Options.error_if_exists: %d",
                   error_if_exists);
  ROCKS_LOG_HEADER(log, "                      Options.create_if_missing: %d",
                   create_if_missing);
  ROCKS_LOG_HEADER(log, "                        Options.paranoid_checks: %d",
                   paranoid_checks);
622 623
  ROCKS_LOG_HEADER(log, "            Options.flush_verify_memtable_count: %d",
                   flush_verify_memtable_count);
624 625 626 627
  ROCKS_LOG_HEADER(log,
                   "                              "
                   "Options.track_and_verify_wals_in_manifest: %d",
                   track_and_verify_wals_in_manifest);
628 629
  ROCKS_LOG_HEADER(log, "                                    Options.env: %p",
                   env);
630 631
  ROCKS_LOG_HEADER(log, "                                     Options.fs: %s",
                   fs->Name());
632 633 634 635
  ROCKS_LOG_HEADER(log, "                               Options.info_log: %p",
                   info_log.get());
  ROCKS_LOG_HEADER(log, "               Options.max_file_opening_threads: %d",
                   max_file_opening_threads);
636
  ROCKS_LOG_HEADER(log, "                             Options.statistics: %p",
637
                   stats);
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
  ROCKS_LOG_HEADER(log, "                              Options.use_fsync: %d",
                   use_fsync);
  ROCKS_LOG_HEADER(
      log, "                      Options.max_log_file_size: %" ROCKSDB_PRIszt,
      max_log_file_size);
  ROCKS_LOG_HEADER(log,
                   "                 Options.max_manifest_file_size: %" PRIu64,
                   max_manifest_file_size);
  ROCKS_LOG_HEADER(
      log, "                  Options.log_file_time_to_roll: %" ROCKSDB_PRIszt,
      log_file_time_to_roll);
  ROCKS_LOG_HEADER(
      log, "                      Options.keep_log_file_num: %" ROCKSDB_PRIszt,
      keep_log_file_num);
  ROCKS_LOG_HEADER(
      log, "                   Options.recycle_log_file_num: %" ROCKSDB_PRIszt,
      recycle_log_file_num);
  ROCKS_LOG_HEADER(log, "                        Options.allow_fallocate: %d",
                   allow_fallocate);
  ROCKS_LOG_HEADER(log, "                       Options.allow_mmap_reads: %d",
                   allow_mmap_reads);
  ROCKS_LOG_HEADER(log, "                      Options.allow_mmap_writes: %d",
                   allow_mmap_writes);
  ROCKS_LOG_HEADER(log, "                       Options.use_direct_reads: %d",
                   use_direct_reads);
663 664 665 666
  ROCKS_LOG_HEADER(log,
                   "                       "
                   "Options.use_direct_io_for_flush_and_compaction: %d",
                   use_direct_io_for_flush_and_compaction);
667 668 669 670 671 672 673 674 675 676
  ROCKS_LOG_HEADER(log, "         Options.create_missing_column_families: %d",
                   create_missing_column_families);
  ROCKS_LOG_HEADER(log, "                             Options.db_log_dir: %s",
                   db_log_dir.c_str());
  ROCKS_LOG_HEADER(log, "                                Options.wal_dir: %s",
                   wal_dir.c_str());
  ROCKS_LOG_HEADER(log, "               Options.table_cache_numshardbits: %d",
                   table_cache_numshardbits);
  ROCKS_LOG_HEADER(log,
                   "                        Options.WAL_ttl_seconds: %" PRIu64,
677
                   WAL_ttl_seconds);
678 679
  ROCKS_LOG_HEADER(log,
                   "                      Options.WAL_size_limit_MB: %" PRIu64,
680
                   WAL_size_limit_MB);
681 682 683 684
  ROCKS_LOG_HEADER(log,
                   "                       "
                   "Options.max_write_batch_group_size_bytes: %" PRIu64,
                   max_write_batch_group_size_bytes);
685 686 687 688 689 690 691
  ROCKS_LOG_HEADER(
      log, "            Options.manifest_preallocation_size: %" ROCKSDB_PRIszt,
      manifest_preallocation_size);
  ROCKS_LOG_HEADER(log, "                    Options.is_fd_close_on_exec: %d",
                   is_fd_close_on_exec);
  ROCKS_LOG_HEADER(log, "                  Options.advise_random_on_open: %d",
                   advise_random_on_open);
692 693 694
  ROCKS_LOG_HEADER(log,
                   "                  Options.experimental_allow_mempurge: %d",
                   experimental_allow_mempurge);
695 696 697
  ROCKS_LOG_HEADER(log,
                   "                  Options.experimental_mempurge_policy: %d",
                   static_cast<int>(experimental_mempurge_policy));
698 699 700
  ROCKS_LOG_HEADER(
      log, "                   Options.db_write_buffer_size: %" ROCKSDB_PRIszt,
      db_write_buffer_size);
701 702
  ROCKS_LOG_HEADER(log, "                   Options.write_buffer_manager: %p",
                   write_buffer_manager.get());
703 704 705 706 707 708 709 710 711 712 713
  ROCKS_LOG_HEADER(log, "        Options.access_hint_on_compaction_start: %d",
                   static_cast<int>(access_hint_on_compaction_start));
  ROCKS_LOG_HEADER(log, " Options.new_table_reader_for_compaction_inputs: %d",
                   new_table_reader_for_compaction_inputs);
  ROCKS_LOG_HEADER(
      log, "          Options.random_access_max_buffer_size: %" ROCKSDB_PRIszt,
      random_access_max_buffer_size);
  ROCKS_LOG_HEADER(log, "                     Options.use_adaptive_mutex: %d",
                   use_adaptive_mutex);
  ROCKS_LOG_HEADER(log, "                           Options.rate_limiter: %p",
                   rate_limiter.get());
714 715 716
  Header(
      log, "    Options.sst_file_manager.rate_bytes_per_sec: %" PRIi64,
      sst_file_manager ? sst_file_manager->GetDeleteRateBytesPerSecond() : 0);
717
  ROCKS_LOG_HEADER(log, "                      Options.wal_recovery_mode: %d",
718
                   static_cast<int>(wal_recovery_mode));
719 720
  ROCKS_LOG_HEADER(log, "                 Options.enable_thread_tracking: %d",
                   enable_thread_tracking);
721 722
  ROCKS_LOG_HEADER(log, "                 Options.enable_pipelined_write: %d",
                   enable_pipelined_write);
M
Maysam Yabandeh 已提交
723 724
  ROCKS_LOG_HEADER(log, "                 Options.unordered_write: %d",
                   unordered_write);
725 726 727 728 729 730 731 732 733 734
  ROCKS_LOG_HEADER(log, "        Options.allow_concurrent_memtable_write: %d",
                   allow_concurrent_memtable_write);
  ROCKS_LOG_HEADER(log, "     Options.enable_write_thread_adaptive_yield: %d",
                   enable_write_thread_adaptive_yield);
  ROCKS_LOG_HEADER(log,
                   "            Options.write_thread_max_yield_usec: %" PRIu64,
                   write_thread_max_yield_usec);
  ROCKS_LOG_HEADER(log,
                   "           Options.write_thread_slow_yield_usec: %" PRIu64,
                   write_thread_slow_yield_usec);
735
  if (row_cache) {
736
    ROCKS_LOG_HEADER(
737 738
        log,
        "                              Options.row_cache: %" ROCKSDB_PRIszt,
739
        row_cache->GetCapacity());
740
  } else {
741 742
    ROCKS_LOG_HEADER(log,
                     "                              Options.row_cache: None");
743 744
  }
#ifndef ROCKSDB_LITE
745 746
  ROCKS_LOG_HEADER(log, "                             Options.wal_filter: %s",
                   wal_filter ? wal_filter->Name() : "None");
747
#endif  // ROCKDB_LITE
748

749 750
  ROCKS_LOG_HEADER(log, "            Options.avoid_flush_during_recovery: %d",
                   avoid_flush_during_recovery);
751 752
  ROCKS_LOG_HEADER(log, "            Options.allow_ingest_behind: %d",
                   allow_ingest_behind);
753 754
  ROCKS_LOG_HEADER(log, "            Options.preserve_deletes: %d",
                   preserve_deletes);
755 756
  ROCKS_LOG_HEADER(log, "            Options.two_write_queues: %d",
                   two_write_queues);
757 758
  ROCKS_LOG_HEADER(log, "            Options.manual_wal_flush: %d",
                   manual_wal_flush);
759 760 761 762
  ROCKS_LOG_HEADER(log, "            Options.atomic_flush: %d", atomic_flush);
  ROCKS_LOG_HEADER(log,
                   "            Options.avoid_unnecessary_blocking_io: %d",
                   avoid_unnecessary_blocking_io);
763 764
  ROCKS_LOG_HEADER(log, "                Options.persist_stats_to_disk: %u",
                   persist_stats_to_disk);
765 766
  ROCKS_LOG_HEADER(log, "                Options.write_dbid_to_manifest: %d",
                   write_dbid_to_manifest);
767 768 769
  ROCKS_LOG_HEADER(
      log, "                Options.log_readahead_size: %" ROCKSDB_PRIszt,
      log_readahead_size);
770
  ROCKS_LOG_HEADER(log, "                Options.file_checksum_gen_factory: %s",
771 772
                   file_checksum_gen_factory ? file_checksum_gen_factory->Name()
                                             : kUnknownFileChecksumFuncName);
773 774
  ROCKS_LOG_HEADER(log, "                Options.best_efforts_recovery: %d",
                   static_cast<int>(best_efforts_recovery));
775 776 777 778 779
  ROCKS_LOG_HEADER(log, "               Options.max_bgerror_resume_count: %d",
                   max_bgerror_resume_count);
  ROCKS_LOG_HEADER(log,
                   "           Options.bgerror_resume_retry_interval: %" PRIu64,
                   bgerror_resume_retry_interval);
780 781
  ROCKS_LOG_HEADER(log, "            Options.allow_data_in_errors: %d",
                   allow_data_in_errors);
782 783
  ROCKS_LOG_HEADER(log, "            Options.db_host_id: %s",
                   db_host_id.c_str());
784 785
}

786
MutableDBOptions::MutableDBOptions()
787 788 789
    : max_background_jobs(2),
      base_background_compactions(-1),
      max_background_compactions(-1),
790
      max_subcompactions(0),
791
      avoid_flush_during_shutdown(false),
792
      writable_file_max_buffer_size(1024 * 1024),
793
      delayed_write_rate(2 * 1024U * 1024U),
794
      max_total_wal_size(0),
795
      delete_obsolete_files_period_micros(6ULL * 60 * 60 * 1000000),
L
Leonidas Galanis 已提交
796
      stats_dump_period_sec(600),
797 798
      stats_persist_period_sec(600),
      stats_history_buffer_size(1024 * 1024),
799 800
      max_open_files(-1),
      bytes_per_sync(0),
801
      wal_bytes_per_sync(0),
802
      strict_bytes_per_sync(false),
803 804
      compaction_readahead_size(0),
      max_background_flushes(-1) {}
805 806

MutableDBOptions::MutableDBOptions(const DBOptions& options)
807 808
    : max_background_jobs(options.max_background_jobs),
      base_background_compactions(options.base_background_compactions),
Y
Yi Wu 已提交
809
      max_background_compactions(options.max_background_compactions),
810
      max_subcompactions(options.max_subcompactions),
811
      avoid_flush_during_shutdown(options.avoid_flush_during_shutdown),
812
      writable_file_max_buffer_size(options.writable_file_max_buffer_size),
813
      delayed_write_rate(options.delayed_write_rate),
814 815
      max_total_wal_size(options.max_total_wal_size),
      delete_obsolete_files_period_micros(
816
          options.delete_obsolete_files_period_micros),
L
Leonidas Galanis 已提交
817
      stats_dump_period_sec(options.stats_dump_period_sec),
818 819
      stats_persist_period_sec(options.stats_persist_period_sec),
      stats_history_buffer_size(options.stats_history_buffer_size),
820 821
      max_open_files(options.max_open_files),
      bytes_per_sync(options.bytes_per_sync),
822
      wal_bytes_per_sync(options.wal_bytes_per_sync),
823
      strict_bytes_per_sync(options.strict_bytes_per_sync),
824 825
      compaction_readahead_size(options.compaction_readahead_size),
      max_background_flushes(options.max_background_flushes) {}
826

827
void MutableDBOptions::Dump(Logger* log) const {
828 829
  ROCKS_LOG_HEADER(log, "            Options.max_background_jobs: %d",
                   max_background_jobs);
830 831
  ROCKS_LOG_HEADER(log, "            Options.max_background_compactions: %d",
                   max_background_compactions);
832 833
  ROCKS_LOG_HEADER(log, "            Options.max_subcompactions: %" PRIu32,
                   max_subcompactions);
834 835
  ROCKS_LOG_HEADER(log, "            Options.avoid_flush_during_shutdown: %d",
                   avoid_flush_during_shutdown);
836 837 838
  ROCKS_LOG_HEADER(
      log, "          Options.writable_file_max_buffer_size: %" ROCKSDB_PRIszt,
      writable_file_max_buffer_size);
839 840 841 842 843 844 845
  ROCKS_LOG_HEADER(log, "            Options.delayed_write_rate : %" PRIu64,
                   delayed_write_rate);
  ROCKS_LOG_HEADER(log, "            Options.max_total_wal_size: %" PRIu64,
                   max_total_wal_size);
  ROCKS_LOG_HEADER(
      log, "            Options.delete_obsolete_files_period_micros: %" PRIu64,
      delete_obsolete_files_period_micros);
846 847
  ROCKS_LOG_HEADER(log, "                  Options.stats_dump_period_sec: %u",
                   stats_dump_period_sec);
848 849
  ROCKS_LOG_HEADER(log, "                Options.stats_persist_period_sec: %d",
                   stats_persist_period_sec);
850 851 852 853
  ROCKS_LOG_HEADER(
      log,
      "                Options.stats_history_buffer_size: %" ROCKSDB_PRIszt,
      stats_history_buffer_size);
L
Leonidas Galanis 已提交
854 855
  ROCKS_LOG_HEADER(log, "                         Options.max_open_files: %d",
                   max_open_files);
856 857 858 859 860 861
  ROCKS_LOG_HEADER(log,
                   "                         Options.bytes_per_sync: %" PRIu64,
                   bytes_per_sync);
  ROCKS_LOG_HEADER(log,
                   "                     Options.wal_bytes_per_sync: %" PRIu64,
                   wal_bytes_per_sync);
862 863 864
  ROCKS_LOG_HEADER(log,
                   "                  Options.strict_bytes_per_sync: %d",
                   strict_bytes_per_sync);
865 866 867
  ROCKS_LOG_HEADER(log,
                   "      Options.compaction_readahead_size: %" ROCKSDB_PRIszt,
                   compaction_readahead_size);
868 869
  ROCKS_LOG_HEADER(log, "                 Options.max_background_flushes: %d",
                          max_background_flushes);
870
}
871

872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887
#ifndef ROCKSDB_LITE
Status GetMutableDBOptionsFromStrings(
    const MutableDBOptions& base_options,
    const std::unordered_map<std::string, std::string>& options_map,
    MutableDBOptions* new_options) {
  assert(new_options);
  *new_options = base_options;
  ConfigOptions config_options;
  Status s = OptionTypeInfo::ParseType(
      config_options, options_map, db_mutable_options_type_info, new_options);
  if (!s.ok()) {
    *new_options = base_options;
  }
  return s;
}

888 889 890 891 892 893 894 895 896
bool MutableDBOptionsAreEqual(const MutableDBOptions& this_options,
                              const MutableDBOptions& that_options) {
  ConfigOptions config_options;
  std::string mismatch;
  return OptionTypeInfo::StructsAreEqual(
      config_options, "MutableDBOptions", &db_mutable_options_type_info,
      "MutableDBOptions", &this_options, &that_options, &mismatch);
}

897 898 899 900 901 902 903
Status GetStringFromMutableDBOptions(const ConfigOptions& config_options,
                                     const MutableDBOptions& mutable_opts,
                                     std::string* opt_string) {
  return OptionTypeInfo::SerializeType(
      config_options, db_mutable_options_type_info, &mutable_opts, opt_string);
}
#endif  // ROCKSDB_LITE
904
}  // namespace ROCKSDB_NAMESPACE