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(clustering): full sync threshold should be configureable #13893

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ local ngx_INFO = ngx.INFO
local ngx_DEBUG = ngx.DEBUG


-- number of versions behind before a full sync is forced
local FULL_SYNC_THRESHOLD = 512


function _M.new(strategy)
local self = {
strategy = strategy,
Expand Down Expand Up @@ -59,6 +55,9 @@ end
function _M:init_cp(manager)
local purge_delay = manager.conf.cluster_data_plane_purge_delay

-- number of versions behind before a full sync is forced
local FULL_SYNC_THRESHOLD = manager.conf.cluster_full_sync_threshold or 512

-- CP
-- Method: kong.sync.v2.get_delta
-- Params: versions: list of current versions of the database
Expand Down
1 change: 1 addition & 0 deletions kong/conf_loader/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ local CONF_PARSERS = {
cluster_dp_labels = { typ = "array" },
cluster_rpc = { typ = "boolean" },
cluster_incremental_sync = { typ = "boolean" },
cluster_full_sync_threshold = { typ = "number" },
cluster_cjson = { typ = "boolean" },

kic = { typ = "boolean" },
Expand Down
1 change: 1 addition & 0 deletions kong/templates/kong_defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cluster_use_proxy = off
cluster_dp_labels = NONE
cluster_rpc = on
cluster_incremental_sync = off
cluster_full_sync_threshold = 512
cluster_cjson = off

lmdb_environment_path = dbless.lmdb
Expand Down
Loading