Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dbless) use LMDB as DB-less backend #8224

Merged
merged 5 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ci/setup_env_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ OPENRESTY=$(dep_version RESTY_VERSION)
LUAROCKS=$(dep_version RESTY_LUAROCKS_VERSION)
OPENSSL=$(dep_version RESTY_OPENSSL_VERSION)
PCRE=$(dep_version RESTY_PCRE_VERSION)
RESTY_LMDB=$(dep_version RESTY_LMDB_VERSION)


#---------
Expand All @@ -32,6 +33,7 @@ kong-ngx-build \
--kong-nginx-module $KONG_NGINX_MODULE_BRANCH \
--luarocks $LUAROCKS \
--openssl $OPENSSL \
--resty-lmdb $RESTY_LMDB \
--pcre $PCRE \
--debug

Expand Down
1 change: 1 addition & 0 deletions .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RESTY_VERSION=1.19.9.1
RESTY_LUAROCKS_VERSION=3.8.0
RESTY_OPENSSL_VERSION=1.1.1n
RESTY_PCRE_VERSION=8.45
RESTY_LMDB_VERSION=master
LIBYAML_VERSION=0.2.5
KONG_BUILD_TOOLS_VERSION=4.25.3
KONG_NGINX_MODULE_BRANCH=0.2.1
1 change: 1 addition & 0 deletions kong-2.8.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ build = {
["kong.db.dao.vaults"] = "kong/db/dao/vaults.lua",
["kong.db.dao.workspaces"] = "kong/db/dao/workspaces.lua",
["kong.db.declarative"] = "kong/db/declarative/init.lua",
["kong.db.declarative.marshaller"] = "kong/db/declarative/marshaller.lua",
["kong.db.schema"] = "kong/db/schema/init.lua",
["kong.db.schema.entities.consumers"] = "kong/db/schema/entities/consumers.lua",
["kong.db.schema.entities.routes"] = "kong/db/schema/entities/routes.lua",
Expand Down
7 changes: 4 additions & 3 deletions kong/api/routes/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ return {
})
end

if err == "no memory" then
kong.log.err("not enough cache space for declarative config")
if err == "map full" then
kong.log.err("not enough space for declarative config")
return kong.response.exit(413, {
message = "Configuration does not fit in Kong cache"
message = "Configuration does not fit in LMDB database, " ..
"consider raising the \"lmdb_map_size\" config for Kong"
dndx marked this conversation as resolved.
Show resolved Hide resolved
})
end

Expand Down
3 changes: 3 additions & 0 deletions kong/conf_loader/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,9 @@ local CONF_INFERENCES = {
untrusted_lua = { enum = { "on", "off", "sandbox" } },
untrusted_lua_sandbox_requires = { typ = "array" },
untrusted_lua_sandbox_environment = { typ = "array" },

lmdb_environment_path = { typ = "string" },
lmdb_map_size = { typ = "string" },
}


Expand Down
1 change: 0 additions & 1 deletion kong/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ local constants = {
PROTOCOLS = protocols,
PROTOCOLS_WITH_SUBSYSTEM = protocols_with_subsystem,

DECLARATIVE_PAGE_KEY = "declarative:page",
DECLARATIVE_LOAD_KEY = "declarative_config:loaded",
DECLARATIVE_HASH_KEY = "declarative_config:hash",
DECLARATIVE_EMPTY_CONFIG_HASH = string.rep("0", 32),
Expand Down
Loading