Skip to content
Snippets Groups Projects
Commit c6e9b673 authored by Mergen Imeev's avatar Mergen Imeev Committed by Alexander Turenko
Browse files

config: wal section for instance config

This section describes the instance WAL configuration.

Part of #8778

NO_DOC=will be added later
NO_CHANGELOG=will be added later
parent 00300baf
No related branches found
No related tags found
No related merge requests found
......@@ -414,6 +414,45 @@ return schema.new('instance_config', schema.record({
default = 1024 * 1024,
}),
}),
wal = schema.record({
dir = schema.scalar({
type = 'string',
box_cfg = 'wal_dir',
box_cfg_nondynamic = true,
mkdir = true,
default = '{{ instance_name }}',
}),
mode = schema.enum({
'none',
'write',
'fsync',
}, {
box_cfg = 'wal_mode',
box_cfg_nondynamic = true,
default = 'write',
}),
max_size = schema.scalar({
type = 'integer',
box_cfg = 'wal_max_size',
box_cfg_nondynamic = true,
default = 256 * 1024 * 1024,
}),
dir_rescan_delay = schema.scalar({
type = 'number',
box_cfg = 'wal_dir_rescan_delay',
default = 2,
}),
queue_max_size = schema.scalar({
type = 'integer',
box_cfg = 'wal_queue_max_size',
default = 16 * 1024 * 1024,
}),
cleanup_delay = schema.scalar({
type = 'number',
box_cfg = 'wal_cleanup_delay',
default = 4 * 3600,
}),
}),
}, {
-- Any configuration data should contain a version of the
-- config schema for which it is written.
......
......@@ -326,3 +326,29 @@ g.test_vinyl = function()
local res = instance_config:apply_default({}).vinyl
t.assert_equals(res, exp)
end
g.test_wal = function()
local iconfig = {
wal = {
dir = 'one',
mode = 'none',
max_size = 1,
dir_rescan_delay = 1,
queue_max_size = 1,
cleanup_delay = 1,
},
}
instance_config:validate(iconfig)
validate_fields(iconfig.wal, instance_config.schema.fields.wal)
local exp = {
dir = '{{ instance_name }}',
mode = 'write',
max_size = 268435456,
dir_rescan_delay = 2,
queue_max_size = 16777216,
cleanup_delay = 14400,
}
local res = instance_config:apply_default({}).wal
t.assert_equals(res, exp)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment