Skip to content

Commit

Permalink
Merge 'config: set schema_commitlog_segment_size_in_mb to 128 ' from …
Browse files Browse the repository at this point in the history
…Patryk Jędrzejczak

Fixes #14668

In #14668, we have decided to introduce a new `scylla.yaml` variable for the schema commitlog segment size and set it to 128MB. The reason is that 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, as shown in #13864. This `schema_commitlog_segment_size_in_mb variable` variable is now added to `scylla.yaml` and `db/config`.

Additionally,  we do not derive the commitlog sync period for schema commitlog anymore because schema commitlog runs in batch mode, so it doesn't need this parameter. It has also been discussed in #14668.

Closes #14704

* github.com:scylladb/scylladb:
  replica: do not derive the commitlog sync period for schema commitlog
  config: set schema_commitlog_segment_size_in_mb to 128
  config: add schema_commitlog_segment_size_in_mb variable
  • Loading branch information
kbr-scylla committed Jul 24, 2023
2 parents 3ad844a + ee1c240 commit e6099c4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions conf/scylla.yaml
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions db/config.cc
Expand Up @@ -469,6 +469,9 @@ db::config::config(std::shared_ptr<db::extensions> 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.")
Expand Down
1 change: 1 addition & 0 deletions db/config.hh
Expand Up @@ -199,6 +199,7 @@ public:
named_value<uint32_t> failure_detector_timeout_in_ms;
named_value<sstring> commitlog_sync;
named_value<uint32_t> commitlog_segment_size_in_mb;
named_value<uint32_t> schema_commitlog_segment_size_in_mb;
named_value<uint32_t> commitlog_sync_period_in_ms;
named_value<uint32_t> commitlog_sync_batch_window_in_ms;
named_value<int64_t> commitlog_total_space_in_mb;
Expand Down
3 changes: 1 addition & 2 deletions replica/database.cc
Expand Up @@ -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();
Expand Down

0 comments on commit e6099c4

Please sign in to comment.