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

config: iproto section for instance config

This section describes the instance iproto configuration.

Part of #8778

NO_DOC=will be added later
NO_CHANGELOG=will be added later
parent 8ea35a34
No related branches found
No related tags found
No related merge requests found
......@@ -267,6 +267,39 @@ return schema.new('instance_config', schema.record({
end
end,
}),
iproto = schema.record({
-- XXX: listen/advertise are specific: accept a string of
-- a particular format, a number (port), a table of a
-- particular format.
--
-- Only a string (without further validation) is accepted
-- for now.
listen = schema.scalar({
type = 'string',
box_cfg = 'listen',
default = box.NULL,
}),
advertise = schema.scalar({
type = 'string',
default = box.NULL,
}),
threads = schema.scalar({
type = 'integer',
box_cfg = 'iproto_threads',
box_cfg_nondynamic = true,
default = 1,
}),
net_msg_max = schema.scalar({
type = 'integer',
box_cfg = 'net_msg_max',
default = 768,
}),
readahead = schema.scalar({
type = 'integer',
box_cfg = 'readahead',
default = 16320,
}),
}),
}, {
-- Any configuration data should contain a version of the
-- config schema for which it is written.
......
......@@ -192,3 +192,27 @@ g.test_log = function()
local res = instance_config:apply_default({}).log
t.assert_equals(res, exp)
end
g.test_iproto = function()
local iconfig = {
iproto = {
listen = 'one',
advertise = 'two',
threads = 1,
net_msg_max = 1,
readahead = 1,
},
}
instance_config:validate(iconfig)
validate_fields(iconfig.iproto, instance_config.schema.fields.iproto)
local exp = {
listen = box.NULL,
advertise = box.NULL,
threads = 1,
net_msg_max = 768,
readahead = 16320,
}
local res = instance_config:apply_default({}).iproto
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