Skip to content

Commit

Permalink
fix(plugin/bk-cache-fallback): bk-cache-fallback use the separate sha…
Browse files Browse the repository at this point in the history
…red_dict for lock
  • Loading branch information
wklken committed Sep 19, 2023
1 parent ca182a3 commit 45dac8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/apisix/plugins/bk-cache-fallback/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ local ngx_shared = ngx.shared

local fallback_missing_err = "create_obj_funcs failed and got no data in the shared_dict for fallback"

-- NOTE: here we use the same shared_dict as apisix lrucache-lock
-- if this become a problem in the future, we should apply and use our own bk-lrucache-lock
local lock_shdict_name = "lrucache-lock"
-- NOTE: change to separate shared_dict, avoid use the name with `lurcache-lock`
local lock_shdict_name = "plugin-bk-cache-fallback-lock"
if ngx.config.subsystem == "stream" then
lock_shdict_name = lock_shdict_name .. "-" .. ngx.config.subsystem
end
Expand Down
1 change: 1 addition & 0 deletions src/apisix/tests/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ lua_shared_dict plugin-limit-conn 1m;
lua_shared_dict prometheus-metrics 1m;
lua_shared_dict plugin-bk-permission 1m;
lua_shared_dict plugin-bk-cache-fallback 1m;
lua_shared_dict plugin-bk-cache-fallback-lock 1m;
# for unittest, bk-cache-fallback/init.lua, case ok/fail/ok->fail
lua_shared_dict plugin-bk-cache-fallback-ok 1m;
lua_shared_dict plugin-bk-cache-fallback-fail 1m;
Expand Down

0 comments on commit 45dac8f

Please sign in to comment.