Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
b2ee33bd
Commit
b2ee33bd
authored
8 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
gh-1419: add checks in box.cfg{} for slab_alloc_minimal, add a test case
parent
40eab2ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/box/box.cc
+10
-0
10 additions, 0 deletions
src/box/box.cc
test/box-tap/cfg.result
+6
-1
6 additions, 1 deletion
test/box-tap/cfg.result
test/box-tap/cfg.test.lua
+6
-1
6 additions, 1 deletion
test/box-tap/cfg.test.lua
with
22 additions
and
2 deletions
src/box/box.cc
+
10
−
0
View file @
b2ee33bd
...
...
@@ -112,6 +112,15 @@ box_check_writable(void)
tnt_raise
(
LoggedError
,
ER_READONLY
);
}
static
void
box_check_slab_alloc_minimal
(
ssize_t
slab_alloc_minimal
)
{
if
(
slab_alloc_minimal
<
8
||
slab_alloc_minimal
>
1048280
)
tnt_raise
(
ClientError
,
ER_CFG
,
"slab_alloc_minimal"
,
"specified value is out of bounds"
);
}
void
process_rw
(
struct
request
*
request
,
struct
tuple
**
result
)
{
...
...
@@ -297,6 +306,7 @@ box_check_config()
box_check_readahead
(
cfg_geti
(
"readahead"
));
box_check_rows_per_wal
(
cfg_geti64
(
"rows_per_wal"
));
box_check_wal_mode
(
cfg_gets
(
"wal_mode"
));
box_check_slab_alloc_minimal
(
cfg_geti64
(
"slab_alloc_minimal"
));
}
/*
...
...
This diff is collapsed.
Click to expand it.
test/box-tap/cfg.result
+
6
−
1
View file @
b2ee33bd
TAP version 13
1..4
1
1..4
6
ok - box is not started
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid replication_source
ok - invalid wal_mode
ok - invalid rows_per_wal
...
...
This diff is collapsed.
Click to expand it.
test/box-tap/cfg.test.lua
+
6
−
1
View file @
b2ee33bd
...
...
@@ -4,7 +4,7 @@ local tap = require('tap')
local
test
=
tap
.
test
(
'cfg'
)
local
socket
=
require
(
'socket'
)
local
fio
=
require
(
'fio'
)
test
:
plan
(
4
1
)
test
:
plan
(
4
6
)
--------------------------------------------------------------------------------
-- Invalid values
...
...
@@ -17,6 +17,11 @@ local function invalid(name, val)
test
:
ok
(
not
status
and
result
:
match
(
'Incorrect'
),
'invalid '
..
name
)
end
invalid
(
'slab_alloc_minimal'
,
7
)
invalid
(
'slab_alloc_minimal'
,
0
)
invalid
(
'slab_alloc_minimal'
,
-
1
)
invalid
(
'slab_alloc_minimal'
,
1048281
)
invalid
(
'slab_alloc_minimal'
,
1000000000
)
invalid
(
'replication_source'
,
'//guest@localhost:3301'
)
invalid
(
'wal_mode'
,
'invalid'
)
invalid
(
'rows_per_wal'
,
-
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment