diff --git a/conf/scylla.yaml b/conf/scylla.yaml index 1c3afc7cc35f..4b16b211488d 100644 --- a/conf/scylla.yaml +++ b/conf/scylla.yaml @@ -71,6 +71,14 @@ commitlog_sync_period_in_ms: 10000 # is reasonable. commitlog_segment_size_in_mb: 32 +# The size of the individual schema commitlog file segments. +# +# The default size is 128, which is 4 times larger than the default +# size of the data commitlog. It's because the segment size puts +# a limit on the mutation size that can be written at once, and some +# schema mutation writes are much larger than average. +schema_commitlog_segment_size_in_mb: 128 + # seed_provider class_name is saved for future use. # A seed address is mandatory. seed_provider: diff --git a/db/config.cc b/db/config.cc index 0b47655d5695..e2bae16db293 100644 --- a/db/config.cc +++ b/db/config.cc @@ -469,6 +469,9 @@ db::config::config(std::shared_ptr exts) , commitlog_segment_size_in_mb(this, "commitlog_segment_size_in_mb", value_status::Used, 64, "Sets the size of the individual commitlog file segments. A commitlog segment may be archived, deleted, or recycled after all its data has been flushed to SSTables. This amount of data can potentially include commitlog segments from every table in the system. The default size is usually suitable for most commitlog archiving, but if you want a finer granularity, 8 or 16 MB is reasonable. See Commit log archive configuration.\n" "Related information: Commit log archive configuration") + , schema_commitlog_segment_size_in_mb(this, "schema_commitlog_segment_size_in_mb", value_status::Used, 128, + "Sets the size of the individual schema commitlog file segments. The default size is larger than the default size of the data commitlog because the segment size puts a limit on the mutation size that can be written at once, and some schema mutation writes are much larger than average.\n" + "Related information: Commit log archive configuration") /* Note: does not exist on the listing page other than in above comment, wtf? */ , commitlog_sync_period_in_ms(this, "commitlog_sync_period_in_ms", value_status::Used, 10000, "Controls how long the system waits for other writes before performing a sync in \"periodic\" mode.") diff --git a/db/config.hh b/db/config.hh index ba07a34a5341..aac75a71d6f8 100644 --- a/db/config.hh +++ b/db/config.hh @@ -199,6 +199,7 @@ public: named_value failure_detector_timeout_in_ms; named_value commitlog_sync; named_value commitlog_segment_size_in_mb; + named_value schema_commitlog_segment_size_in_mb; named_value commitlog_sync_period_in_ms; named_value commitlog_sync_batch_window_in_ms; named_value commitlog_total_space_in_mb; diff --git a/replica/database.cc b/replica/database.cc index e6515869928b..2983b3cfc929 100644 --- a/replica/database.cc +++ b/replica/database.cc @@ -951,8 +951,7 @@ void database::maybe_init_schema_commitlog() { c.fname_prefix = db::schema_tables::COMMITLOG_FILENAME_PREFIX; c.metrics_category_name = "schema-commitlog"; c.commitlog_total_space_in_mb = 10 << 20; - c.commitlog_segment_size_in_mb = _cfg.commitlog_segment_size_in_mb(); - c.commitlog_sync_period_in_ms = _cfg.commitlog_sync_period_in_ms(); + c.commitlog_segment_size_in_mb = _cfg.schema_commitlog_segment_size_in_mb(); c.mode = db::commitlog::sync_mode::BATCH; c.extensions = &_cfg.extensions(); c.use_o_dsync = _cfg.commitlog_use_o_dsync();