Skip to content

Commit

Permalink
addressed review comments from Wangchong
Browse files Browse the repository at this point in the history
  • Loading branch information
dndx committed Jan 13, 2022
1 parent 5519927 commit c8e03f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kong/api/routes/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ return {
})
end

if err:find("MDB_MAP_FULL", nil, true) then
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 LMDB database, " ..
Expand Down
4 changes: 0 additions & 4 deletions kong/clustering/data_plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ local function send_ping(c, log_suffix)

local hash = declarative.get_current_hash()

if hash == "true" then
hash = string.rep("0", 32)
end

local _, err = c:send_ping(hash)
if err then
ngx_log(is_timeout(err) and ngx_NOTICE or ngx_WARN, _log_prefix,
Expand Down
5 changes: 4 additions & 1 deletion kong/db/declarative/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ function declarative.load_into_cache(entities, meta, hash)

t:set("tags||@list", tags)

hash = hash or "true"
hash = hash or string.rep("0", 32)
t:set(DECLARATIVE_HASH_KEY, hash)

kong.default_workspace = default_workspace
Expand Down Expand Up @@ -846,6 +846,9 @@ do
return nil, "failed to broadcast reconfigure event: " .. (err or ok)
end

elseif err:find("MDB_MAP_FULL", nil, true) then
return nil, "map full"

else
return nil, err
end
Expand Down

0 comments on commit c8e03f9

Please sign in to comment.